Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Color dectection using YCrCb instead of HUV

I'm able to detect colors (i.e. green) using the code below:

Imgproc.cvtColor(rgbaImage, mHsvMat, Imgproc.COLOR_RGB2HSV_FULL); Core.inRange(mHsvMat, new Scalar(60, 100, 30), new Scalar(130, 255, 255), mProcessedMat); // Green color

However, I am not able to accomplish the same detection when I use "Imgproc.COLOR_RGB2YCrCb" instead of "Imgproc.COLOR_RGB2HSV_FULL" because I cannot figure out the values of the scalar min and max parameters for the YUV counterpart colors.

So, is it possible to detect colors using YCrCb using the inRange() method or do I need to use a different method? Or does anyone know how can I map the min and max parameters for YUV?

TIA!