icvCreateIntHaarFeatures() can not create all features when the window is not a square (Bug #92)


Added by Shiqi Yu about 15 years ago. Updated almost 15 years ago.


Status:Done Start date:
Priority:Blocker Due date:
Assignee:Vadim Pisarevsky % Done:

0%

Category:imgproc, video
Target version:-
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

Description

in SVN:
File: opencv/apps/haartraining/cvhaartraining.cpp
Line: 210->380
in function icvCreateIntHaarFeatures()

When the function parameter winsize is not a square (winsize.with != winsize.height), the function can't list all possible haar features.
Only the features lie in the top-left corner are created.

As for the haar_y2 feature, if winsize.width=20 and winsize.height=5, the x position for a rect is < winsize.height since the following code use y value as the x position.

It's a critical bug since someone uses non-square windows, such as eye detection.

Line 190:
for( x = 0; x < winsize.width; x++ ) {
for( y = 0; y < winsize.height; y++ ) {
......
Line 210:
// haar_y2
if ( (x+dx*2 <= winsize.height) && (y+dy <= winsize.width) ) {
if (dx*2*dy < s0) continue;
if (!symmetric || (y+y+dy <= winsize.width)) {
haarFeature = cvHaarFeature( "haar_y2",
y, x, dy, dx*2, -1,
y, x+dx, dy, dx, +2 );
CV_WRITE_SEQ_ELEM( haarFeature, writer );
}
}


Associated revisions

Revision 42414b56
Added by Andrey Kamaev over 12 years ago

Merge pull request #92 from LeonidBeynenson/cv_algorithm_changes_2.4

Revision a78c9acb
Added by Roman Donchenko over 11 years ago

Merge pull request #92 from ilya-lavrenov:ocl_distanceToCenters

History

Updated by Maria Dimashova almost 15 years ago

Bugs were fixed in r2853.

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

Also available in: Atom PDF