This commit is contained in:
HuangHai
2026-01-14 10:43:46 +08:00
parent 068cb63274
commit bf553ce232
6 changed files with 17 additions and 4 deletions

View File

@@ -267,9 +267,19 @@ class ReadImageKit:
final_stations = []
if cv_bboxes and isinstance(vlm_results, list):
img = read_image(image_path)
h, w = img.shape[:2] if img is not None else (2400, 1080)
y_threshold = h * 0.58
for i, res in enumerate(vlm_results):
if i < len(cv_bboxes):
bbox = cv_bboxes[i]
# 物理坐标硬过滤:即使 CV 识别到了,y 坐标在 58% 以上的也统统干掉
center_y = (bbox[1] + bbox[3]) // 2
if center_y < y_threshold:
logger.warning(f"CV 误报过滤 (y={center_y} < {y_threshold}): 可能是顶部营销卡片")
continue
if res and (res.get("is_valid") is True or (res.get("name") and res.get("is_valid") is not False)):
final_stations.append({
"name": res.get("name"),