Yes, I agree with the approaches proposed by Joachim.
Another interesting approach, based on morphological operators, can be the hit-and-miss transform. You can find a very brief tutorial, with pointers to more comprehensive references, here:
If your object is to detect only triangle and circle, Hough transform is the correct choice. However it can't be generalized for other shapes. For eg. if you wish to extend from circle to ellipse, you need to add one more dimension in Hough space and things get really unmanageable.
As Joachim said Hough Transform would be a good starting point. However, if objects have known texture (or solid colors) you can apply segmentation and compute statistical moments for extracted regions. You can also try with HoG descriptors or geometric hashing.
Hello if you are using MATLAB as implementation tool then there is function called 'imdilate'. just type this function in matlab help and you will get many shapes then you required.... Its easy and useful... You can directly detect any n number angle and circle both
This is a good question with more than one possible answer.
In addition to the perceptive responses already given in this thread, the problem of detecting triangles in an image can be solved by Delaunay triangulation. This is, in fact, the approach used in
A, Akgunduz, D. Zetu, P. Banerjee, Viewpoint-centered shape recovery from multiple views, University of Illinois at Chicago, 2000:
See, for example, page 4, where the suggested approach is to carve a convex hull of a subset of an image until we are left with a set of triangles that best approximate the real shape of an object. It is also observed that Boissonat (1984) suggested a Delaunay triangulation-based technique as means of shape recovery in an image.
This still leaves open the question about how to detect circles in an image. This problem can be solved by using a topological neighbourhood-based approach, since such a neighbourhood in the plane has the shape of a disk with holes in it. A topological neighbourhood of a point in an image segment would be constructed with a radius that is less than or equal to the average segment diameter. Such a neighbourhood would approximate a circular region of an image more or less, depending on the number of holes in the planar neighbourhood disk.