From efdcd70b02254153e72dbf8aa106113371695903 Mon Sep 17 00:00:00 2001 From: joaofauvel Date: Wed, 1 Jul 2020 12:32:17 -0300 Subject: [PATCH] Change dilate to closing --- scan.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)