import winocr
from PIL import Image

img_path = 'debug_harness/real_tests/REAL_TEST_20260916_092534/sentinel/20260916_092541_646_STAGE2_MAP_DEVICE_VIEW.png'
img = Image.open(img_path)
res = winocr.recognize_pil_sync(img)

print(f"Total lines detected: {len(res.get('lines', []))}")
for line in res.get('lines', []):
    t = line.get('text', '')
    if any(k in t.upper() for k in ['MAP', 'DEVICE', 'DEV']):
        print(f"  Line: [{t}]")
        for w in line.get('words', []):
            print(f"    Word: '{w.get('text')}' at {w.get('bounding_rect')}")
