Bug in goodFeaturesToTrack (Feature #171)


Added by Bartosz Wieloch about 15 years ago. Updated almost 15 years ago.


Status:Done Start date:
Priority:Blocker Due date:
Assignee:- % Done:

0%

Category:imgproc, video
Target version:-
Difficulty: Pull request:

Description

Function goodFeaturesToTrack crashes (cvfeatureselect.cpp:164) when either image.cols or image.rows is smaller than minDistance/2 (because then grid_width==0 or grid_height==0).

Solution - replace (lines 104-105):
const int grid_width = (float)w / cell_size + 0.5; // round up
const int grid_height = (float)h / cell_size + 0.5; // round up

by:

const int grid_width = (w + cell_size - 1) / cell_size;
const int grid_height = (h + cell_size - 1) / cell_size;


Associated revisions

Revision 8579666b
Added by Andrey Kamaev over 12 years ago

Merge pull request #171 from asmorkalov:android_8_neon_fix

Revision 56024294
Added by Andrey Pavlenko almost 11 years ago

Merge pull request #171 from akarsakov:ipp_pyramids

History

Updated by anonymous - almost 15 years ago

Thank! Your patch is applied in r2814

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

Also available in: Atom PDF