Typo in Cascade Classifier tutorial code causes crash (Patch #2044)


Added by Frank Bauernöppel over 12 years ago. Updated over 12 years ago.


Status:Done Start date:2012-06-13
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:samples
Target version:2.4.2
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

Description

The turorial code donwloaded from

http://code.opencv.org/svn/opencv/trunk/opencv/samples/cpp/tutorial_code/objectDetection/objectDetection.cpp

contains a typo which may crash the application.

line 90:
int radius = cvRound( (eyes[j].width + eyes[i].height)*0.25 );

should read
int radius = cvRound( (eyes[j].width + eyes[j].height)*0.25 );

(eyes must be indexed by j, not by i)

On the tutorial webpage, the code is correct:

http://opencv.itseez.com/doc/tutorials/objdetect/cascade_classifier/cascade_classifier.html#cascade-classifier


Associated revisions

Revision 58aac7ea
Added by Kirill Kornyakov over 12 years ago

fixes #2044

History

Updated by Kirill Kornyakov over 12 years ago

Thank you! Fixed in r8656.

  • Tracker changed from Bug to Patch
  • Target version set to 2.4.2

Updated by Kirill Kornyakov over 12 years ago

  • Status changed from Open to Done

Also available in: Atom PDF