diff --git a/Border Extraction/Border_extraction.py b/Border Extraction/Border_extraction.py index 3bd6ca68ef..8a54ca9a5e 100644 --- a/Border Extraction/Border_extraction.py +++ b/Border Extraction/Border_extraction.py @@ -10,14 +10,14 @@ photo = askopenfilename() img = cv2.imread(photo) -n,l,m = img.shape -size = (n,l) +n, l, m = img.shape +size = (n, l) gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) -threshold_value = 20 # this value needs to be adjusted for every image +threshold_value = 20 # this value needs to be adjusted for every image ret, thresh = cv2.threshold(gray, threshold_value, 255, 0) -kernel = np.ones((5,5),np.uint8) +kernel = np.ones((5, 5), np.uint8) # dilation and erosion are applied to binary images dilated = cv2.dilate(thresh, kernel, iterations=1) eroded = cv2.erode(thresh, kernel, iterations=1) @@ -29,4 +29,4 @@ cv2.waitKey(0) cv2.destroyAllWindows() -window.mainloop() \ No newline at end of file +window.mainloop()