Locate rectangles in an image
Posted: 2009-06-03T12:25:36-07:00
I have an image of a form or ballot: http://www.salas.com/elect/testballot1.tif
I've been working out how to analyze it. My next challenge is to locate 'rectangles' on it. What I mean is a rectangle with a thin black outline, and the inside primarily white (i.e. white or grey with more black marks inside, but mostly white.) The rectangles are fully closed.
On the sample tif above, I see 23 rectangles. Some have a white background and some have a grey background. Perhaps each kind of rectangle will require a different technique to locate.
The output I would like is an array of rectangle coordinates, top, left, width, height, one for each of the 23.
Any tips, suggestions or pointers, would be greatly appreciated!!
Thanks
Pito
I've been working out how to analyze it. My next challenge is to locate 'rectangles' on it. What I mean is a rectangle with a thin black outline, and the inside primarily white (i.e. white or grey with more black marks inside, but mostly white.) The rectangles are fully closed.
On the sample tif above, I see 23 rectangles. Some have a white background and some have a grey background. Perhaps each kind of rectangle will require a different technique to locate.
The output I would like is an array of rectangle coordinates, top, left, width, height, one for each of the 23.
Any tips, suggestions or pointers, would be greatly appreciated!!
Thanks
Pito