1 #ifndef __VISUAL_ODOMETRY_STEREO_HPP__ 2 #define __VISUAL_ODOMETRY_STEREO_HPP__ 4 #include <stereo/config.h> 5 #include <stereo/sparse_stereo_types.h> 6 #include <frame_helper/CalibrationCv.h> 7 #include <base/Time.hpp> 8 #include <base/Eigen.hpp> 9 #include <base/samples/DistanceImage.hpp> 11 #ifdef OPENCV_HAS_GPUMAT_IN_CORE 12 #include <opencv2/core/gpumat.hpp> 14 #include <opencv2/gpu/gpu.hpp> 36 void setCalibration(
const frame_helper::StereoCalibration &calib );
53 void setDistanceImages(
54 const base::samples::DistanceImage *left,
55 const base::samples::DistanceImage *right );
63 void processFramePair(
const cv::Mat &left_image,
const cv::Mat &right_image,
StereoFeatureArray *stereo_features = NULL );
80 void calculateInterFrameCorrespondences(
81 const cv::Mat& feat1,
const std::vector<cv::KeyPoint>& keyp1,
const std::vector<Eigen::Vector3d>& points1,
82 const cv::Mat& feat2,
const std::vector<cv::KeyPoint>& keyp2,
const std::vector<Eigen::Vector3d>& points2,
107 cv::Mat getInterFrameDebugImage(
const cv::Mat& debug1,
const StereoFeatureArray& frame1,
const cv::Mat& debug2,
const StereoFeatureArray& frame2 , std::vector<std::pair<long,long> > *correspondence = NULL);
111 void findFeatures(
const cv::Mat &left_image,
const cv::Mat &right_image,
int use_threading = 1,
int crop_left = 0,
int crop_right = 0);
112 bool getPutativeStereoCorrespondences();
113 bool refineFeatureCorrespondences();
114 void calculateDepthInformationBetweenCorrespondences(
StereoFeatureArray *stereo_features = NULL);
116 void crossCheckMatching(
const cv::Mat& descriptors1,
const cv::Mat& descriptors2,
117 std::vector<cv::DMatch>& filteredMatches12,
int knn = 1,
float distanceFactor = 2.0 );
122 void initDetector(
size_t lastNumFeatures );
123 void findFeatures2(
const cv::Mat &image,
FeatureInfo& info,
bool left_frame =
true,
int crop_left = 0,
int crop_right = 0 );
124 void findFeatures_threading(
const cv::Mat &image,
FeatureInfo& info,
bool left_frame =
true,
int crop_left = 0,
int crop_right = 0);
126 void crossCheckMatching( std::vector<std::vector<cv::DMatch> > matches12, std::vector<std::vector<cv::DMatch> > matches21, std::vector<cv::DMatch>& filteredMatches12,
int knn = 1,
float distanceFactor = 2.0);
128 frame_helper::StereoCalibrationCv
calib;
Definition: sparse_stereo.hpp:20
Definition: sparse_stereo.hpp:29
FeatureInfo rightPutativeMatches
Definition: sparse_stereo.hpp:133
const base::samples::DistanceImage * dist_right
Definition: sparse_stereo.hpp:148
Definition: sparse_stereo_types.h:120
DetectorConfiguration detectorParams
Definition: sparse_stereo.hpp:130
cv::gpu::GpuMat descriptors_gpu_left
Definition: sparse_stereo.hpp:150
Definition: sparse_stereo_types.h:41
cv::Ptr< cv::DescriptorExtractor > descriptorExtractor
Definition: sparse_stereo.hpp:141
cv::Ptr< cv::DescriptorMatcher > descriptorMatcher
Definition: sparse_stereo.hpp:142
cv::Mat homography
Definition: sparse_stereo.hpp:144
cv::Mat getHomography()
Definition: sparse_stereo.hpp:119
bool use_gpu_detector
Definition: sparse_stereo.hpp:149
FeatureInfo & getFeatureInfoRight()
Definition: sparse_stereo.hpp:75
const cv::Mat & getDebugImage()
Definition: sparse_stereo.hpp:103
FeatureInfo rightMatches
Definition: sparse_stereo.hpp:134
FeatureInfo & getFeatureInfoLeft()
Definition: sparse_stereo.hpp:71
base::Affine3d getInterFrameCorrespondenceTransform()
Definition: sparse_stereo.hpp:95
Definition: configuration.cpp:3
std::vector< std::pair< long, long > > getInterFrameCorrespondences()
Definition: sparse_stereo.hpp:90
frame_helper::StereoCalibrationCv calib
Definition: sparse_stereo.hpp:128
int debugRightOffset
Definition: sparse_stereo.hpp:147
cv::Mat descriptors
Definition: sparse_stereo.hpp:26
std::vector< cv::KeyPoint > keypoints
Definition: sparse_stereo.hpp:25
cv::Ptr< cv::FeatureDetector > detector
Definition: sparse_stereo.hpp:140
base::Time descriptorTime
Definition: sparse_stereo.hpp:23
base::Affine3d correspondenceTransform
Definition: sparse_stereo.hpp:138
Definition: sparse_stereo_types.h:58
FeatureInfo rightFeatures
Definition: sparse_stereo.hpp:132
StereoFeatureArray stereoFeatures
Definition: sparse_stereo.hpp:136
FeatureConfiguration config
Definition: sparse_stereo.hpp:129
StereoFeatureArray & getStereoFeatures()
Definition: sparse_stereo.hpp:67
cv::gpu::GpuMat descriptors_gpu_right
Definition: sparse_stereo.hpp:151
base::Time detectorTime
Definition: sparse_stereo.hpp:22
cv::Mat debugImage
Definition: sparse_stereo.hpp:146
std::vector< std::pair< long, long > > correspondences
Definition: sparse_stereo.hpp:137