【发布时间】:2009-12-04 15:47:16
【问题描述】:
我发现这段代码试图在 RGB 颜色空间中跟踪红色,
// 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,它没有 比上面的RGB更好的结果 预计,因此,我认为 使用 YCrCb。
谢谢。
【问题讨论】:
标签: java image-processing rgb