mirror of
https://github.com/LmeSzinc/StarRailCopilot.git
synced 2024-11-22 08:37:42 +00:00
Fix: IndexError in OcrRogueWorld
This commit is contained in:
parent
4d64ec0252
commit
1bcef3071b
@ -77,6 +77,8 @@ class OcrRogueWorld(Ocr):
|
|||||||
center = color_similarity_2d(image, color=(255, 255, 255))
|
center = color_similarity_2d(image, color=(255, 255, 255))
|
||||||
cv2.inRange(center, 180, 255, dst=center)
|
cv2.inRange(center, 180, 255, dst=center)
|
||||||
center = np.where(np.sum(center, axis=1) > 200)[0]
|
center = np.where(np.sum(center, axis=1) > 200)[0]
|
||||||
|
if len(center) < 2:
|
||||||
|
return image
|
||||||
up, down = center[0], center[-1]
|
up, down = center[0], center[-1]
|
||||||
image = image[up:down, :, :]
|
image = image[up:down, :, :]
|
||||||
return image
|
return image
|
||||||
|
Loading…
Reference in New Issue
Block a user