I started from EMGU Example (Emgu.CV v2.4.10.1939): http://www.emgu.com/wiki/index.php/CompareImages_-_Difference
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:
Contour<Point> currentContour = contours.ApproxPoly(contours.Perimeter * 0.05, storage);
to get the shape of the difference (which for me is a white polygon)
I then cropped that polygon to avoid processing unnecessary parts of the image.
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.
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.
This is a similar question that didn't have a solution. Find contour of the set of points in OpenCV