Bug in DescriptorExtractor::removeBorderKeypoints (Bug #832)


Added by Anton G about 14 years ago. Updated almost 14 years ago.


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

0%

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

Description

Hi!

I've noticed that in BriefDescriptorExtractor::computeImpl call RoiPredicate filters keypoints checking FLOAT values e.g.:

if (pt.x=999.9) >= 1000 (false)

But further function test_fn_ rounds FLOAT value to INT to get exact pixel position so
(img_x=(int)(999.9 + 0.5)) == 1000 (true)

So we are getting exception in sum.at<int>(y, x) call during descriptor calculation

This explanation may be incorrect (I didn't get whole picture of border calculation) BUT bug exists here, I've catched it :)

Anton


FeatureTest.cpp (604 Bytes) Anton G, 2011-02-01 10:27 am


Associated revisions

Revision 34a18f79
Added by Maria Dimashova almost 14 years ago

fixed #832

History

Updated by Maria Dimashova about 14 years ago

This explanation is really incomplete to understand where is the bug. Could you attach the image and sample code to reproduce described bug?

Updated by Anton G about 14 years ago

Hi!

Please, build attached .cpp file to reproduce bug, image doesn't need.

I've added "- 0.5f" to upper limits to FIX this BUG:

void DescriptorExtractor::removeBorderKeypoints( vector<KeyPoint>& keypoints,
Size imageSize, int borderSize ) {
if( borderSize > 0) {
keypoints.erase( remove_if(keypoints.begin(), keypoints.end(),
RoiPredicate((float)borderSize, (float)borderSize,
(float)(imageSize.width - borderSize) - 0.5f,
(float)(imageSize.height - borderSize) - 0.5f)),
keypoints.end() );
}
}

WBR,
Anton

Updated by Maria Dimashova almost 14 years ago

I fixed the problem in r4975.
Thanks for the bug report and the sample code.

  • Status changed from Open to Done
  • (deleted custom field) set to fixed

Updated by Anton G almost 14 years ago

Thanks for your attention!

Also available in: Atom PDF