This commit is contained in:
HuangHai
2026-01-15 15:41:30 +08:00
parent 5172dbbc49
commit ba46eb15f6
20 changed files with 335 additions and 182 deletions

View File

@@ -286,7 +286,7 @@ def detect_price_info_container_cv(image_path):
return None
h, w = img.shape[:2]
keywords = ['阶段性电价']
keywords = ['阶段性电价', '当前电费']
try:
reader = get_ocr_reader()
@@ -300,8 +300,8 @@ def detect_price_info_container_cv(image_path):
x_max = np.max(pts[:, 0])
y_max = np.max(pts[:, 1])
center_x = (x_min + x_max) // 2
center_y = (y_min + y_max) // 2
center_x = int((x_min + x_max) // 2)
center_y = int((y_min + y_max) // 2)
logger.info(f"[OCR识别] 找到文本: '{text}', 置信度: {prob:.4f}, 中心坐标: ({center_x}, {center_y})")
return (center_x, center_y)
except Exception as e: