Ask Your Question
0

Find a specific shape in an image

asked 2013-04-25 19:18:58 -0500

smhall05 gravatar image

updated 2013-04-25 20:03:15 -0500

I am looking for help detecting a specific shape in an image. The shape can vary slightly, but not by much. I have provided links to the image(s) for reference. Essentially the shape I am looking to detect is a rectangle with rounded corners. If there are no intersecting lines of this shape in the image, using findBlobs() can detect it, however if the sides of the shape are dirtied by other information in the image I am not having success. How do I go about doing this? Any guidance would be greatly appreciated.

No intersections: http://www.classicverse.com/bound.jpg

Unclean version: http://www.classicverse.com/dirty_bound.jpg

edit retag flag offensive close merge delete

Comments

Although the general shape stays the same, rectangle with rounded corners, it's height and width can vary. This shape is used to "circle" a single word on page of many words. The dirty shape is encountered when the shape overlaps the extra wording.

Aside from trying to match the shape exactly, is

smhall05 gravatar imagesmhall05 ( 2013-04-26 12:58:47 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2013-04-26 14:35:42 -0500

smhall05 gravatar image

@kscottz Although the general shape stays the same, rectangle with rounded corners, it's height and width can vary. This shape is used to "circle" a single word on an image of many words. The dirty shape is encountered when the shape overlaps the extra wording.

Aside from trying to match the shape exactly, is there a way to identify at least 3 of the 4 sides that make up this shape? More generally is there a way to identify and return rectangle like shapes? I will then be able to process this subset of the image as opposed to the entire image.

edit flag offensive delete link more
0

answered 2013-04-26 11:55:15 -0500

kscottz gravatar image

This might be a little tough in the case of your "dirty" image. How regular is the shape? If it always has the same shape, but the extra stuff varies, you may want to try using the findTemplate method. Generally if you are doing shape recognition the matchShape method / Hu Moments in the blob class are your friends but this could fail depending on how much noise you have. The blob class also has isCircle, isSquare, and isRectangle methods that could help you out.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2013-04-25 19:18:58 -0500

Seen: 2,009 times

Last updated: Apr 26 '13