feat: add area_center function and enhance OCR processing for white letters

This commit is contained in:
2026-07-05 16:40:00 +08:00
parent a7290f253e
commit 07a7a19929
2 changed files with 33 additions and 1 deletions
+14
View File
@@ -274,6 +274,20 @@ def area_size(area):
)
def area_center(area):
"""
Get the center of an area
Args:
area: (upper_left_x, upper_left_y, bottom_right_x, bottom_right_y)
Returns:
tuple: (x, y)
"""
x1, y1, x2, y2 = area
return (x1 + x2) / 2, (y1 + y2) / 2
def point_limit(point, area):
"""
Limit point in an area.