Question

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.

Was it helpful?

Solution

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

OTHER TIPS

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_function 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

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top