title: how expand rectangle after detected faces opencv
body: <p>I write code and i want How to expand the rectangle after the detection of the faces to     <code></code>up to the head and neck of human    </p>
  
  <pre><code>    #include &lt;opencv2/imgproc/imgproc.hpp&gt;  //this code detetced faces ///
      #include &lt;opencv2/objdetect/objdetect.hpp&gt;///////////
      #include &lt;opencv2/highgui/highgui.hpp&gt;
       ////////////////////
      using namespace cv;
      using namespace std;
  
      int main()
      {
  
          CascadeClassifier cascade;
  
          if (!cascade.load("haarcascade_frontalface_alt2.xml"))  //load harcascade xml
              return -1;
  
           Mat src = imread("11.jpg");  //read image 
  
          if (src.empty())
              return -1;
      cv::resize(src,src,cv::Size(600,600));  resize image 
          Mat gray;
          cvtColor(src, gray, CV_BGR2GRAY);
          equalizeHist(gray, gray);
  
          vector&lt;Rect&gt; faces;
          cascade.detectMultiScale(gray, faces, 1.2, 3,0,Size(30,30));
  
          for (size_t i = 0; i &lt; faces.size(); i++)
          {
       /////////////////////////////
              Rect r = faces[i];
      //////////////////////////////       
  
                Mat faceROI = gray( faces[i] );
            int x = faces[i].x;
            int y = faces[i].y;
            int h =0.3*y+faces[i].height;
            int w = faces[i].width;
            printf("Orig dimensions after h * w crop 1: %dx%d\n",h,w);
              printf("Orig dimensions after  x* y crop 2: %dx%d\n",x,y);
  
             rectangle(src,Point (x,y),Point(x + w,y +h),Scalar(255,0,255),1,4,0);
               imshow("mmmmmmmmmmm.jpg",src );  //show image in windows 
          }
      ///////////////////////////////
  
          waitKey(0);
  
          return 0;
      }
  </code></pre>