Question

I am using SURF features in OpenCV where the input images are converted to GRAY image.

 cvtColor(object, object, CV_RGB2GRAY);

When I went through the documentation of OpenSURF I realised that its not in grayscale.

My confusion is that can we apply SURF to any image formats (YUV, HSV, RGB) or we have to change and modify the program to achieve that?

Was it helpful?

Solution

Most feature detectors work on greyscale because they analyse the patterns of edges in the image patch. You can run SURF on any single colour channel from the colour formats you mention i.e. You can run it on Y, U or V from YUV images, or on H, S or V from HSV images. Not sure how OpenSURF treats this, but they must be using the greyscale image internally.

OTHER TIPS

Like OpenCV if you given an image to OpenSURF that is not single channel, it calls cvtColor(src, dst, CV_BGR2GRAY). If you pass either a 3 channel image in a YUV, HSV, Lab etc, things will go horribly wrong because the image will have an inappropriate color conversion applied..

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top