From 9dede2eaa1d3e68be387c5fd612eb48226a54c9d Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期五, 04 八月 2023 16:07:22 +0800
Subject: [PATCH] HOST修改

---
 opencv_util.py |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/opencv_util.py b/opencv_util.py
index c87fe45..a3f41dc 100644
--- a/opencv_util.py
+++ b/opencv_util.py
@@ -118,11 +118,11 @@
     if start_row < 0:
         raise Exception("娌℃壘鍒颁笂鍒嗗壊绾�")
 
-    end_col = cols - 1
+    start_col = cols - 1
     for c in range(cols - 1, -1, -1):
         if is_col_full(img, c, start_row, end_row, 38, 38, 2):
             # print("鎵惧埌鍒嗛殧锛�", col)
-            end_col = c - 1
+            start_col = c + 1
             break
     # 寰�鍓嶆壘鏁板瓧鍒嗛殧
     content_start = -1
@@ -134,11 +134,11 @@
     # 鑾峰彇浠g爜鐨勬渶澶ц壊鍊�
     max_color = 0
     for r in range(start_row, end_row + 1):
-        for c in range(end_col, end_col // 2, -1):
+        for c in range(cols - 1, start_col + (cols - start_col) // 2, -1):
             if img[r][c] > max_color:
                 max_color = img[r][c]
-
-    for col in range(end_col, 0, -1):
+    # 浠庡悗寰�鍓嶆壘
+    for col in range(cols - 1, start_col, -1):
         if not is_col_empty(img, col, start_row, end_row, max_color * 2 // 3):
             if start_index < 0:
                 start_index = col

--
Gitblit v1.8.0