Using Java and BoofCV to detect shapes in an image file

I didn't find anything here or on Google. I'm looking for a way to define shapes (circle, square, triangle, and other other shapes) from an image file. Some examples:

filled circleunfilled trianglecrossesquadrant filled squaremultiple shapesmultiple shapes pac

You get the general idea. Not sure if BoofCV is the best choice here, but it looks like it should be simple enough, but I don't know anything about it. I looked at some of the examples, and although before I stumbled upon my head (which is not difficult for a few days to do), I thought I'd ask if there is any information.

I am taking a knowledge based AI class. Progressive Raven Matrix issues and final assignment will use purely visual images instead of text files with attributes. We do not value visual visibility as we only have a few weeks to work on this section of the project and we are encouraged to share this information. SOF has always been my source of information and I hope someone has ideas on where to start ...

Basically I want to define shapes (convert them to 2D geometry) and then make some assumptions about attributes like size, padding, placement, etc., create a text file with those attributes, and then use that, submit its through my existing code based on what I've written for my other projects to solve problems.

Any suggestions????

+3


source to share


1 answer


There are many ways to do this. One way is to find the outline of the shape and then fit a polygon or oval to it. If you are a git polygon, and there are 4 sides with almost equal length, then it is a square. The outline can be found using binary blobs (my recommendation for the above images) or canny edge.



http://boofcv.org/index.php?title=Example_Fit_Polygon http://boofcv.org/index.php?title=Example_Fit_Ellipse

+1


source







All Articles