Update README.md
Browse files
README.md
CHANGED
|
@@ -30,7 +30,7 @@ import cv2
|
|
| 30 |
def crop_roi(img):
|
| 31 |
img = img[5:-5, 5:-5]
|
| 32 |
|
| 33 |
-
output = cv2.connectedComponentsWithStats((img > 10).astype(
|
| 34 |
stats = output[2]
|
| 35 |
|
| 36 |
idx = stats[1:, 4].argmax() + 1
|
|
|
|
| 30 |
def crop_roi(img):
|
| 31 |
img = img[5:-5, 5:-5]
|
| 32 |
|
| 33 |
+
output = cv2.connectedComponentsWithStats((img > 10).astype("uint8")[:, :], 8, cv2.CV_32S)
|
| 34 |
stats = output[2]
|
| 35 |
|
| 36 |
idx = stats[1:, 4].argmax() + 1
|