OpenCV/Emgu.CV: Finding contour point coordinates of a filled polygon using C#.net
<p>I started from EMGU Example (Emgu.CV v2.4.10.1939):
<a href="http://www.emgu.com/wiki/index.php/CompareImages_-_Difference" rel="nofollow noreferrer">http://www.emgu.com/wiki/index.php/CompareImages_-_Difference</a></p>

<p>Instead of comparing previous video frame and the next one I am dealing with a screen capture of the primary screen at time1 and another screen capture at time2. Second screen capture brings a minimal difference, especially in one part of the captured image and that is: an outline (closed polygon of n vertices). I applied ThresholdBinary method and this code:</p>

<pre><code>Contour&lt;Point&gt; currentContour = contours.ApproxPoly(contours.Perimeter * 0.05, storage);
</code></pre>

<p>to get the shape of the difference (which for me is a white polygon)</p>

<p>I then cropped that polygon to avoid processing unnecessary parts of the image.
<a href="https://i.stack.imgur.com/WHdcw.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WHdcw.jpg" alt="enter image description here"></a>
In the attached images on the right I tried to depict what I want and don't want based on processing left input image.
I want to find x,y coordinates (in pixels) of all intersections of vertices of the polygon for the cropped image. </p>

<p>When I would later redraw the polygon I would expect to as close match as possible to this input polygon. I would like to have a reasonable number of straight lines detected so the final shape faithfully resembles input shape on the left.</p>

<p>This is a similar question that didn't have a solution.
<a href="https://stackoverflow.com/questions/10297713/find-contour-of-the-set-of-points-in-opencv">Find contour of the set of points in OpenCV</a></p>