Contour

Context:

Contouring is an integral part of feature extraction. With contouring, we can do cool things like finding angles between straight lines!

This code will find all contours in a thresholded image (no color!) and “draw” them on our original image.

Tip

create a new variable “img_contoured” so you don’t overwrite anything!

Arguments:

  • Requires your original image (the one usually named “img”)

  • A thresholded image!

Code:

Results:

_images/pig.png

Original Raw Image

_images/contour.png

Original Raw Image