This recipe covers OpenCV functionality related to, features of curves. We will review the routines for computing a curve's length and area, getting the convex hull, and checking whether a curve is convex or not. Also, we will study how to approximate the contour with a smaller number of points. All of these things can be useful when you're developing an algorithm based on contour handling. By finding different features of the contour, you can build heuristics to filter out false contours. So, let's get started.
Working with curves - approximation, length, and area
Getting ready
You need to have OpenCV 3.x installed, with Python API support.