mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-12 06:18:21 +08:00
Refactor: enemy_searching_appear() using template matching
This commit is contained in:
@@ -502,6 +502,21 @@ def rgb2hsv(image):
|
||||
return image
|
||||
|
||||
|
||||
def rgb2luma(image):
|
||||
"""
|
||||
Convert RGB to the Y channel (Luminance) in YUV color space.
|
||||
|
||||
Args:
|
||||
image (np.ndarray): Shape (height, width, channel)
|
||||
|
||||
Returns:
|
||||
np.ndarray: Shape (height, width)
|
||||
"""
|
||||
image = cv2.cvtColor(image, cv2.COLOR_RGB2YUV)
|
||||
luma, _, _ = cv2.split(image)
|
||||
return luma
|
||||
|
||||
|
||||
def get_color(image, area):
|
||||
"""Calculate the average color of a particular area of the image.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user