What are the values of the SURF descriptor?

asked 2013-10-26 11:05:34 -0600

updated 2013-10-26 11:06:20 -0600


I'm extracting SURF descriptors from an image using the following simple lines:

Ptr<DescriptorExtractor> descriptor = DescriptorExtractor::create("SURF");
    descriptor->compute(im1, kp, desc1);

Now, when I "watch" the variable desc1.data, it contains integer values in the range 0 to 255.

However, when I investigate the values using the code:

for (int j=0;j<desc1.cols; j++){
            float a=desc1.at<float>(0,j);

it contains values between -1 and 1. How is that possible? SURF shouldn't return integer values like SIFT?

Thanks in advance!

edit retag flag offensive close merge delete


hmm, that should be float values indeed.

what do you mean by 'watch' ? can it be, it's looking at the data pointer ? (which is uchar*)

if it's vs there, try : (float*)(desc1.data),128

berak gravatar imageberak ( 2013-10-26 11:08:45 -0600 )edit

yes, I'm looking at the data pointer and it contains integer values between 0 and 255, but when I execute float a=desc1.at<float>(0,j); I get that a is between -1 and 1.

GilLevi gravatar imageGilLevi ( 2013-10-26 11:10:40 -0600 )edit