diff --git a/app.yaml b/app.yaml index 19e38c1..9f936c7 100644 --- a/app.yaml +++ b/app.yaml @@ -1,6 +1,6 @@ id: t11 name: t11 -version: 2.15.8 +version: 2.15.9 author: t11 icon: '' desc: t11 diff --git a/test/test_decect.py b/test/test_decect.py index 2c33f50..b527270 100644 --- a/test/test_decect.py +++ b/test/test_decect.py @@ -36,7 +36,7 @@ def detect_circle_v3(frame, laser_point=None, img_cv=None): print(f"[detect_circle_v3] begin {datetime.now()}") # -- 1. 缩图加速(与三角形路径保持一致) h_orig, w_orig = img_cv.shape[:2] - MAX_DET_DIM = 320 + MAX_DET_DIM = 480 long_side = max(h_orig, w_orig) if long_side > MAX_DET_DIM: det_scale = MAX_DET_DIM / long_side @@ -81,10 +81,10 @@ def detect_circle_v3(frame, laser_point=None, img_cv=None): red_candidates = [] for cnt_r in contours_red: ar = cv2.contourArea(cnt_r) - if ar <= 30: + if ar <= 10: continue pr = cv2.arcLength(cnt_r, True) - if pr <= 0 or (4 * np.pi * ar) / (pr * pr) <= 0.4: + if pr <= 0 or (4 * np.pi * ar) / (pr * pr) <= 0.3: continue if len(cnt_r) >= 5: (xr, yr), (wr, hr), _ = cv2.fitEllipse(cnt_r) @@ -100,13 +100,13 @@ def detect_circle_v3(frame, laser_point=None, img_cv=None): valid_targets = [] for cnt_yellow in contours_yellow: area = cv2.contourArea(cnt_yellow) - if area <= 50: + if area <= 15: continue perimeter = cv2.arcLength(cnt_yellow, True) if perimeter <= 0: continue circularity = (4 * np.pi * area) / (perimeter * perimeter) - if circularity <= 0.7: + if circularity <= 0.5: continue print(f"[target] -> 面积:{area:.1f}, 圆度:{circularity:.2f}") if len(cnt_yellow) >= 5: diff --git a/version.md b/version.md index d402359..03944cd 100644 --- a/version.md +++ b/version.md @@ -18,4 +18,5 @@ # 2.15.5 打印ota进度 # 2.15.6 更新版本号 # 2.15.7 更新版本号 -# 2.15.8 启动不加载预加载yolo \ No newline at end of file +# 2.15.8 启动不加载预加载yolo +# 2.15.9 20cm \ No newline at end of file diff --git a/version.py b/version.py index e0e438b..06a62c3 100644 --- a/version.py +++ b/version.py @@ -4,6 +4,6 @@ 应用版本号 每次 OTA 更新时,只需要更新这个文件中的版本号 """ -VERSION = '2.15.7' +VERSION = '2.15.9' diff --git a/vision.py b/vision.py index 50cd9ee..556803f 100644 --- a/vision.py +++ b/vision.py @@ -535,7 +535,7 @@ def detect_circle_v3(frame, laser_point=None, img_cv=None): logger.debug(f"[detect_circle_v3] begin {datetime.now()}") # -- 1. 缩图加速(与三角形路径保持一致) h_orig, w_orig = img_cv.shape[:2] - MAX_DET_DIM = 320 + MAX_DET_DIM = 480 long_side = max(h_orig, w_orig) if long_side > MAX_DET_DIM: det_scale = MAX_DET_DIM / long_side @@ -580,10 +580,10 @@ def detect_circle_v3(frame, laser_point=None, img_cv=None): red_candidates = [] for cnt_r in contours_red: ar = cv2.contourArea(cnt_r) - if ar <= 30: + if ar <= 10: continue pr = cv2.arcLength(cnt_r, True) - if pr <= 0 or (4 * np.pi * ar) / (pr * pr) <= 0.4: + if pr <= 0 or (4 * np.pi * ar) / (pr * pr) <= 0.3: continue if len(cnt_r) >= 5: (xr, yr), (wr, hr), _ = cv2.fitEllipse(cnt_r) @@ -599,13 +599,13 @@ def detect_circle_v3(frame, laser_point=None, img_cv=None): valid_targets = [] for cnt_yellow in contours_yellow: area = cv2.contourArea(cnt_yellow) - if area <= 50: + if area <= 15: continue perimeter = cv2.arcLength(cnt_yellow, True) if perimeter <= 0: continue circularity = (4 * np.pi * area) / (perimeter * perimeter) - if circularity <= 0.7: + if circularity <= 0.5: continue if logger: logger.info(f"[target] -> 面积:{area:.1f}, 圆度:{circularity:.2f}")