How it works...

To create an instance of the SIFT keypoints detector, you need to use the cv2.xfeatures2d.SIFT_create function. All its arguments have default values, and the arguments themselves are: the number of keypoints to find and return, the number of levels in the scale pyramid to use, the two thresholds to tune the sensitivity of the algorithm, and the sigma variance for presmoothing the image. All of the arguments are important, but the ones you probably need to tunr in the first place are the number of keypoints and the sigma. The last one controls the maximal size of the objects you don't care about and can be useful to remove the noise and extra small details from the image.

As a result of completing the code from the recipe, ...

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.