Skip to content

Commit

Permalink
Merge pull request #6 from many-hats/main
Browse files Browse the repository at this point in the history
Fix coordinates for Pillow>9.4.0
  • Loading branch information
straussmaximilian committed Dec 8, 2023
2 parents 2a7513d + 0169c17 commit 1be9c23
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit 1be9c23

Please sign in to comment.