mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-26 05:55:03 +08:00
Fix: image_left_strip() returns an empty image because cropping outside
This commit is contained in:
@@ -672,8 +672,12 @@ def image_left_strip(image, threshold, length):
|
|||||||
"""
|
"""
|
||||||
brightness = np.mean(image, axis=0)
|
brightness = np.mean(image, axis=0)
|
||||||
match = np.where(brightness < threshold)[0]
|
match = np.where(brightness < threshold)[0]
|
||||||
|
|
||||||
if len(match):
|
if len(match):
|
||||||
image = image[:, match[0] + length:]
|
left = match[0] + length
|
||||||
|
total = image.shape[1]
|
||||||
|
if left < total:
|
||||||
|
image = image[:, left:]
|
||||||
return image
|
return image
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user