函数:
对图像进行颜色识别,将突图像转为RGB三通道图,将三通道图转成’hsv‘色差空间中,在针对颜色特定的灰度值范围对图像中的物体进行区分,图像的明亮度对结果影响不大
效果图:
主要算子:
trans_from_rgb:从RGB颜色空间转换图像到任意颜色空间
HSV:H色调、S饱和度、V明度
计算方式:
Min := min([R, G, B])
Max := max([R, G, B])
V := Max
if (Max == Min)
S := 0
H := 0
else
S := (Max - Min) / Max
if (R == Max)
H := ((G - B) / (Max - Min)) * rad(60)
elseif (G == Max)
H := (2 + (B - R) / (Max - Min)) * rad(60)
elseif (B == Max)
H := (4 + (R - G) / (Max - Min)) * rad(60)
endif
endif