From 93a01b792bf2480232a0717bd12559d215f28f24 Mon Sep 17 00:00:00 2001 From: Showdown76py Date: Mon, 19 May 2025 20:11:56 +0200 Subject: [PATCH] fix: update OCR result coordinates to center position --- ai/compute.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ai/compute.py b/ai/compute.py index 81c8eed..554a7ba 100644 --- a/ai/compute.py +++ b/ai/compute.py @@ -44,10 +44,8 @@ def perform_ocr(screenshot: bytes) -> list[dict]: if text and text.strip(): results.append({ 'text': text, - 'left': data['left'][i], - 'top': data['top'][i], - 'width': data['width'][i], - 'height': data['height'][i] + 'x': data['width'][i] + data['left'][i] // 2, # center x position + 'y': data['height'][i] + data['top'][i] // 2 # center y position }) return results