forked from MasteringOpenCV/code
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRichFeatureMatcher.h
executable file
·31 lines (25 loc) · 1.15 KB
/
RichFeatureMatcher.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*****************************************************************************
* ExploringSfMWithOpenCV
******************************************************************************
* by Roy Shilkrot, 5th Dec 2012
* http://www.morethantechnical.com/
******************************************************************************
* Ch4 of the book "Mastering OpenCV with Practical Computer Vision Projects"
* Copyright Packt Publishing 2012.
* http://www.packtpub.com/cool-projects-with-opencv/book
*****************************************************************************/
#include "IFeatureMatcher.h"
class RichFeatureMatcher : public IFeatureMatcher {
private:
cv::Ptr<cv::FeatureDetector> detector;
cv::Ptr<cv::DescriptorExtractor> extractor;
std::vector<cv::Mat> descriptors;
std::vector<cv::Mat>& imgs;
std::vector<std::vector<cv::KeyPoint> >& imgpts;
public:
//c'tor
RichFeatureMatcher(std::vector<cv::Mat>& imgs,
std::vector<std::vector<cv::KeyPoint> >& imgpts);
void MatchFeatures(int idx_i, int idx_j, std::vector<cv::DMatch>* matches = NULL);
std::vector<cv::KeyPoint> GetImagePoints(int idx) { return imgpts[idx]; }
};