BruteForceMatcher<L2<float> > returns DMatch.distance = -nan (Bug #1543)


Added by ben - about 13 years ago. Updated almost 13 years ago.


Status:Done Start date:
Priority:Normal Due date:
Assignee:Maria Dimashova % Done:

0%

Category:features2d
Target version:2.4.0
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

Description

I use the BruteForceMatcher to match SurfFeature descriptors.

1Mat d1, d2;
2BruteForceMatcher<L2<float> > BFM;
3vector<DMatch> Matches;
4BFM.match(d1, d2, Matches);

now it appears, that some entries of Matches have distance = -nan;
so I just used one single SurfFeature descriptor for d1, and d1.copyTo(d2), so d1 is identical to d2. Depending on the length of the descriptors (i cut so pieces off) i got Matchesr0.distance = {0, 0.000247, 0.00017, -nan, ...} which shouldn't happen as I think.
If I use BruteForceMatcher<L2<double> > ... all seems to be ok, meaning for the checks there are always distances 0.

I have a 64bit Machine with Ubuntu 10.04, compiled Opencv 2.3.1a with SSE, SSE2, I also tried other combintaions (+ SSE41, SSSE3).

The same error occurs on 64bit Ubuntu 11.04 opencv 2.3.1a and trunk.

But it didn't occur on a 64bit Ubunutu 11.10 machine unsing opencv trunk, SSE, SSE2.


Associated revisions

Revision 447e03bc
Added by Roman Donchenko over 11 years ago

Merge pull request #1543 from SpecLad:name-enum

History

Updated by Josh Klontz about 13 years ago

I am experiencing a similar problem with OpenCV 2.3.1a on OS X Lion compiled in release mode with the default CMake flags. L2<float> generates many nan distances while L1<float> generates valid distances for the same matrices.

Updated by Alexander Shishkov about 13 years ago

  • Description changed from I use the [[BruteForceMatcher]] to match [[SurfFeature]] descriptors. Mat d1... to I use the BruteForceMatcher to match SurfFeature descriptors. Mat d1, d2; Br... More

Updated by Alexander Shishkov almost 13 years ago

  • Target version deleted ()
  • Description changed from I use the BruteForceMatcher to match SurfFeature descriptors. Mat d1, d2; Br... to I use the BruteForceMatcher to match SurfFeature descriptors. <pre><... More

Updated by Alexander Shishkov almost 13 years ago

  • Assignee deleted (Maria Dimashova)

Updated by Maria Dimashova almost 13 years ago

  • Assignee set to Maria Dimashova

Updated by Maria Dimashova almost 13 years ago

Thanks for the report. I reproduced your problem with r7503, but it was solved in r7504. In r7504 the features2d module was refactored and old code of norm computing was replaced by the new one. Please update to >= r7504.

Updated by Maria Dimashova almost 13 years ago

Matching of the same descriptors (i.e. your test case) was added to the opencv tests.

  • Status changed from Open to Done

Updated by Alexander Shishkov almost 13 years ago

  • Target version set to 2.4.0

Also available in: Atom PDF