Detect shapes in picture and get coordinates and size

Hi Guys,

I’m a bit stumped on this. Is there any clever way to detect rectangular shapes in a picture the user loads and get its x,y, width and size? There might be several rectangles in a picture, and each one should be detected. Also, if you have wierd shapes that consist of rectangles, those should be detected, too :slight_smile:

Cheers,
Denis

What will it be? Black and white, color, only the frame of the rectangles or they will be filled, …

Can you post an example?

It might look like those images:



But I wouldnt mind specifying how they need to look…

this might help

link text

Of course another idea… depending on how those shapes are created in the first place…
Just keep track of them as they are drawn/moved…

But if it is a external graphic image, that of course won’t be doable.

Interesting link! I’ll have a in-depth look at it!
Thanks!

Have a look here. Real basic code. It might not run immediately in 2013 4.1 but I’m sure you can use the code. It’s in the ‘drag demo’.

@Denis Hessberger Maybe another idea I use a lot in my own apps. I explained it on my blog http://alwaysbusycorner.wordpress.com/2011/09/22/detecting-pixel-precise-clicktouch-in-irregular-shapes/

Ahh… you use color detection… smart solution!