mirror of
https://github.com/283375/arcaea-offline-ocr.git
synced 2025-04-21 06:20:18 +00:00
fix: max recall ocr improve
This commit is contained in:
parent
07df8e3b56
commit
d52d545864
@ -146,9 +146,9 @@ class DeviceV2Ocr:
|
|||||||
contours, _ = cv2.findContours(
|
contours, _ = cv2.findContours(
|
||||||
roi_closed, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_NONE
|
roi_closed, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_NONE
|
||||||
)
|
)
|
||||||
rects = sorted(
|
rects = [cv2.boundingRect(c) for c in contours]
|
||||||
[cv2.boundingRect(c) for c in contours], key=lambda r: r[0], reverse=True
|
rects = [r for r in rects if r[2] > 5 and r[3] > 5]
|
||||||
)
|
rects = sorted(rects, key=lambda r: r[0], reverse=True)
|
||||||
max_recall_roi = crop_xywh(roi, rects[0])
|
max_recall_roi = crop_xywh(roi, rects[0])
|
||||||
return ocr_digits_by_contour_knn(max_recall_roi, self.knn_model)
|
return ocr_digits_by_contour_knn(max_recall_roi, self.knn_model)
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ BYD_MIN_HSV = np.array([170, 50, 50], np.uint8)
|
|||||||
BYD_MAX_HSV = np.array([179, 210, 198], np.uint8)
|
BYD_MAX_HSV = np.array([179, 210, 198], np.uint8)
|
||||||
|
|
||||||
MAX_RECALL_PURPLE_MIN_HSV = np.array([125, 0, 0], np.uint8)
|
MAX_RECALL_PURPLE_MIN_HSV = np.array([125, 0, 0], np.uint8)
|
||||||
MAX_RECALL_PURPLE_MAX_HSV = np.array([130, 100, 150], np.uint8)
|
MAX_RECALL_PURPLE_MAX_HSV = np.array([145, 100, 150], np.uint8)
|
||||||
|
|
||||||
|
|
||||||
def mask_gray(__img_bgr: Mat):
|
def mask_gray(__img_bgr: Mat):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user