title: Opencv 2.4.2 Code Explanation-Face Recognition
body: <p>I have referred the documentation provided by OpenCV to make a face recognition program, it recognizes multiple faces and is working normally. In the documentation they have made ellipses to highlight the face. What I don't understand is how they have calculated the center of the ellipse which they have calculated as follows</p>
  
  <pre><code>for( int i = 0; i &lt; faces.size(); i++ )
  {
     Point center(faces[i].x+faces[i].width*0.5,faces[i].y+faces[i].height*0.5);
     //more code follows drawing the ellipse
  </code></pre>
  
  <p>The faces vector that they are using is produced as follows</p>
  
  <pre><code>face_cascade.detectMultiScale(frame_gray,faces,1.1,2,0|CV_HAAR_SCALE_IMAGE,cv::Size(30,30))
  </code></pre>
  
  <p>The documentation i.e. the program is given in the link </p>
  
  <p><a href="http://docs.opencv.org/doc/tutorials/objdetect/cascade_classifier/cascade_classifier.html">http://docs.opencv.org/doc/tutorials/objdetect/cascade_classifier/cascade_classifier.html</a></p>
  
  <p>I want to know how they are calculating the center of the ellipse and if I want to draw a rectangle instead of a circle, what do I have to do?</p>