OpenCV中RGB转HSV

max_v = max(r,g,b)
min_v = max(r,g,b)
v = max(r,g,b)
s = (max-min)/(max)* 255

if r = max, h = (g-b)/(max-min)
if g = max, h = 2 + (v-r)/(max-min)
if b = max, h= 4 + (r-g)/(max-min)
h = h * 30
if h < 0, h =h + 180

你可能感兴趣的:(图像处理,图像处理)