views:

280

answers:

3

I want algorithm for recognizing multiple no of shapes(Specially rectangle and squares) in a picture.Preferably I am using C# so, I am looking forward for solutions in C#.

A: 

check aforgenet.... http://www.aforgenet.com/forum/

Egon
A: 

If you are looking for a library that does a lot of image processing for you there is always OpenCV. I think it is is c++ though.

Janusz
A: 

You can use the Circularity algorithm as a first approach, which is very easy to compute:

C = p^2 / a where p is the perimeter (border area) and a is shape area.

To know how to read/write pixels quickly, take a look here

Alternatively look for shape signature algorithm available at Rafael Gonzales book. In this algorithm you compute the center of the object using central momentum, the you compute the distance between the center and each border pixel. You'll end up with a 1D signal where peaks represent bigger distance from the center. In a square, you have 4 symmetric peaks while in a rectangle 2 big peaks and 2 smaller ones.

Andres