From 8fe53043f7e933fe14e592832ade03142cfc14bc Mon Sep 17 00:00:00 2001 From: 283375 Date: Wed, 30 Aug 2023 01:31:42 +0800 Subject: [PATCH] typo: `resize_fill_square` --- src/arcaea_offline_ocr/ocr.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/arcaea_offline_ocr/ocr.py b/src/arcaea_offline_ocr/ocr.py index 70300ea..1d5ab3f 100644 --- a/src/arcaea_offline_ocr/ocr.py +++ b/src/arcaea_offline_ocr/ocr.py @@ -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)