map_util.h
Go to the documentation of this file.
00001 #ifndef RGBDTOOLS_MAP_UTIL_H
00002 #define RGBDTOOLS_MAP_UTIL_H
00003 
00004 #include <set>
00005 #include <pcl/surface/mls.h>
00006 #include <pcl/filters/voxel_grid.h>
00007 #include <pcl/io/pcd_io.h>
00008 #include <pcl/features/normal_3d.h>
00009 
00010 #include <opencv2/nonfree/features2d.hpp>
00011 
00012 #include "rgbdtools/types.h"
00013 #include "rgbdtools/rgbd_keyframe.h"
00014 
00015 namespace rgbdtools {
00016 void concatenate_clouds(PointCloudT& map_cloud,KeyframeVector keyframes_);
00017 
00018 void buildExpectedPhiHistorgtam(
00019   cv::Mat& histogram,
00020   double degrees_per_bin,
00021   double stdev);
00022 
00023 void buildPhiHistogram(
00024   const pcl::PointCloud<pcl::PointXYZRGBNormal>& cloud,
00025   cv::Mat& histogram,
00026   double degrees_per_bin);
00027 
00028 void normalizeHistogram(cv::Mat& histogram);
00029 
00030 void shiftHistogram(
00031   const cv::Mat& hist_in,
00032   cv::Mat& hist_out,
00033   int bins);
00034 
00035 bool alignHistogram(
00036   const cv::Mat& hist,
00037   const cv::Mat& hist_exp,
00038   double hist_resolution,
00039   double& best_angle);
00040 
00041 void create8bitHistogram(
00042   const cv::Mat& histogram,
00043   cv::Mat& histogram_norm);
00044 
00045 void createImageFromHistogram(
00046   const cv::Mat& histogram,
00047   cv::Mat& image);
00048 
00049 void create2DProjectionImage(
00050   const PointCloudT& cloud, 
00051   cv::Mat& img,
00052   double min_z = -std::numeric_limits<double>::infinity(),
00053   double max_z =  std::numeric_limits<double>::infinity());  
00054 
00055 void filterCloudByHeight(
00056   const pcl::PointCloud<pcl::PointXYZRGBNormal>& cloud_in,
00057   pcl::PointCloud<pcl::PointXYZRGBNormal>& cloud_out,
00058   double min_z,
00059   double max_z);
00060 
00061 // *** matching
00062 
00063 /*
00064 void buildDenseAssociationMatrix(
00065   const KeyframeVector& keyframes,
00066   cv::Mat& association_matrix);
00067 
00068 void buildSURFAssociationMatrixBruteForce(
00069   const KeyframeVector& keyframes,
00070   cv::Mat& correspondence_matrix,
00071   int threshold);
00072   
00073 
00074 void buildSURFAssociationMatrixTree(
00075   const KeyframeVector& keyframes,
00076   cv::Mat& correspondence_matrix,
00077   int k_nearest_neighbors,
00078   int n_candidates,
00079   int threshold);
00080 
00081 void buildRANSACCorrespondenceMatrix(
00082   const KeyframeVector& keyframes,
00083   const cv::Mat& candidate_matrix,
00084   cv::Mat& correspondence_matrix);
00085 
00086 void buildSURFCandidateMatrixTree(
00087   const cv::Mat& match_matrix,
00088   cv::Mat& candidate_matrix,
00089   int n_candidates);
00090 
00091 void buildSURFMatchMatrixTree(
00092   const KeyframeVector& keyframes,
00093   cv::Mat& match_matrix,
00094   int k_nearest_neighbors);
00095 
00096 void floatMatrixToUintMatrix(
00097   const cv::Mat& mat_in, 
00098   cv::Mat& mat_out, 
00099   float scale = 0);
00100 
00101 void prepareFeaturesForRANSAC(KeyframeVector& keyframes);
00102 
00103 void pairwiseMatchingRANSAC(
00104   const RGBDFrame& frame_a, const RGBDFrame& frame_b,
00105   double max_eucl_dist_sq, 
00106   double max_desc_dist,
00107   double sufficient_inlier_ratio,
00108   int max_ransac_iterations,
00109   std::vector<cv::DMatch>& all_matches,
00110   std::vector<cv::DMatch>& best_inlier_matches,
00111   Eigen::Matrix4f& best_transformation);
00112 */
00113 void trainSURFMatcher_Iterative(const KeyframeVector& keyframes, u_int min, u_int max,
00114   cv::FlannBasedMatcher& matcher);
00115 void trainSURFMatcher(
00116   const KeyframeVector& keyframes,
00117   cv::FlannBasedMatcher& matcher);
00118 
00119 void getRandomIndices(
00120   int k, int n, IntVector& output);
00121 
00122 void get3RandomIndices(
00123   int n, std::set<int>& mask, IntVector& output);
00124 
00125 double distEuclideanSq(const PointFeature& a, const PointFeature& b);
00126 
00127 void makeSymmetricOR(cv::Mat mat);
00128 
00129 void thresholdMatrix(
00130   const cv::Mat& mat_in, 
00131   cv::Mat& mat_out,
00132   int threshold);
00133 
00134 void compareAssociationMatrix(
00135   const cv::Mat& a,
00136   const cv::Mat& b,
00137   int& false_pos,
00138   int& false_neg,
00139   int& total);
00140 
00141 
00142 } // namespace rgbdtools
00143 
00144 #endif // RGBDTOOLS_MAP_UTIL_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends


lib_rgbdtools
Author(s): Ivan Dryanovski
autogenerated on Tue Aug 27 2013 10:33:54