Morphological operation sequence of image is done in order to reduce the size of discontinuities and reduce false edge. The first step is to dilate the contour line by the edge detection algorithm to expand, thus potentially filling in small holes and connecting disjoint objects