此代码,我发现试图追踪红色在RGB色彩空间,使用YCrCb颜色空间进行颜色检测?
// red color detection, turn the detected one into white
if (((red > (0.85 * (green + blue))) && (red > 105))
&& ((red - green > 73)) && (((green < 150)
|| ((green >= 150) && (blue > 140))))) {
// set the pixel to white
red = 255; green = 255; blue = 255;
}
有谁知道如何使用的YCrCb色彩空间,而不是RGB跟踪的颜色? 我只是不知道每种颜色的范围究竟是为了追踪它, YCrCb中的红色范围。
编辑:我已经试过HSV,它不上面 预期,因此,我认为 使用的YCrCb给 比RGB更好的结果。
谢谢。