opencv/opencv

SIFT Octave bug

Opened this issue · 0 comments

Transferred from http://code.opencv.org/issues/2987

|| Andew Sabrew on 2013-04-25 20:36
|| Priority: Normal
|| Affected: None
|| Category: nonfree
|| Tracker: Feature
|| Difficulty: 
|| PR: 
|| Platform: None / None

SIFT Octave bug

I think SIFT sets a bad value for octave in the @KeyPoint@ class. If you print the value of keypoint.octave you get something like this:

<pre>
Octave value:10420482
Octave value:10420482
Octave value:11337985
Octave value:10944771
</pre>

And it can't be true because octave ranges are very low.

History

Anna Kogan on 2013-05-07 08:48
Hello Andrew,
Thank you for reporting the issue. If you investigate the problem further and fix it on your side, a "pull request":http://www.code.opencv.org/projects/opencv/wiki/How_to_contribute in our GitHub repo would be highly appreciated!
Vladislav Vinogradov on 2013-06-10 10:35
SIFT writes a packed value (octave, layer and scale) to octave member. You can unpack this values with following function:

<pre>
void unpackSIFTOctave(const KeyPoint& kpt, int& octave, int& layer, float& scale)
{
    octave = kpt.octave & 255;
    layer = (kpt.octave >> 8) & 255;
    octave = octave < 128 ? octave : (-128 | octave);
    scale = octave >= 0 ? 1.f/(1 << octave) : (float)(1 << -octave);
}
</pre>
-   Status changed from Open to Cancelled
Guanta Alecho on 2013-06-21 21:30
Sorry to start a discussion: But shouldn't this be changed? Hhow should a typical user know that?
-   Status changed from Cancelled to Incomplete
Kirill Kornyakov on 2013-06-27 08:31
Well, we can either document this, or change the behavior. Most likely we shouldn't change the behavior, so the existing code continue to work. Where it could be done? Or you have other suggestions?
-   Description changed from I think SIFT sets a bad value for octave in
    the KeyPoint class. If you print ... to I think SIFT sets a bad
    value for octave in the @KeyPoint@ class. If you prin... More
-   Category set to nonfree
-   Tracker changed from Bug to Feature