Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,7 @@ import numpy as np
|
|
4 |
|
5 |
def preprocess(img):
|
6 |
img_gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
|
7 |
-
|
8 |
img_dilate = cv2.dilate(img_thresh, np.ones((3, 3)), iterations=2)
|
9 |
img_erode = cv2.erode(img_dilate, np.ones((3, 3)), iterations=1)
|
10 |
return img_erode
|
|
|
4 |
|
5 |
def preprocess(img):
|
6 |
img_gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
|
7 |
+
img_thresh = cv2.adaptiveThreshold(img_gray, 255, cv2.ADAPTIVE_THRESH_GAUSSIAN_C, cv2.THRESH_BINARY, 11, 2)
|
8 |
img_dilate = cv2.dilate(img_thresh, np.ones((3, 3)), iterations=2)
|
9 |
img_erode = cv2.erode(img_dilate, np.ones((3, 3)), iterations=1)
|
10 |
return img_erode
|