incorrect SIFT keypoint orientation (Bug #2349)


Added by Stefan Fiel over 12 years ago. Updated over 12 years ago.


Status:Done Start date:2012-09-11
Priority:Low Due date:
Assignee:Maria Dimashova % Done:

0%

Category:nonfree
Target version:2.4.3
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

Description

Hi,

using version 2.4.2 the orientation of the sift features is counter clockwise (see image sift-opencv242.png) (angle of the sift features are 5.0 and 84.97 degree for the upper keypoints, 275 and 354 degree for the lower keypoints). The visualization of the keypoints is done using drawKeypoints, which uses clockwise orientation. According to the documentation in feature2d.hpp the keypoint orientation should be [0,360) clockwise.

when changing modules/nonfree/src/sift.cpp line 282 from
X[k] = dx; Y[k] = dy; W[k] = (i*i + j*j)*expf_scale;
to
X[k] = dx; Y[k] = -dy; W[k] = (i*i + j*j)*expf_scale;
the keypoint direction is clockwise and also the visualization using drawKeypoints is correct (see changed-sift-orientation.png). Angles are 275.0, 354.97 for the upper, 5.03 resp. 84.97 for the lower.

One remark to drawKeypoints: currently the size of the Keypoints has to be multiplied by 1.5*4 to display them correctly. Can't this be included to the drawKeypoints method?

Greetings
Stefan


sift-opencv242.png (3.4 kB) Stefan Fiel, 2012-09-11 10:27 am

changed-sift-orientation.png (3.4 kB) Stefan Fiel, 2012-09-11 10:27 am


Associated revisions

Revision 9fcb0b22
Added by Roman Donchenko about 11 years ago

Merge pull request #2349 from jet47:fix-bug-3552

History

Updated by Andrey Kamaev over 12 years ago

Stefan, could you try to reproduce the bug on OpenCV master?

There were a serial of orientation-related fixes in 2D descriptors and most probably SIFT problem is already fixed.

  • Assignee set to Maria Dimashova
  • Target version set to 2.4.3

Updated by Stefan Fiel over 12 years ago

sorry for the delayed answer ...

seems to be fixed in the master branch

Updated by Andrey Kamaev over 12 years ago

  • Status changed from Open to Done

Also available in: Atom PDF