Suppose I have an image with, say, a circle and a square. Is there a way to find the square given the matrix of the image? (there is only one square, and time is not really an issue).
Thanks.
Suppose I have an image with, say, a circle and a square. Is there
Share
Let’s divide all points into “lit” and “dark”.
Look for points which are lit, and the points above and below are also lit. Those are likely to be a part of an edge.
Similarly: if a point (x,y) is lit and points (x+1,y), (x+2,y) are also lit, but (x-1,y) and (y-1,y) are dark, and analogously in the Y-direction, then you’ve most likely found an upper-left corner. And so on. In this way you can find the corners and then find the square from them – seems to be a simple approach.