Ask Your Question
2

Are SURF feature descriptors computed differently in 2.3.1 and 2.4.2? (bug or feature ???)

asked 2012-08-23 04:39:40 -0600

Ben gravatar image

updated 2012-11-05 05:22:20 -0600

I recently updated OpenCV from 2.3.1 to 2.4.2 and realized that I got different results when computing SURF feature descriptors. Keypoints seem to be the same. Where did something change and why? How can I reproduce the 2.3.1 results with 2.4.2?

EDIT

To be more precise: I've clustered millions of features with a self-written HKM data structure on 2.3.1. Quantizing image features lead to a rather well distribution. After changing to 2.4.2 (but still using the data structure trained with 2.3.1), some features seem to appear far more often in images than others. This means that somehow the SURF features must be computed differently in 2.3.1 and 2.4.2

UPDATE

As foelin pointed out in his answer, there is a difference between 2.3.1 and 2.4.2 code in surf.cpp:

2.3.1, surf.cpp line 688:

descriptor_dir = cvFastArctan( besty, bestx );

2.4.2, surf.cpp line 670:

descriptor_dir = fastAtan2( -besty, bestx );

Could someone please confirm this is a bug in 2.4.2?

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
3

answered 2012-11-03 18:34:23 -0600

this post is marked as community wiki

This post is a wiki. Anyone with karma >50 is welcome to improve it.

I found that the SURF feature implemented in 2.4.2 is no rotation invariant. The code "descriptor_dir = fastAtan2( -besty, bestx );" in "nonfree\src\surf.cpp" line 817, which computes the feature orientation, is not correc. You can modify it to "descriptor_dir = fastAtan2( besty, bestx );" ,and rebuild the nonfree module to get the right SURF.

edit flag offensive delete link more
2

answered 2012-08-24 05:19:19 -0600

Jacek gravatar image

I've found the following issue on bug tracker: SURF : different number of keypoints between OpenCV 2.3 & 2.4 (Bug #1911)

It seems that there are some differences in SURF feature detector in OpenCV 2.4. One change is that extended parameter is set to true by default, so descriptor length is 128 not 64. Also it seems that in 2.4 more keypoints are located - but if this is for purpose or is some error/bug is not clear yet.

See: http://code.opencv.org/issues/1911

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2012-08-23 04:39:40 -0600

Seen: 1,726 times

Last updated: Nov 05 '12