Skip to content

Commit

Permalink
fix:calcute the left_center_pt and right_center_pt from min_area_quad (
Browse files Browse the repository at this point in the history
  • Loading branch information
fangfangzk authored Dec 11, 2024
1 parent bb7e24e commit 2672be5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ppocr/data/imaug/pg_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,8 @@ def fit_and_gather_tcl_points_v2(
ys, xs = np.where(tmp_image > 0)
xy_text = np.array(list(zip(xs, ys)), dtype="float32")

left_center_pt = ((min_area_quad[0] - min_area_quad[1]) / 2.0).reshape(1, 2)
right_center_pt = ((min_area_quad[1] - min_area_quad[2]) / 2.0).reshape(1, 2)
left_center_pt = ((min_area_quad[0] + min_area_quad[3]) / 2.0).reshape(1, 2)
right_center_pt = ((min_area_quad[1] + min_area_quad[2]) / 2.0).reshape(1, 2)
proj_unit_vec = (right_center_pt - left_center_pt) / (
np.linalg.norm(right_center_pt - left_center_pt) + 1e-6
)
Expand Down

0 comments on commit 2672be5

Please sign in to comment.