Most often, patches are defined as squares of odd sizes centered at the keypoint position. The similarity between two square patches can then be measured by comparing the corresponding pixel intensity values inside the patches. A simple Sum of Squared Differences (SSD) is a popular solution. The feature matching strategy then works as follows. First, the keypoints are detected in each image. Here, let's use the FAST detector:
- Define two keypoints vectors to store the points detected in for each image, as shown in the following code:
// Define keypoints vector std::vector<cv::KeyPoint> keypoints1; std::vector<cv::KeyPoint> keypoints2;
- Create the FAST detector with a thresold of 80:
cv::Ptr<cv::FeatureDetector> ptrDetector; ...