Computer Vision: What is a SIFT vector? How can I normalize its values? How can I choose one of the best descriptors?
-
I'm implementing the SIFT algorithm in Python, with OpenCV 2.x My code until now looks like this: import cv2 import numpy as np img = cv2.imread('C:\Python27\lena.jpg') gray= cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) sift = cv2.SIFT() kp = sift.detect(gray,None) img=cv2.drawKeypoints(gray,kp) cv2.imwrite('sift_keypoints.jpg',img) kp, des = sift.detectAndCompute(gray,None) cv2.imshow('image',img) k = cv2.waitKey(0) if k == 27: t cv2.destroyAllWindows() elif k == ord('s'): cv2.destroyAllWindows() a = np.arange(127*127).reshape(127, 127) np.set_printoptions(edgeitems=127) f = open('file.txt','w') f.write('answer:'+str(des)) f.close() But there are two things I don't know how to implement in the program: -How can i proccess more than one image in the program? -How to store the matrix of descriptors in a dataset for training machine? (using Support Vector Machines) - Here I need to first pick up 25 to 30 best descriptors (to reduce computer proccessing), and then normalize their values.
-
Answer:
To answer a few of your questions: 1. To process more than one image, simply crawl the directory in which your images are present using python, and read them using the openCV imread function as you've done in line 3. 2. A SIFT vector is a 128 dimension vector that describes a particular key point in your image. 3. Each image will consist of N keypoints, each of which is described by this 128 dimension vector. So essentially, your image can be represented by this Nx128 matrix. I am not entirely sure if there is a way to pick up the "best" keypoints in your image but there is a dense SIFT algorithm that computes the SIFT vector at very pixel or every k pixels which you could use to trade-off computation time for accuracy. It might be a little more helpful if you tell us what exactly it is you are trying to do with the SIFT features.
Sandeep Subramanian at Quora Visit the source
Other answers
you can find detailed step wise tutorial here @http://www.aishack.in/tutorials/sift-scale-invariant-feature-transform-introduction/
Ravi Shukla
Related Q & A:
- How can I cancel a Yahoo Alert that I set up earlier?Best solution by Yahoo! Answers
- What is a recruiter and how do I find one?Best solution by guides.wsj.com
- How can I move bookmarks from one email to another one?Best solution by pcworld.com
- Can please someone tell me how can I repair my computer?Best solution by Yahoo! Answers
- What is a mixtape and how do I make one?Best solution by independentmusicadvice.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.