I'm having trouble creating the file for my SIFT algorithm

0

I'm studying feature extraction and came across Scale-Invariant Feature Transform (SIFT) and I tried it in Pycharm

import cv2
import numpy as np

img = cv2.imread('home.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)

The problem is I cannot find 'sift_keypoints.jpg' anywhere in my folders unless I comment out kp = sift.detect(gray,None) then the file is there.

What am I missing / doing wrong?

When I run the code here is the result:

...Recognition.py

Process finished with exit code -1073741819 (0xC0000005)
python
pycharm
sift
asked on Stack Overflow Nov 19, 2020 by Okabe Rintarou • edited Nov 19, 2020 by marc_s

1 Answer

0

it seems my problem was that sift = cv2.SIFT() should be sift = cv2.SIFT_create(). can anyone explain why that was the problem? i really thought kp = sift.detect(gray,none) was the problem

answered on Stack Overflow Nov 19, 2020 by Okabe Rintarou

User contributions licensed under CC BY-SA 3.0