Prev: problems getting mhsample to work
Next: Converting a color video into binary using specified RGB
From: eli goodwin on 6 Jul 2010 21:01 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 6 Jul 2010 21:17 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
|
Pages: 1 Prev: problems getting mhsample to work Next: Converting a color video into binary using specified RGB |