title: Matching regionprop(x,'Area') of Matlab in OpenCV
body: <p>I need to imitate what regionprop(BW,'Area') of Matlab does with OpenCV. </p>
  
  <p>I have this code in Matlab</p>
  
  <pre><code>[L,N]           = bwlabel(image1,8);
  S = regionprops(L,'Area','PixelIdxList');
  output=[];
  for i=1:N,
      output(i)=S(i).Area;
  end
  </code></pre>
  
  <p>And in OpenCV</p>
  
  <pre><code>cv::findContours(cvImageMat,contours,CV_RETR_LIST,CV_CHAIN_APPROX_NONE);
  int iNumSegments = contours.size();
  for(int i=0;i&lt;iNumSegments;i++) 
  {
      cv::vector&lt;cv::Point&gt; approx;
      cv::approxPolyDP(cv::Mat(contours[i]), approx, 1.0e-10, true);
      double area = fabs( cv::contourArea( approx ) );
      dvResult.push_back(area);
  }
  </code></pre>
  
  <p>But each difference between two areas computed are about 400 in case of an image with 2048 x 2048 size. They should be the same for me to go forward. Does anybody have any advice on this?</p>