From 6c411e6769ae02f9c5584e0eebcf2ca6651ddbd8 Mon Sep 17 00:00:00 2001 From: 283375 Date: Wed, 26 Jul 2023 22:03:11 +0800 Subject: [PATCH] fix: crop_black_edges --- src/arcaea_offline_ocr/crop.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/arcaea_offline_ocr/crop.py b/src/arcaea_offline_ocr/crop.py index 1ab7fa3..7af0b34 100644 --- a/src/arcaea_offline_ocr/crop.py +++ b/src/arcaea_offline_ocr/crop.py @@ -36,7 +36,7 @@ def crop_black_edges(screenshot: Mat): left += 1 for i in sorted(range(width), reverse=True): - column = cropped[:, width - i] + column = cropped[:, i] if i <= left + 1 or not is_black_edge(column, black_pixel): break right -= 1 @@ -48,7 +48,7 @@ def crop_black_edges(screenshot: Mat): top += 1 for i in sorted(range(height), reverse=True): - row = cropped[height - i] + row = cropped[i] if i <= top + 1 or not is_black_edge(row, black_pixel): break bottom -= 1