Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix coordinates for Pillow>9.4.0 #6

Merged
merged 3 commits into from
Dec 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ocrmac/ocrmac.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ def convert_coordinates_pil(bbox, im_width, im_height):
"""Convert vision coordinates to PIL coordinates"""
x, y, w, h = bbox
x1 = x * im_width
y1 = (1 - y) * im_height
y2 = (1 - y) * im_height

x2 = x1 + w * im_width
y2 = y1 - h * im_height
y1 = y2 - h * im_height

return x1, y1, x2, y2

Expand Down