March 2019
Intermediate to advanced
532 pages
13h 2m
English
In order to complete this section, we are going to see the final step to find objects. Once the features are matched, the next step is to find a perspective transformation between the location of the matched keypoints in the two images using the cv2.findHomography() function.
OpenCV provides several methods to compute the homography matrix—RANSAC, Least-Median (LMEDS), and PROSAC (RHO). In this example, we are using RANSAC, shown as follows:
M, mask = cv2.findHomography(pts_src, pts_dst, cv2.RANSAC, 5.0)
Here, pts_src are the location of the matched key points in the source image, and pts_dst are the locations of the matched keypoints in the query image.
The fourth parameter, ransacReprojThreshold ...