Skip to content

Commit 2672be5

Browse files
authored
fix:calcute the left_center_pt and right_center_pt from min_area_quad (#14363)
1 parent bb7e24e commit 2672be5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ppocr/data/imaug/pg_process.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,8 @@ def fit_and_gather_tcl_points_v2(
265265
ys, xs = np.where(tmp_image > 0)
266266
xy_text = np.array(list(zip(xs, ys)), dtype="float32")
267267

268-
left_center_pt = ((min_area_quad[0] - min_area_quad[1]) / 2.0).reshape(1, 2)
269-
right_center_pt = ((min_area_quad[1] - min_area_quad[2]) / 2.0).reshape(1, 2)
268+
left_center_pt = ((min_area_quad[0] + min_area_quad[3]) / 2.0).reshape(1, 2)
269+
right_center_pt = ((min_area_quad[1] + min_area_quad[2]) / 2.0).reshape(1, 2)
270270
proj_unit_vec = (right_center_pt - left_center_pt) / (
271271
np.linalg.norm(right_center_pt - left_center_pt) + 1e-6
272272
)

0 commit comments

Comments
 (0)