3.3 알고리즘 광량 측정 평가
import cv2
import numpy as np
def light_acclerate(img_array):
img_array = cv2.cvtColor(img_array,cv2._COLOR_BGR2HSV)
hist = cv2.calcHist([img_array], [2], None, [256], [0,256])
total_pixels = img_array.shape[0] * img_array.shape[1]
high_brightness_pixels = np.sum(hist[200:])
percentage = round((high_brightness_pixels / total_pixels) * 100)
return perentage
영상 제목
HSV 밝기값
히스토그램에서 200 이상 흰색 영역 값



Last updated