cv2.FeatureDetector_create('SIFT') causes segmentation fault
Question: I am using opencv 2.4.11 and python 2.7 for a computer vision project. I am
trying to obtain the SIFT descriptors:

    
    
    ima = cv2.imread('image.jpg')
    gray = cv2.cvtColor(ima,cv2.COLOR_BGR2GRAY)
    
    detector = cv2.FeatureDetector_create('SIFT') # or 'SURF' for that matter
    descriptor = cv2.DescriptorExtractor_create('SIFT')
    
    kpts = detector.detect(gray)
    

When calling the last instruction it throws an ugly segmentation fault. I have
to use a 2.4.x version, so uploading to the 3.x version of opencv to use SIFT
or SURF methods is not an option. I have downgraded from 3.1 previously using
sudo make uninstall and installed from 0 the actual opencv version.

Does anyone have an idea why this happens?


Answer: Try:

    
    
    import cv2
    
    ima = cv2.imread('image.jpg')
    gray = cv2.cvtColor(ima, cv2.COLOR_BGR2GRAY)
    
    detector = cv2.SIFT()
    
    kp1, des1 = detector.detectAndCompute(gray, None)
    

`detector = cv2.FeatureDetector_create('SIFT')` should also work for creating
the SIFT object.

