Documentation

ntsc2rgb

NTSC值转换为RGB有限公司lor space

Syntax

rgbmap = ntsc2rgb(yiqmap)
RGB = ntsc2rgb(YIQ)

Description

rgbmap = ntsc2rgb(yiqmap)converts them-by-3 NTSC (television) color values inyiqmapto RGB color space. Ifyiqmapism-by-3 and contains the NTSC luminance(Y)and chrominance(IandQ)color components as columns, thenrgbmapis anm-by-3 matrix that contains the red, green, and blue values equivalent to those colors. Bothrgbmapandyiqmapcontain intensities in the range 0 to 1.0. The intensity 0 corresponds to the absence of the component, while the intensity 1.0 corresponds to full saturation of the component.

RGB = ntsc2rgb(YIQ)converts the NTSC imageYIQto the equivalent truecolor image RGB.

ntsc2rgbcomputes the RGB values from the NTSC components using

[ R G B ] = [ 1.000 0.956 0.621 1.000 0.272 0.647 1.000 1.106 1.703 ] [ Y I Q ] .

Class Support

The input image or colormap must be of classdouble. The output is of classdouble.

Examples

collapse all

This example shows how to convert an image from RGB to NTSC color space and back.

Read an RGB image into the workspace.

RGB = imread('board.tif');

Convert the image to YIQ color space.

YIQ = rgb2ntsc(RGB);

Display the NTSC luminance, represented by the first color channel in the YIQ image.

imshow(YIQ(:,:,1)) title('Luminance in YIQ Color Space')

Convert the YIQ image back to RGB color space.

RGB2 = ntsc2rgb(YIQ);

Display the image that was converted from YIQ to RGB color space.

figure imshow(RGB2) title('Image Converted from YIQ to RGB Color Space')

Introduced before R2006a

Was this topic helpful?