answered Feb 1 '13
In the first, preprocessing your image & extract contour then discretize the contour by approxPolyDP() function.