PCV
PCV copied to clipboard
computer vision with python - sift example error
hello i'm trying examples in programming computer vision with python. when I try sift example in page 95, I have error as follow
Traceback (most recent call last):
File "C:\Users\admin\Desktop\tasdfasdfasfd\ch3_panorama.py", line 25, in
how can I solve this problem???
You can use sift demo binary to generate it, as described in the book page 37 titled "SIFT".
1 -> http://www.cs.ubc.ca/~lowe/keypoints/siftDemoV4.zip
2 -> convert the image file into pgm format,
3 - > use the command "./sift <Univ1.pgm >Univ1.sift"
try this with opencv3.4 and opencv contrilb python detector = cv2.xfeatures2d_SIFT.create()
im1 = array(Image.open('C:\0007.png')) keypoints1 = detector.detect(im1,None) kp1,des1 = detector.detectAndCompute(im1, None) # get all info of feature points. points2fA = cv2.KeyPoint_convert(keypoints1) # transfer all the xy coordinates to decimal
In this way you can get the xy location and other feature info.