Click here to Skip to main content
15,868,164 members
Please Sign up or sign in to vote.
5.00/5 (2 votes)
Hi.

Do you know any algorithms for detecting a shape in an image ?

thanks in advance.
Posted
Updated 19-Mar-10 9:54am
v2

Mathematical morphology provides simpler and more efficient tools for detecting shapes and more. The fundamental operations are dilation and erosion.

This http://www.ph.tn.tudelft.nl/Courses/FIP/noframes/fip-Morpholo.html[^] covers some of the basics (but it makes the concepts look harder than they are).

This one http://www.dca.fee.unicamp.br/dipcourse/html-dip/c9/s4/front-page.html[^] has some nice pictures, but is short on explanation.

If you could describe the task you're trying to accomplish, maybe I could make some more specific recommendations.
 
Share this answer
 
Assuming that these are simple geometric shapes on relatively simple backgrounds (as opposed to real objects against cluttered backgrounds), then I'd suggest:

1. Determine which pixels are foreground (shapes) and background (everything else)
2. Identify individual blobs (connected sets of foreground pixels of the same type)
3. For each blob, extract meaningful features
4. Train a classifier, based on the extracted features
5. Test the system on new images
6. Celebrate!

In step 2, try using a flood fill.
In step 3, there are many features one might try, such as perimeter-to-area ratio.
In step 4, the classifier could be any learning algorithm: neural network, linear discriminant, etc.


-Will Dwinnell
Data Mining in MATLAB
 
Share this answer
 
Hough transform can help you in simple shape detection like line circle etc.. You better look PDM(Probability density models ), these can detect shapes. PDM need to be initialized with a training set , after that it will calculate PCA . PDM is not that difficult.. have a look.

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900