Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

computer vision with python - sift example error #33

Open
kimhwanyoung opened this issue Nov 12, 2017 · 2 comments
Open

computer vision with python - sift example error #33

kimhwanyoung opened this issue Nov 12, 2017 · 2 comments

Comments

@kimhwanyoung
Copy link

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
l[i],d[i] = sift.read_features_from_file(featname[i])
File "C:\Users\admin\Desktop\tasdfasdfasfd\sift.py", line 25, in read_features_from_file
f = loadtxt(filename)
File "C:\Python27\lib\site-packages\numpy\lib\npyio.py", line 896, in loadtxt
fh = iter(open(fname, 'U'))
IOError: [Errno 2] No such file or directory: 'Univ1.sift'

how can I solve this problem???

@bradraj
Copy link

bradraj commented Aug 28, 2020

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"

@Rand0409
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants