Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenCV Python and SIFT features

I know there is a lot of questions about Python and OpenCV but I didn't find help on this special topic.

I want to extract SIFT keypoints from an image in python OpenCV.

I have recently installed OpenCV 2.3 and can access to SURF and MSER but not SIFT. I can't see anything related to SIFT in python modules (cv and cv2) (well I'm lying a bit: there are 2 constants: cv2.SIFT_COMMON_PARAMS_AVERAGE_ANGLE and cv2.SIFT_COMMON_PARAMS_FIRST_ANGLE).

This puzzles me since a while. Is that related to the fact that some parts of OpenCV are in C and other in C++? Any idea?

P.S.: I have also tried pyopencv (another python binding for OpenCV <= 2.1) without success.

like image 694
Mathieu Dubois Avatar asked Jul 17 '11 08:07

Mathieu Dubois


People also ask

What is Opencv SIFT?

SIFT (Scale Invariant Fourier Transform) Detector is used in the detection of interest points on an input image. It allows identification of localized features in images which is essential in applications such as: Object Recognition in Images.

What is SIFT in Python?

SIFT helps locate the local features in an image, commonly known as the 'keypoints' of the image. These keypoints are scale & rotation invariant that can be used for various computer vision applications, like image matching, object detection, scene detection, etc.

What is SIFT feature extraction?

SIFT stands for Scale Invariant Feature Transform, it is a feature extraction method (among others, such as HOG feature extraction) where image content is transformed into local feature coordinates that are invariant to translation, scale and other image transformations.

What is SIFT used for?

Scale-Invariant Feature Transform (SIFT)—SIFT is an algorithm in computer vision to detect and describe local features in images. It is a feature that is widely used in image processing. The processes of SIFT include Difference of Gaussians (DoG) Space Generation, Keypoints Detection, and Feature Description.

How to perform object detection in Python using OpenCV and sift?

Steps to Perform Object Detection in python using OpenCV and SIFT Load the train image and test image, do the necessary conversion between the RGB channels to make the image compatible while displayed using matplotlib create ORB (Oriented fast and Rotated Brief) with the underlying SIFT algorithm

How can I change the number of SIFT features in OpenCV?

Also, OpenCV uses the default parameters of SIFT in cv2.xfeatures2d.SIFT_create () method, you can change the number of features to retain ( nfeatures ), nOctaveLayers, sigma and more. Type help (cv2.xfeatures2d.SIFT_create) for more information.

What is SIFT in image processing?

SIFT stands for Scale Invariant Feature Transform, it is a feature extraction method (among others, such as HOG feature extraction) where image content is transformed into local feature coordinates that are invariant to translation, scale and other image transformations.

What is scale invariant feature transform (SIFT)?

In 2004, D.Lowe, University of British Columbia, came up with a new algorithm, Scale Invariant Feature Transform (SIFT) in his paper, Distinctive Image Features from Scale-Invariant Keypoints, which extract keypoints and compute its descriptors. * (This paper is easy to understand and considered to be best material available on SIFT.


Video Answer


2 Answers

I can't say whether this is the reason SIFT was not available via Python for OpenCV 2.3 (as the original question asks). However, the patent which was preventing SIFT from being included in OpenCV expired on 2020-03-06.

The distributed build of OpenCV now includes SIFT since version 4.4.0, accessible via cv2.SIFT_create() in Python.

See the documentation for further information on its use.

like image 130
kymkcay Avatar answered Sep 18 '22 12:09

kymkcay


Are you sure OpenCV is allowed to support SIFT? SIFT is a proprietary feature type, patented within the U.S. by the University of British Columbia and by David Lowe, the inventor of the algorithm. In my own research, I have had to re-write this algorithm many times. In fact, some vision researchers try to avoid SIFT and use other scale-invariant models because SIFT is proprietary.

like image 37
ely Avatar answered Sep 18 '22 12:09

ely