Ask Your Question

Revision history [back]

SR. I've only been playing with OpenCV in python and this particular part using the SIFT feature detector / description extractor in the xfeatures2d module.

When using the SIFT detector, you have to pass it the image as the first argument and a None variable (not exactly null, but a special python value) as the second argument to the detect() function. This second argument is an optional mask for the keypoint detection, but without it I think the function will throw an exception.

Since all of the python is just a wrapper for existing C++ code, I suspect that this is the same for your instance. You're probably not passing this second argument.

I also read somewhere that this only works on grayscale images. I'm not sure if that is true, as I am running it on color values without incident, but who knows, maybe I converted to grayscale before I started troubleshooting my latest issue and just forgot.

Good luck.