C++ code for running feature extraction and matching on two input images using the following features in OpenCV:
SIFTSURFAKAZEORB
Several dependencies need to be available on the system:
OpenCV C++: 3.0.0 ~ 3.4.10 or 4.0.0 ~ 4.3.0CMake >= 2.6
Note that SIFT has been moved to the main OpenCV repository (patent on SIFT is expired) starting from 3.4.11 and 4.4.0, so the function call to SIFT has to be changed from cv::xfeatures2d::SIFT to cv::SIFT if newer versions of OpenCV is being used.
$ cd Feature_Matching_OpenCV
$ mkdir build
$ cd build
$ cmake ..
$ make
To run the feature matching code, go to bin/linux directory and invoke ./FeatureMatch <image1_path> <image2_path> <feature_name> <matcher_type>
Example usage: ./FeatureMatch ../../data/img1.ppm ../../data/img4.ppm SIFT DistRatio
- (Branch) master: feature detection and matching code for OpenCV version 3 & 4.
- (Branch) opencv2: includes code changes for OpenCV version 2.x.x.