From 52a29aa288b13d26f9a49c21ec9adc425be3c165 Mon Sep 17 00:00:00 2001 From: guoh064 <50830808+guoh064@users.noreply.github.com> Date: Mon, 16 Dec 2024 00:06:17 +0800 Subject: [PATCH] Fix: jp commission suffix pre_process (#4435) --- module/commission/project.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/module/commission/project.py b/module/commission/project.py index ea2557e9d..41fff2c42 100644 --- a/module/commission/project.py +++ b/module/commission/project.py @@ -41,8 +41,9 @@ class SuffixOcr(Ocr): # will need to pad white background for better recognization image = image[8:-10, :] cv2.normalize(image, image, -55, 255, cv2.NORM_MINMAX) - image = (image > 128).astype(np.uint8) * 255 - image = np.pad(image, ((4, 4), (0, 0)), mode='constant', constant_values=255) + image = (image > 80).astype(np.uint8) * 255 + image = np.pad(image, ((0, 1), (0, 0)), mode='edge') + image = np.pad(image, ((4, 3), (0, 0)), mode='constant', constant_values=255) return image