mirror of
https://github.com/LmeSzinc/AzurLaneAutoScript.git
synced 2025-01-09 06:07:40 +08:00
Fix: Handle Runtime error raised by uiautoamtor2
This commit is contained in:
parent
5f73f23293
commit
8d06ce4987
@ -502,6 +502,20 @@ def rgb2hsv(image):
|
||||
return image
|
||||
|
||||
|
||||
def rgb2yuv(image):
|
||||
"""
|
||||
Convert RGB to YUV color space.
|
||||
|
||||
Args:
|
||||
image (np.ndarray): Shape (height, width, channel)
|
||||
|
||||
Returns:
|
||||
np.ndarray: Shape (height, width)
|
||||
"""
|
||||
image = cv2.cvtColor(image, cv2.COLOR_RGB2YUV)
|
||||
return image
|
||||
|
||||
|
||||
def rgb2luma(image):
|
||||
"""
|
||||
Convert RGB to the Y channel (Luminance) in YUV color space.
|
||||
|
@ -142,6 +142,11 @@ def handle_adb_error(e):
|
||||
# the device is still available, but it needs to be disconnected and re-connected.
|
||||
logger.error(e)
|
||||
return True
|
||||
elif 'is offline' in text:
|
||||
# RuntimeError: USB device 127.0.0.1:7555 is offline
|
||||
# Raised by uiautomator2 when current adb service is killed by another version of adb service.
|
||||
logger.error(e)
|
||||
return True
|
||||
elif 'unknown host service' in text:
|
||||
# AdbError(unknown host service)
|
||||
# Another version of ADB service started, current ADB service has been killed.
|
||||
|
Loading…
Reference in New Issue
Block a user