Ask Your Question

Revision history [back]

insufficient memory using SIFT

I want to use OpenCV Python to do SIFT feature detection on remote sensing images. These images are high resolution and can be thousands of pixels wide (7000 x 6000 or ~160 MB). I am having trouble with insufficient memory, however. I've ran the same image through SIFT in Matlab (using VLFEAT) without problems. Looking at the documentation, I see that the returned descriptor is (num_keypoints x 128) array, which is probably what is causing the memory issues. VLFEAT returns only (x,y,scale,orient), however, which is easier to store in memory. Is there a way to use OpenCV so that histogram information is not saved along the way? Or is there some other issue going on that I'm not seeing?

img = cv2.imread('home.jpg')
sift = cv2.xfeatures2d.SIFT_create()
kp, des = sift.detect(img, None)

https://docs.opencv.org/3.1.0/da/df5/tutorial_py_sift_intro.html