Take the 2-minute tour ×

I want to generate SURF descriptor (a vector of length 64).
In the original paper, here it says:

The region is split up regularly into smaller 4*4 square sub-regions. For each sub-region, we compute Haar wavelet responses at 5*5 regularly spaced sample points.

With OpenCV help, I can get keypoint and its relating region (by using KeyPoint::size and angle), but my questions are:
1. how to compute Haar wavelet responses?
2. what is "at 5 x 5 regularly spaced sample points" mean?

I've read the wiki and introduction about Harr wavelet but still have no idea how to write the code.
I've known how to use the OpenCV SurfDescriptorExtractor, but I cannot use it because I need to enlarge or shrink the original region and get new descriptor.

Thanks for any hint about how to generate SURF descriptor.

share|improve this question
could you be a bit more clear about why you can't use OpenCV's implementation? –  Hammer Oct 24 '12 at 15:16
@Hammer The descriptor SurfDescriptorExtractor generated are based on meaningful rectangle region of a SURF keypoint, however, I want to enlarge or shrink the region so that I can match those points that are not original matched by original descriptor –  vancexu Oct 24 '12 at 15:48
I see. I'm sorry I don't understand the inner workings of SURF. Have you considered upsampling or downsampling your image before sending it into OpenCV's implementation? That would be fairly similar to enlarging or shrinking the region used. –  Hammer Oct 24 '12 at 15:53
The source code is in opencv/modules/nonfree/src/surf.cpp. I don't understand much of the code, but I see something related to Haar stuff here and descriptors. Maybe it helps and you can modify the code if you want. But I suggest you to try easier approachs. –  cyberdecker Oct 24 '12 at 16:44
@Hammer Thanks for your attention and helpful advice, I will take a try. –  vancexu Oct 25 '12 at 1:25

Your Answer



Browse other questions tagged or ask your own question.