The Color Space Conversion block enables you to convert color information from the R'G'B' color space to the Y'CbCr color space and from the Y'CbCr color space to the R'G'B' color space as specified by Recommendation ITU-R BT.601-5. This block can also be used to convert from the R'G'B' color space to intensity. The prime notation indicates that the signals are gamma corrected.
Some image processing algorithms are customized for intensity images. If you want to use one of these algorithms, you must first convert your image to intensity. In this topic, you learn how to use the Color Space Conversion block to accomplish this task. You can use this procedure to convert any R'G'B' image to an intensity image:
I is a 300-by-500-by-3 array of 8-bit unsigned integer values. Each plane of this array represents the red, green, or blue color values of the image.
Image From Workspace
Computer Vision System Toolbox™ > Sources
Color Space Conversion
Computer Vision System Toolbox > Conversions
Computer Vision System Toolbox > Sinks
Use the Image from Workspace block to import your image from the MATLAB workspace. Set theValue parameter to I.
Use the Color Space Conversion block to convert the input values from the R'G'B' color space to intensity. Set the Conversion parameter to R'G'B' to intensity.
View the modified image using the Video Viewer block. View the original image using the Video Viewer1 block. Accept the default parameters.
Solver pane, Stop time = 0
Solver pane, Type = Fixed-step
Solver pane, Solver = Discrete (no continuous states)
The image displayed in the Video Viewer window is the intensity version of the greens.jpg image.
In this topic, you used the Color Space Conversion block to convert color information from the R'G'B' color space to intensity. For more information on this block, see the Color Space Conversion block reference page.