typo: resize_fill_square

This commit is contained in:
283375 2023-08-30 01:31:42 +08:00
parent 1a2cb5c5bd
commit 8fe53043f7
Signed by: 283375
SSH Key Fingerprint: SHA256:UcX0qg6ZOSDOeieKPGokA5h7soykG61nz2uxuQgVLSk

View File

@ -68,7 +68,7 @@ class FixRects:
return return_rects
def resize_fill_sqaure(img, target: int = 20):
def resize_fill_square(img: Mat, target: int = 20):
h, w = img.shape[:2]
if h > w:
new_h = target
@ -129,7 +129,7 @@ def ocr_digits_by_contour_get_samples(__roi_gray: Mat, size: int):
contours, _ = cv2.findContours(roi, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_NONE)
rects = sorted([cv2.boundingRect(c) for c in contours], key=lambda r: r[0])
# digit_rois = [cv2.resize(crop_xywh(roi, rect), size) for rect in rects]
digit_rois = [resize_fill_sqaure(crop_xywh(roi, rect), size) for rect in rects]
digit_rois = [resize_fill_square(crop_xywh(roi, rect), size) for rect in rects]
return preprocess_hog(digit_rois)