title: Why am I not getting the correct contour area using OpenCV?
body: <p>I have the following contour:</p>
  
  <p><a href="https://drive.google.com/file/d/0B45BJEUVEkjseFd3X3RITzM5S3c/edit?usp=sharing" rel="nofollow">https://drive.google.com/file/d/0B45BJEUVEkjseFd3X3RITzM5S3c/edit?usp=sharing</a></p>
  
  <p>containing the following points (printed in order):</p>
  
  <p><a href="https://drive.google.com/file/d/0B45BJEUVEkjsN3NIRU5lOFBDb00/edit?usp=sharing" rel="nofollow">https://drive.google.com/file/d/0B45BJEUVEkjsN3NIRU5lOFBDb00/edit?usp=sharing</a></p>
  
  <p>However, when I calculate the area of this contour (using the function contourArea), I get 157, which is too low for the size of that contour. I expect it to be in the thousands. Why is the contour area being calculated incorrectly, and how may I fix it?</p>
  
  <p>The following is the code I'm using to calculate the areas of all contours of the image. The contour of interest is the last one. The original image I'm using is here:</p>
  
  <p><a href="https://drive.google.com/file/d/0B45BJEUVEkjsbGhXM3E3UW1lZWs/edit?usp=sharing" rel="nofollow">https://drive.google.com/file/d/0B45BJEUVEkjsbGhXM3E3UW1lZWs/edit?usp=sharing</a></p>
  
  <pre><code>int main(int argc, char* argv[])
  {
    Mat imgOriginal = imread(argv[1], 0);
  
    if(imgOriginal.empty())
      return -1;
  
    Mat img;
    resize(imgOriginal, img, Size(640, 480));
  
    medianBlur(img, img, 11);
    Canny(img, img, 25, 100);
  
    vector&lt; vector&lt;Point&gt; &gt; contours;
    findContours(img, contours, RETR_EXTERNAL, CHAIN_APPROX_NONE);
  
    for (int i = 0; i &lt; contours.size(); i++)
      cout &lt;&lt; "Area " &lt;&lt; i &lt;&lt; ": " &lt;&lt; contourArea(contours[i]) &lt;&lt; endl;
  
    return 0;
  }
  </code></pre>
  
  <p>Also, I noticed that several points in the contour are duplicates (I'm not sure why), which may be causing the area to be calculated incorrectly.</p>