fix: update OCR result coordinates to center position
This commit is contained in:
parent
3d5f71ec84
commit
93a01b792b
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user