OpenCV findContours – What it is?

OpenCV findContours detects change in the image color and marked it as contour.

In this example using archery target face, findContours detects the outer circle, yellow circle, bullseye circle, logos on top left and bottom left.

In this case, findContours doesn’t detect the red circle contour.

The Original Image

archery target face
archery target face

The Image Gray

image gray of target face
image gray of target face

The Find Contours Image

Green color is the contours found on the image.

opencv findcontours on archery target face
opencv findcontours on archery target face

The OpenCV Python Code

 

Conclusion

findContours is an easy way to automatically detect an image shape or outline.

References:

  1. https://docs.opencv.org/4.x/d4/d73/tutorial_py_contours_begin.html
  2. https://medium.com/analytics-vidhya/opencv-findcontours-detailed-guide-692ee19eeb18