Main Content

Convert Image Color Space from RGB to YCbCr

This example shows you how to convert an image color space from RGB to YCbCr.

Example Model

Open the Simulink® model.

modelname = "ex_blkconvertcolorspace.slx";
open_system(modelname);

This model reads an input image using the Image From File block, then converts the input image from the RGB color space to the YCbCr color space by using a Color Space Conversion block with these parameter values:

  • ConversionR'G'B' to Y'CbCr

  • Use conversion specified byRec. 601 (SDTV)

  • Image signalOne multidimensional signal

Simulate the Model

Run the model. The model displays the RGB color space input image and the converted YCbCr color space output image using Video Viewer blocks.

sim(modelname);