'commit'
This commit is contained in:
@@ -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"),
|
||||
|
||||
Reference in New Issue
Block a user