Contour Detection using OpenCV

Contour Detection using OpenCV

Contour Detection using OpenCV (Python/C++)

“When we join all the points on the boundary of an object, we get a contour. Typically, a specific contour area is related to the boundary pixels, having similar color and intensity. Whenever the intensity or color changes greatly, then almost always we get a new contour area starting from there.

OpenCV makes it really easy for finding, and drawing contours in images. It provides two simple functions to do so: findContours(), and drawContours(). As promised earlier, for hands-on coding experience we will see how to use the above functions of OpenCV. We will also discuss what are the arguments/options these functions accept, in detail.

Not only the OpenCV functions, we will also see two different types of contour detection methods: CHAIN_APPROX_SIMPLE and CHAIN_APPROX_NONE. We will cover these in detail, in the rest of the post.

For contour detection, we will be using few images to show many use cases, and different scenarios…”


Subscribe to our Digest