How it works...

All of the previously used keypoint descriptors implement the cv2.Feature2D interface and have the same fashion of use. All of them require the creation of the descriptor object as a first step. Then, there is a possibility to set or tune some parameters of the created descriptor. It's worth mentioning that the descriptors have default values for the parameters of algorithms, and these chosen default values work well in many cases. When the descriptor is ready to be used, the detect, compute, and detectAndCompute methods should be used to retrieve keypoints and/or descriptors for the specified image.

To create SURF descriptors, you need to call the cv2.xfeatures2d.SURF_create function. It takes a considerable number of arguments, ...

Get OpenCV 3 Computer Vision with Python Cookbook 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.