def hsl_threshold(image, hue=(0, 122), sat=(126, 225), lum=(83, 255)):
# HSL threshold to highlight just the tape ([hue, sat, lum]).
hls_min = np.array([hue[0], sat[0], lum[0]])
hls_max = np.array([hue[1], sat[1], lum[1]])
image = cv2.cvtColor(image, cv2.COLOR_BGR2HLS)
image = cv2.inRange(image, hls_min, hls_max)
return image
评论列表
文章目录