Society of Robots  Robot Forum
Software => Software => Topic started by: toastman on October 04, 2006, 03:33:05 AM

Hi.. I'm doing my final year project on robotic vision system and is required to do image analysing program that can extract shapes of any object in an image captured by webcam. Assuming only 1 object exists in the image, can anyone suggest what algorithm should I use in order to have the program do the shape extraction automatically? I will be implementing the program using MATLAB. I've been doing some research and encountered Snake Algorithm. Can it be apply for this case?

hey toastman,
so i have looked into Hough Transforms for identifying straight lines.
if you are looking for an image made from straight lines this would be a good place to start. identify the straight lines then start searching for your geometry within them.
if you are searching for shapes without obvious straight lines you should also look at the techniques some of the face recognition programmes use.
what platform are you using? if you are on a reasonably powerfull computer you should look at this project:
http://opencvlibrary.sourceforge.net/
it has some excellent code for Hough Transforms as well as other image recognition techniques.
they have an algorithm that can be trained to search for a shape in an image by showing it lots of samples.
their face finding sample works very well but i didn't experiment with training it with other shapes.
good luck!
dunk.

What shapes are you looking for? I would assume just the basic shapes, circle, square, triangle, right? 3D shapes or just 2D?
Each of those shapes has a different number of lines. Your algorithm can do what is called edge detection, which is a very simple and well known algorithm to implement. Edge detection finds the outside lines of the shape, then you can count the number of lines. A circle has 1 line, a triangle has 3, a square has 4, etc.
For more complicated shapes, your algorithm can then calculate the angle between each line. Obtuse triangle, right triangle, etc.
For a rectangle, see if 2 lines consist of more pixels than the other two lines.

You would probably find this page interesting based on what you need to do. RoboRealm is free too!
http://www.roborealm.com/help/Shape_Match.php
STeven.

steven, do you include source to that?
seems you list more too
http://www.roborealm.com/links/vision_software.php

Matlab has some nice stuff on their site
http://www.mathworks.com/matlabcentral/fileexchange/loadCategory.do?objectType=category&objectId=134&objectName=Image%20Analysis