mirror of
https://github.com/283375/arcaea-offline-ocr.git
synced 2025-04-16 03:50:18 +00:00
fix: crop_black_edges
This commit is contained in:
parent
769ed35588
commit
6c411e6769
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user