Commit 83be2260 authored by Roman Donchenko's avatar Roman Donchenko Committed by OpenCV Buildbot

Merge pull request #1382 from nghiaho12:cascade_classifier

parents f50a8299 81a6ae79
...@@ -90,7 +90,7 @@ This tutorial code's is shown lines below. You can also download it from `here < ...@@ -90,7 +90,7 @@ This tutorial code's is shown lines below. You can also download it from `here <
//-- Detect faces //-- Detect faces
face_cascade.detectMultiScale( frame_gray, faces, 1.1, 2, 0|CV_HAAR_SCALE_IMAGE, Size(30, 30) ); face_cascade.detectMultiScale( frame_gray, faces, 1.1, 2, 0|CV_HAAR_SCALE_IMAGE, Size(30, 30) );
for( int i = 0; i < faces.size(); i++ ) for( size_t i = 0; i < faces.size(); i++ )
{ {
Point center( faces[i].x + faces[i].width*0.5, faces[i].y + faces[i].height*0.5 ); Point center( faces[i].x + faces[i].width*0.5, faces[i].y + faces[i].height*0.5 );
ellipse( frame, center, Size( faces[i].width*0.5, faces[i].height*0.5), 0, 0, 360, Scalar( 255, 0, 255 ), 4, 8, 0 ); ellipse( frame, center, Size( faces[i].width*0.5, faces[i].height*0.5), 0, 0, 360, Scalar( 255, 0, 255 ), 4, 8, 0 );
...@@ -101,7 +101,7 @@ This tutorial code's is shown lines below. You can also download it from `here < ...@@ -101,7 +101,7 @@ This tutorial code's is shown lines below. You can also download it from `here <
//-- In each face, detect eyes //-- In each face, detect eyes
eyes_cascade.detectMultiScale( faceROI, eyes, 1.1, 2, 0 |CV_HAAR_SCALE_IMAGE, Size(30, 30) ); eyes_cascade.detectMultiScale( faceROI, eyes, 1.1, 2, 0 |CV_HAAR_SCALE_IMAGE, Size(30, 30) );
for( int j = 0; j < eyes.size(); j++ ) for( size_t j = 0; j < eyes.size(); j++ )
{ {
Point center( faces[i].x + eyes[j].x + eyes[j].width*0.5, faces[i].y + eyes[j].y + eyes[j].height*0.5 ); Point center( faces[i].x + eyes[j].x + eyes[j].width*0.5, faces[i].y + eyes[j].y + eyes[j].height*0.5 );
int radius = cvRound( (eyes[j].width + eyes[j].height)*0.25 ); int radius = cvRound( (eyes[j].width + eyes[j].height)*0.25 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment