make sure work without cuda

This commit is contained in:
unknown
2025-12-29 17:20:48 +08:00
parent 55228413d4
commit b9573c5781
5 changed files with 10 additions and 4 deletions
+3 -2
View File
@@ -443,7 +443,7 @@ class Stitcher:
h, w = img.shape[:2]
n_boxes = 0
bk_thresh = 35 # initial black threshold
bk_thresh = 0 # initial black threshold
bk_thresh_step = 5
bk_thresh_max = 100
@@ -461,7 +461,8 @@ class Stitcher:
kernel = cv2.getStructuringElement(cv2.MORPH_RECT, (k, k))
mask = cv2.morphologyEx(mask, cv2.MORPH_OPEN, kernel, iterations=1)
mask = cv2.morphologyEx(mask, cv2.MORPH_CLOSE, kernel, iterations=2)
# cv2.imshow("mask", mask)
# cv2.waitKey(0)
# find contours of candidate regions
contours, _ = cv2.findContours(mask, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)