Fix: jp commission suffix pre_process (#4435)

This commit is contained in:
guoh064 2024-12-16 00:06:17 +08:00 committed by GitHub
parent 27b92c9b58
commit 52a29aa288
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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