Contour detection
Contour detection is a technique to find out the boundaries
of pixels with sharp intensity changes. Contours consist of
a set of points connected to each other, most likely to be
located on the outlines of objects. Contour detections take
a binary image as an input which is the output of the
canny edge detector or a binary image obtained by applying
the global thresholding technique on a grayscale image. It
calculates the boundaries of objects, makes a hierarchy of
the object contours to keep the record of the holes inside the
parent objects. This information can be used to extract and
draw any contour depending upon the user requirement.