I am looking for a fast idea/algorithm letting me to find squares (as mark points) in the image file. It shouldn’t be so much challenge, however…
I started doing this by changing the color of the source image to a grey scale image and scanning each line of the image looking for two, three longest lines (pixel by pixel).
Then having an array of “lines” I am finding elements which may create the desire square.
The better idea would be to find the pattern with known traits, like: it is square, beyond of the square there are no distortion (there is just white space) etc.
The goal is to analyze the image 5000 X 5000 px in less than 1-2s.
Is it possible?
One of the OpenCV samples
squares.cppdoes just this, see here for code, . Alternatively you could look up the Hough transform to detect all lines in your image, and then test for two lines intersecting at right angles.There are also a number of resources on this site which may help you:
I’m sure there are others, these are just the first few I came across.