diff --git a/scan.py b/scan.py index dfb75d2..4aa835e 100644 --- a/scan.py +++ b/scan.py @@ -189,7 +189,7 @@ def get_contour(self, rescaled_image): # dilate helps to remove potential holes between edge segments kernel = cv2.getStructuringElement(cv2.MORPH_RECT,(MORPH,MORPH)) - dilated = cv2.dilate(gray, kernel) + dilated = cv2.morphologyEx(gray, cv2.MORPH_CLOSE, kernel) # find edges and mark them in the output map using the Canny algorithm edged = cv2.Canny(dilated, 0, CANNY)