Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -18,8 +18,8 @@ def inference(img):
|
|
18 |
#mask = np.dstack([mask, mask, mask]) / 255
|
19 |
#out = img * mask
|
20 |
|
21 |
-
|
22 |
-
out = cv2.adaptiveThreshold(
|
23 |
|
24 |
|
25 |
#kernel = cv2.getStructuringElement(cv2.MORPH_RECT, kernelSize)
|
|
|
18 |
#mask = np.dstack([mask, mask, mask]) / 255
|
19 |
#out = img * mask
|
20 |
|
21 |
+
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY ) # grayscale
|
22 |
+
out = cv2.adaptiveThreshold(gray,255,cv2.ADAPTIVE_THRESH_GAUSSIAN_C, cv2.THRESH_BINARY,31,3)
|
23 |
|
24 |
|
25 |
#kernel = cv2.getStructuringElement(cv2.MORPH_RECT, kernelSize)
|