import sys
sys.path.insert(0, ".")
from PIL import Image
import src.common.vision_ocr as vision_ocr

img = Image.open("captures/pipeline_run/20260919_173918_984_STAGE2_ATLAS_UI_PROBE.png")
res = vision_ocr.safe_recognize_pil_sync(img)
print("=== STAGE2_ATLAS_UI_PROBE (Size: %s) ===" % str(img.size))
for l in res.get("lines", []):
    txt = l.get("text", "")
    for w in l.get("words", []):
        w_txt = w.get("text", "")
        if any(k in w_txt.upper() for k in ["MAP", "DEVICE", "ANGE", "WELL", "WAYPOINT", "WAYPOI"]):
            print("Word '%s' in line '%s' at %s" % (w_txt, txt, w.get("bounding_rect")))
