From: eli goodwin on
I would like to convert a color video into binary using specific RGB thresholds. How would I go about altering the cdata to do this?
From: ImageAnalyst on
On Jul 6, 9:01 pm, "eli goodwin" <egood...(a)uoregon.edu> wrote:
> I would like to convert a color video into binary using specific RGB thresholds. How would I go about altering the cdata to do this?

---------------------------------------------
eli:
Well once you have the thresholds, you'd do something like
% Extract the individual red, green, and blue color planes.
redPlane = rgbImage(:, :, 1);
greenPlane = rgbImage(:, :, 2);
bluePlane = rgbImage(:, :, 3);

redBinary = (redPlane > redLowThreshold) & (redPlane <
redHighThreshold);
greenBinary = (greenPlane > greenLowThreshold) & (greenPlane <
greenHighThreshold);
blueBinary = (bluePlane > blueLowThreshold) & (bluePlane <
blueHighThreshold);
threshImage = redBinary & greenBinary & blueBinary;

See my color detection demo for a more extensive example:
http://www.mathworks.com/matlabcentral/fileexchange/26420-simplecolordetection
-ImageAnalyst