Add morphological operations for the binary image before sending to
contour thresholding.