Color band on SURF descriptors

asked 2016-12-28 10:00:51 -0600

lovaj gravatar image

updated 2016-12-28 11:17:55 -0600

I'm reading this paper for obtaining better VLAD descriptors. The main difference is the use of the so called CSURF which is (quoting the paper):

In order to extract CSURF, the image is first transformed to grayscale and interest points are computed using the standard SURF algorithm. Then, instead of computing the SURF descriptor of each interest point on the intensity channel, CSURF computes three SURF descriptors, one on each color band.

How could I implement this in OpenCV? All the descriptors that I've seen so far (SIFT, SURF, ETC) are computed on the gray scale, how could I use SURF to describe keypoints based on one color band (Red, Green or Blue)?

UPDATE: IS THIS SOLUTION CORRECT?

Mat img_1 = imread( argv[1], IMREAD_GRAYSCALE );

int minHessian = 400;
Ptr<SURF> detector = SURF::create( minHessian );
std::vector<KeyPoint> keypoints;

detector->detect( img, keypoints );

vector<Mat> spl;
Mat blueDesc, greenDesc, redDesc;
split(src,spl);
detector->detectAndCompute( spl[0], Mat(), keypoints, blueDesc, true);
detector->detectAndCompute( spl[1], Mat(), keypoints, greenDesc, true);
detector->detectAndCompute( spl[2], Mat(), keypoints, redDesc, true);
edit retag flag offensive close merge delete

Comments

I think you use detectAndCompute method to get keypoint for first plane

Then have you try to call detectAndCompute as parameter keypoint as image other color plane with last parameter useProvidedKeypoints true.

LBerger gravatar imageLBerger ( 2016-12-28 10:36:26 -0600 )edit

@LBerger Please look at the UPDATE section

lovaj gravatar imagelovaj ( 2016-12-28 11:18:55 -0600 )edit

Idea is here but variable are weird

Mat img_1 = imread( argv[1], IMREAD_COLOR );
split(img_1,spl);

I am not sure there is a detect method for surf

detector->detect( img, keypoints );

if no try like this

detector->detectAndCompute( spl[0], Mat(), keypoints, blueDesc, false);
detector->detectAndCompute( spl[1], Mat(), keypoints, greenDesc, true);
detector->detectAndCompute( spl[2], Mat(), keypoints, redDesc, true);
LBerger gravatar imageLBerger ( 2016-12-28 11:47:56 -0600 )edit