#include <QMatrix4x4>
#include <tf/transform_datatypes.h>
#include <sensor_msgs/Image.h>
#include <sensor_msgs/CameraInfo.h>
#include <cv.h>
#include "point_types.h"
#include "g2o/types/slam3d/vertex_se3.h"
Go to the source code of this file.
Functions | |
bool | asyncFrameDrop (ros::Time depth, ros::Time rgb) |
Return true if frames should be dropped because they are asynchronous. | |
pointcloud_type * | createXYZRGBPointCloud (const sensor_msgs::ImageConstPtr &depth_msg, const sensor_msgs::ImageConstPtr &rgb_msg, const sensor_msgs::CameraInfoConstPtr &cam_info) |
Creates a pointcloud from rgb8 or mono8 coded images + float depth. | |
pointcloud_type * | createXYZRGBPointCloud (const cv::Mat &depth_msg, const cv::Mat &rgb_msg, const sensor_msgs::CameraInfoConstPtr &cam_info) |
void | depthToCV8UC1 (cv::Mat &float_img, cv::Mat &mono8_img) |
Convert the CV_32FC1 image to CV_8UC1 with a fixed scale factor. | |
g2o::SE3Quat | eigen2G2O (const Eigen::Matrix4d &eigen_mat) |
Conversion Function. | |
template<typename T > | |
QMatrix4x4 | eigenTF2QMatrix (const T &transf) |
template<typename T > | |
tf::Transform | eigenTransf2TF (const T &transf) |
double | errorFunction (const Eigen::Vector4f &x1, const double x1_depth_cov, const Eigen::Vector4f &x2, const double x2_depth_cov, const Eigen::Matrix4f &tf_1_to_2) |
double | errorFunction2 (const Eigen::Vector4f &x1, const Eigen::Vector4f &x2, const Eigen::Matrix4d &tf_1_to_2) |
QMatrix4x4 | g2o2QMatrix (const g2o::SE3Quat se3) |
Conversion Function. | |
tf::Transform | g2o2TF (const g2o::SE3Quat se3) |
Conversion Function. | |
void | getColor (const point_type &p, unsigned char &r, unsigned char &g, unsigned char &b) |
float | getMinDepthInNeighborhood (const cv::Mat &depth, cv::Point2f center, float diameter) |
bool | isBigTrafo (const Eigen::Isometry3d &t) |
bool | isBigTrafo (const g2o::SE3Quat &t) |
bool | isSmallTrafo (const g2o::SE3Quat &t, double seconds=1.0) |
Computes whether the motion per time is bigger than the parameters max_translation_meter and max_rotation_degree define. | |
bool | isSmallTrafo (const Eigen::Isometry3d &t, double seconds=1.0) |
void | logTransform (QTextStream &out, const tf::Transform &t, double timestamp, const char *label=NULL) |
Write Transformation to textstream. | |
void | mat2components (const Eigen::Matrix4f &t, double &roll, double &pitch, double &yaw, double &dist) |
get euler angles and translation from 4x4 homogenous | |
void | mat2dist (const Eigen::Matrix4f &t, double &dist) |
get translation-distance from 4x4 homogenous | |
void | mat2RPY (const Eigen::Matrix4f &t, double &roll, double &pitch, double &yaw) |
get euler angles from 4x4 homogenous | |
bool | observation_criterion_met (unsigned int inliers, unsigned int outliers, unsigned int all, double &quality) |
Quality is output param. | |
void | observationLikelihood (const Eigen::Matrix4f &proposed_transformation, pointcloud_type::Ptr new_pc, pointcloud_type::Ptr old_pc, const sensor_msgs::CameraInfo &old_cam_info, double &likelihood, double &confidence, unsigned int &inliers, unsigned int &outliers, unsigned int &occluded, unsigned int &all) |
std::string | openCVCode2String (unsigned int code) |
Return the macro string for the cv::Mat type integer. | |
void | overlay_edges (cv::Mat visual, cv::Mat depth, cv::Mat &visual_edges, cv::Mat &depth_edges) |
Overlay the monochrom edges and depth jumps. | |
geometry_msgs::Point | pointInWorldFrame (const Eigen::Vector4f &point3d, const g2o::VertexSE3::EstimateType &transf) |
void | printMatrixInfo (const cv::Mat &image, std::string name=std::string("")) |
Print Type and size of image. | |
void | printQMatrix4x4 (const char *name, const QMatrix4x4 &m) |
void | printTransform (const char *name, const tf::Transform t) |
Print tf::Transform via ROS_INFO. | |
void | printTransform (const char *name, const tf::StampedTransform t) |
Print tf::Transform via ROS_INFO. | |
double | rejectionSignificance (const Eigen::Matrix4f &proposed_transformation, pointcloud_type::Ptr new_pc, pointcloud_type::Ptr old_pc) |
g2o::SE3Quat | tf2G2O (const tf::Transform t) |
Conversion Function. | |
void | transformAndAppendPointCloud (const pointcloud_type &cloud_in, pointcloud_type &cloud_to_append_to, const tf::Transform transformation, float Max_Depth, int idx=0) |
Apply an affine transform defined by an Eigen Transform. |
bool asyncFrameDrop | ( | ros::Time | depth, |
ros::Time | rgb | ||
) |
pointcloud_type* createXYZRGBPointCloud | ( | const sensor_msgs::ImageConstPtr & | depth_msg, |
const sensor_msgs::ImageConstPtr & | rgb_msg, | ||
const sensor_msgs::CameraInfoConstPtr & | cam_info | ||
) |
pointcloud_type* createXYZRGBPointCloud | ( | const cv::Mat & | depth_msg, |
const cv::Mat & | rgb_msg, | ||
const sensor_msgs::CameraInfoConstPtr & | cam_info | ||
) |
void depthToCV8UC1 | ( | cv::Mat & | float_img, |
cv::Mat & | mono8_img | ||
) |
g2o::SE3Quat eigen2G2O | ( | const Eigen::Matrix4d & | eigen_mat | ) |
QMatrix4x4 eigenTF2QMatrix | ( | const T & | transf | ) |
tf::Transform eigenTransf2TF | ( | const T & | transf | ) |
double errorFunction | ( | const Eigen::Vector4f & | x1, |
const double | x1_depth_cov, | ||
const Eigen::Vector4f & | x2, | ||
const double | x2_depth_cov, | ||
const Eigen::Matrix4f & | tf_1_to_2 | ||
) |
double errorFunction2 | ( | const Eigen::Vector4f & | x1, |
const Eigen::Vector4f & | x2, | ||
const Eigen::Matrix4d & | tf_1_to_2 | ||
) |
QMatrix4x4 g2o2QMatrix | ( | const g2o::SE3Quat | se3 | ) |
tf::Transform g2o2TF | ( | const g2o::SE3Quat | se3 | ) |
void getColor | ( | const point_type & | p, |
unsigned char & | r, | ||
unsigned char & | g, | ||
unsigned char & | b | ||
) |
float getMinDepthInNeighborhood | ( | const cv::Mat & | depth, |
cv::Point2f | center, | ||
float | diameter | ||
) |
bool isBigTrafo | ( | const Eigen::Isometry3d & | t | ) |
bool isBigTrafo | ( | const g2o::SE3Quat & | t | ) |
bool isSmallTrafo | ( | const g2o::SE3Quat & | t, |
double | seconds = 1.0 |
||
) |
bool isSmallTrafo | ( | const Eigen::Isometry3d & | t, |
double | seconds = 1.0 |
||
) |
void logTransform | ( | QTextStream & | out, |
const tf::Transform & | t, | ||
double | timestamp, | ||
const char * | label = NULL |
||
) |
void mat2components | ( | const Eigen::Matrix4f & | t, |
double & | roll, | ||
double & | pitch, | ||
double & | yaw, | ||
double & | dist | ||
) |
void mat2dist | ( | const Eigen::Matrix4f & | t, |
double & | dist | ||
) |
void mat2RPY | ( | const Eigen::Matrix4f & | t, |
double & | roll, | ||
double & | pitch, | ||
double & | yaw | ||
) |
bool observation_criterion_met | ( | unsigned int | inliers, |
unsigned int | outliers, | ||
unsigned int | all, | ||
double & | quality | ||
) |
void observationLikelihood | ( | const Eigen::Matrix4f & | proposed_transformation, |
pointcloud_type::Ptr | new_pc, | ||
pointcloud_type::Ptr | old_pc, | ||
const sensor_msgs::CameraInfo & | old_cam_info, | ||
double & | likelihood, | ||
double & | confidence, | ||
unsigned int & | inliers, | ||
unsigned int & | outliers, | ||
unsigned int & | occluded, | ||
unsigned int & | all | ||
) |
std::string openCVCode2String | ( | unsigned int | code | ) |
void overlay_edges | ( | cv::Mat | visual, |
cv::Mat | depth, | ||
cv::Mat & | visual_edges, | ||
cv::Mat & | depth_edges | ||
) |
geometry_msgs::Point pointInWorldFrame | ( | const Eigen::Vector4f & | point3d, |
const g2o::VertexSE3::EstimateType & | transf | ||
) |
void printMatrixInfo | ( | const cv::Mat & | image, |
std::string | name = std::string("") |
||
) |
void printQMatrix4x4 | ( | const char * | name, |
const QMatrix4x4 & | m | ||
) |
void printTransform | ( | const char * | name, |
const tf::Transform | t | ||
) |
Print tf::Transform via ROS_INFO.
void printTransform | ( | const char * | name, |
const tf::StampedTransform | t | ||
) |
Print tf::Transform via ROS_INFO.
double rejectionSignificance | ( | const Eigen::Matrix4f & | proposed_transformation, |
pointcloud_type::Ptr | new_pc, | ||
pointcloud_type::Ptr | old_pc | ||
) |
This function computes the p-value of the null hypothesis that the transformation is the true one. It is too sensitive to outliers
TODO: Compute correctly transformed new sigma in old_z direction
Very unlikely to be inlier as bigger than 3*std_dev
Compute covariance statistics also based on depth variance in the neighborhood
g2o::SE3Quat tf2G2O | ( | const tf::Transform | t | ) |
void transformAndAppendPointCloud | ( | const pointcloud_type & | cloud_in, |
pointcloud_type & | cloud_to_append_to, | ||
const tf::Transform | transformation, | ||
float | max_Depth, | ||
int | |||
) |
Apply an affine transform defined by an Eigen Transform.
Helper function to aggregate pointclouds in a single coordinate frame. idx is only for compatibilty to the Alternative function below
cloud_in | the input point cloud |
cloud_to_append_to | the transformed cloud will be appended to this one |
transform | a tf::Transform stating the transformation of cloud_to_append_to relative to cloud_in |