mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-24 04:25:56 +08:00
Fix: pre_process of LevelOcr may return NoneType
This commit is contained in:
@@ -97,6 +97,7 @@ class LevelOcr(Digit):
|
|||||||
# Ruturn an empty image if 'L' is not found.
|
# Ruturn an empty image if 'L' is not found.
|
||||||
letter_l = np.nonzero(image[2:15, :].max(axis=0) < 127)[0]
|
letter_l = np.nonzero(image[2:15, :].max(axis=0) < 127)[0]
|
||||||
if len(letter_l):
|
if len(letter_l):
|
||||||
return image[:, letter_l[0] + 17:]
|
first_digit = letter_l[0] + 17
|
||||||
else:
|
if first_digit + 3 < LV_GRID_MAIN.button_shape[0]:
|
||||||
return np.array([[255]], dtype=np.uint8)
|
return image[:, first_digit:]
|
||||||
|
return np.array([[255]], dtype=np.uint8)
|
||||||
|
|||||||
Reference in New Issue
Block a user