mirror of
https://github.com/283375/arcaea-offline-ocr.git
synced 2025-04-19 05:20:17 +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
|
left += 1
|
||||||
|
|
||||||
for i in sorted(range(width), reverse=True):
|
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):
|
if i <= left + 1 or not is_black_edge(column, black_pixel):
|
||||||
break
|
break
|
||||||
right -= 1
|
right -= 1
|
||||||
@ -48,7 +48,7 @@ def crop_black_edges(screenshot: Mat):
|
|||||||
top += 1
|
top += 1
|
||||||
|
|
||||||
for i in sorted(range(height), reverse=True):
|
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):
|
if i <= top + 1 or not is_black_edge(row, black_pixel):
|
||||||
break
|
break
|
||||||
bottom -= 1
|
bottom -= 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user