views:

260

answers:

3

Given the 2D contour of a shape in the form of lines and vertices, how can I Extract Information from that? like: Pointy, round, straight line. Shape similarities with a given shape.

Code is not necessary, I am more interested in concepts and the names of techniques involved to guide my search....

Thanks in advance.

+9  A: 

Image moments

One approach is to calculate the first and second order central moments of the shape described by the 2D contour. Using these values the elongation of the object can be calculated.

The central image moments can be combined to the seven moments of Hu, which are invariant to change in scale, rotation and translation (ie. they are very good for basic shape recognition). (More on image moments here).

Unitless ratio of perimeter and area

An other approach is to calculate the length of the perimeter (p) and the size of the inscribed area (a). Using these two values, the following ratio can be computed:

ratio = p^2 / (4 * pi * a)

The closer this ratio is to one, the more circle like is the described shape.

Other methods

midtiby
moments are, imho, the simplest and most efficient descriptors for shape.another unitless value of interrest: you can compute the ratio of the area of the object and the area of the (oriented) bounding box, which tells you how close the shape is from a rectangle.
Adrien Plisson
@Adrien: Is there an efficient algorithm to get the oriented bounding box of a square?
nikie
A: 

Another method of contour shape classification is topological aproach based on the "size function" That could be useful for global shape recognition, but not for extracting "local" features like pointy/round/straight. http://en.wikipedia.org/wiki/Size%5Ffunction Basically slicing contour by parametrized line and counting number of connected components depending on parameter. http://www.ingre.unimo.it/staff/landi/articoli/patrec.pdf

mirror2image
A: 

What I think you might be looking for is often called Blob or Connectivity Analysis, which I believe was first developed at SRI (Stanford Research Institute). Image moments are one component of this area.

kenny