'''python
def detected_color_brightness(img):
# image = Image.fromarray(cv2.cvtColor(img, cv2.COLOR_BGR2RGB))
# stat = ImageStat.Stat(image)
# r, g, b = stat.mean
# brightness = math.sqrt(0.241 * (r ** 2) + 0.691 * (g ** 2) + 0.068 * (b ** 2))
yuv_img = cv2.cvtColor(img, cv2.COLOR_BGR2YUV)
y,u,v = cv2.split(yuv_img)
y_brightness = np.mean(y)
return y_brightness
'''
网友评论