This question relates to somewhat practice and experienced based process. I have an Mat binary image which consist of simple white color polygons in a black background. Actu
It depends how generic the polygons can be. If the edges of the polygon are always parallel to x
and y
axes, then you could look at pixels in 8-neigborhood of a particular pixel and if there are odd number of white pixels you have found a corner. Or use a 4-neighborhood and test for even number of white pixels.