Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sift Extraction - opencv

I'm trying to get started working with sift feature extraction using (C++) OpenCv. I need to extract features using SIFT, match them between the original image (e.g. a book) and a scene, and after that calculate the camera pose.

So far I have found this algorithm using SURF. Does anyone know a base code from which I can get started, or maybe a way to convert the algorithm in the link from SURF to SIFT?

Thanks in advance.

EDIT: Ok, I worked out a solution for the sift problem. Now I'm trying to figure the camera pose. I'm trying to use: solvePnP, can anyone help me with an example?

like image 641
Filipe Avatar asked Jul 07 '12 19:07

Filipe


People also ask

Is SIFT available in Opencv?

SIFT in OpenCV Note that these were previously only available in the opencv contrib repo, but the patent expired in the year 2020. So they are now included in the main repo.

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.

How does SIFT work Opencv?

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.


2 Answers

Check out the feature2d tutorial section of the new OpenCV docs website. There tutorials with code showing:

  1. Feature detection with e.g. SURF
  2. Feature Description
  3. Feature Matching
like image 75
Adi Shavit Avatar answered Oct 26 '22 22:10

Adi Shavit


If you have managed to find matches between the image and the scene, then I suggest you apply cv::findHomography(). It will calculate the homography matrix using 4 matches as input.

You can convert to camera pose from the homography matrix directly.

like image 27
Jav_Rock Avatar answered Oct 26 '22 22:10

Jav_Rock