Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat’s the point of desaturation and equalization in face detection?
    primarykey
    data
    text
    <p>When I play the face detection code, I get some confusion. When I comment these two sentences: </p> <pre><code>//cvtColor( frame, frame_gray, CV_BGR2GRAY ); //equalizeHist( frame_gray, frame_gray ); </code></pre> <p>the result is still the same, which means Opencv (detectMultiScale) can still successfully find people’s face. I am thinking that what’s the point of changing colour-image to gray-image, and then getting the histogram of the gray-image?</p> <p>I attach part of the code as follows:</p> <pre><code>while (cvWaitKey(10) &lt; 0) { Mat frame = cvQueryFrame( capture ); // get the next frame of video cvtColor( frame, frame_gray, CV_BGR2GRAY ); equalizeHist( frame_gray, frame_gray ); face_cascade.detectMultiScale( frame_gray, faces, 1.1, 2, 0|CV_HAAR_SCALE_IMAGE, Size(30, 30) ); // Detect faces for( int i = 0; i &lt; faces.size(); i++ ) // for each face found { Point center( faces[i].x + faces[i].width*0.5, faces[i].y + faces[i].height*0.5 ); // location of this face ellipse( frame, center, Size( faces[i].width*0.5, faces[i].height*0.5), 0, 0, 360, Scalar( 255, 0, 255 ), 4, 8, 0 ); // draw ellipse around this face} imshow( "faces", frame); } ///////////////////////////////////////////////////////// ////////////////////////////////////////////////////////// </code></pre> <p>OR:</p> <pre><code>while (cvWaitKey(10) &lt; 0) { Mat frame = cvQueryFrame( capture ); // get the next frame of video //cvtColor( frame, frame_gray, CV_BGR2GRAY ); //equalizeHist( frame_gray, frame_gray ); face_cascade.detectMultiScale( frame, faces, 1.1, 2, 0|CV_HAAR_SCALE_IMAGE, Size(30, 30) ); // Detect faces for( int i = 0; i &lt; faces.size(); i++ ) // for each face found { Point center( faces[i].x + faces[i].width*0.5, faces[i].y + faces[i].height*0.5 ); // location of this face ellipse( frame, center, Size( faces[i].width*0.5, faces[i].height*0.5), 0, 0, 360, Scalar( 255, 0, 255 ), 4, 8, 0 ); // draw ellipse around this face} imshow( "faces", frame); } ////////////////////////////////////////////// </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload