title: Detect upper body portion using OpenCV
body: <p>I am working on an iOS project that is integrated with OpenCV.<br>My desired output is something like this:<br></p>
  
  <p><a href="https://i.stack.imgur.com/geZmD.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/geZmD.jpg" alt="enter image description here"></a> </p>
  
  <p>How can I detect Upper Body Portion (i.e: below neck to legs)?
  <br>
  I have done so far to achieve body detection is something like this..
  <br> If anyone has made this before.<br>Please help me..
  <br></p>
  
  <pre><code>-(void)processImage:(Mat&amp;)image
  {
      std::vector&lt;cv::Rect&gt; bodies;
      Mat grayscaleFrame;
  
      cvtColor(image, grayscaleFrame, CV_BGR2GRAY);
      equalizeHist(grayscaleFrame, grayscaleFrame);
  
      upperBodyCascade.detectMultiScale(grayscaleFrame, image, bodies, HaarOptions,cv::Size(30,30));
      for (size_t i = 0; i &lt; bodies.size(); i++)
      {
          rectangle(image, bodies[i], Scalar(255, 0, 255));
      }
  
  }
  </code></pre>