geometry.hpp
Go to the documentation of this file.
00001 
00005 #ifndef _THERMALVIS_GEOMETRY_H_
00006 #define _THERMALVIS_GEOMETRY_H_
00007 
00008 #include "general_resources.hpp"
00009 #include "opencv_resources.hpp"
00010 #include "pcl_resources.hpp"
00011 #include "ros_resources.hpp"
00012 
00013 #include <Eigen/Geometry>
00014 
00015 typedef Eigen::Matrix<float, 3, 3, Eigen::RowMajor> Matrix3frm;
00016 typedef Eigen::Quaternion<double>   QuaternionDbl;
00017 
00018 //#include <math.h>
00019 
00020 // FLAGS for geometric distance measurement (F & H assessment)
00021 #define SAMPSON_DISTANCE                        0
00022 #define ALGEBRAIC_DISTANCE                      1
00023 #define EPIPOLAR_DISTANCE                       2
00024 #define LOURAKIS_DISTANCE                       3
00025 
00026 #define DEFAULT_ASSIGN_MODE                     0
00027 #define MAPPER_ASSIGN_MODE                      1
00028 
00029 void assignPose(geometry_msgs::PoseStamped& pPose, cv::Mat& C, int idx, ros::Time timestamp, int mode = DEFAULT_ASSIGN_MODE);
00030 
00031 void convertTvecToEigenvec(const cv::Mat& T_src, Eigen::Vector3f& T_dst);
00032 void convertRmatTo3frm(const cv::Mat& R_src, Matrix3frm& R_dst);
00033 
00034 void convertEigenvecToTvec(const Eigen::Vector3f& T_src, cv::Mat& T_dst);
00035 void convert3frmToRmat(const Matrix3frm& R_src, cv::Mat& R_dst);
00036 
00037 void decomposeTransform(const cv::Mat& c, cv::Mat& R, cv::Mat& t);
00038 void composeTransform(const cv::Mat& R, const cv::Mat& t, cv::Mat& c);
00039 
00040 void matrixToQuaternion(const cv::Mat& mat, Eigen::Quaternion<double>& quat);
00041 void quaternionToMatrix(const Eigen::Quaternion<double>& quat, cv::Mat& mat, bool handedness = false);
00042 
00043 void transformPoints(cv::vector<cv::Point3d>& pts, unsigned int option = 0);
00044 void transformPoints(cv::vector<cv::Point3d>& pts, int *options);
00045 
00047 int minProjections(int pairs);
00048 
00050 int possiblePairs(int projections);
00051 
00052 //void matrixToQuaternion(const cv::Mat& mat, Quaterniond& quat);
00053 //void quaternionToMatrix(const Quaterniond& quat, cv::Mat& mat);
00054 
00055 void convertPoseFormat(const geometry_msgs::Pose& pose, cv::Mat& t, Eigen::Quaternion<double>& Q);
00056 void convertPoseFormat(const cv::Mat& t, const Eigen::Quaternion<double>& Q, geometry_msgs::Pose& pose);
00057 
00058 void convertAndShiftPoseFormat(const geometry_msgs::Pose& pose, cv::Mat& t, Eigen::Quaternion<double>& Q);
00059 void convertAndShiftPoseFormat(const cv::Mat& t, const Eigen::Quaternion<double>& Q, geometry_msgs::Pose& pose);
00060 
00061 void transformationToProjection(const cv::Mat& trans, cv::Mat& proj);
00062 void projectionToTransformation(const cv::Mat& proj, cv::Mat& trans);
00063 void projectionToRotation(const cv::Mat& src, cv::Mat& dst);
00064 void rotationToProjection(const cv::Mat& src, cv::Mat& dst);
00065 
00066 double normalizedGRICdifference(std::vector<cv::Point2f>& pts1, std::vector<cv::Point2f>& pts2, cv::Mat& F, cv::Mat& H, cv::Mat& mask_F, cv::Mat& mask_H, double& F_GRIC, double& H_GRIC);
00067 
00068 double calculateGRIC(std::vector<cv::Point2f>& pts1, std::vector<cv::Point2f>& pts2, cv::Mat& rel, cv::Mat& mask, int d, double k, double r, double lambda_3, int distMethod);
00069 double calculateRho(double e, double sig, double r, double lambda_3, int d);
00070 
00071 double calcGeometryDistance(cv::Point2f& pt1, cv::Point2f& pt2, cv::Mat& mat, int distMethod = SAMPSON_DISTANCE);
00072 
00073 double lourakisSampsonError(cv::Point2f& pt1, cv::Point2f& pt2, cv::Mat& H);
00074 
00075 
00076 
00077 #endif


thermalvis
Author(s): Stephen Vidas
autogenerated on Sun Jan 5 2014 11:38:45