How to do it...

The objective is to be able to compute a fundamental matrix and a set of good matches between two views. To do so, all the found feature point correspondences will be validated using the epipolar constraint introduced in the previous recipe:

  1. To this end, we have created a class that encapsulates the different steps of the proposed robust matching process:
class RobustMatcher { private: // pointer to the feature point detector object cv::Ptr<cv::FeatureDetector> detector; // pointer to the feature descriptor extractor object cv::Ptr<cv::DescriptorExtractor> extractor; int normType; float ratio; // max ratio between 1st and 2nd NN bool refineF; // if true will refine the F matrix double distance; // min distance to epipolar ...

Get OpenCV 4 Computer Vision Application Programming Cookbook - Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.