Documentation Center

  • Trial Software
  • Product Updates

vision.ColorSpaceConverter System object

Package: vision

Convert color information between color spaces

Description

The ColorSpaceConverter object converts color information between color spaces.

Construction

H = vision.ColorSpaceConverter returns a System object, H, that converts color information from RGB to YCbCr using the conversion standard Rec. 601 (SDTV).

H = vision.ColorSpaceConverter(Name,Value) returns a color space conversion object, H, with each specified property set to the specified value. You can specify additional name-value pair arguments in any order as (Name1, Value1,...,NameN,ValueN).

Code Generation Support
Supports MATLAB® Function block: Yes
System Objects in MATLAB Code Generation
Code Generation Support, Usage Notes, and Limitations.

Properties

Conversion

Color space input and output conversion

Specify the conversion color spaces as one of the following:

[RGB to YCbCr]
[YCbCr to RGB]
[RGB to intensity]
[RGB to HSV]
[HSV to RGB]
[sRGB to XYZ]
[XYZ to sRGB]
[sRGB to L*a*b*]
[L*a*b* to sRGB]

Note that the R, G, B and Y (luma) signal components in the preceding color space conversions are gamma corrected. The default is [RGB to YCbCr].

WhitePoint

Reference white point

Specify the reference white point as one of D50 | D55 | D65. The default is D65. These values are reference white standards known as tristimulus values that serve to define the color "white" to correctly map color space conversions. This property applies when you set the Conversion property to [sRGB to L*a*b*] or [L*a*b* to sRGB].

ConversionStandard

Standard for RGB to YCbCr conversion

Specify the standard used to convert the values between the RGB and YCbCr color spaces as one of Rec. 601 (SDTV) | Rec. 709 (HDTV). The default is Rec. 601 (SDTV). This property applies when you set the Conversion property to [RGB to YCbCr] or [YCbCr to RGB].

ScanningStandard

Scanning standard for RGB-to-YCbCr conversion

Specify the scanning standard used to convert the values between the RGB and YCbCr color spaces as one of [1125/60/2:1] | [1250/50/2:1]. The default is [1125/60/2:1]. This property applies when you set the ConversionStandard property to Rec. 709 (HDTV).

Methods

cloneCreate color space converter object with same property values
getNumInputsNumber of expected inputs to step method
getNumOutputsNumber of outputs from step method
isLockedLocked status for input attributes and nontunable properties
release Allow property value and input characteristics changes
stepConvert color space of input image

Examples

Convert an image from an RGB to an intensity color space.

i1 = imread('pears.png');
imshow(i1);

hcsc = vision.ColorSpaceConverter;
hcsc.Conversion = 'RGB to intensity';
i2 = step(hcsc, i1);

pause(2);
imshow(i2); 

Algorithms

This object implements the algorithm, inputs, and outputs described on the Color Space Conversion block reference page. The object properties correspond to the block parameters, except:

The Image signal block parameter allows you to specify whether the block accepts the color video signal as One multidimensional signal or Separate color signals. The object does not have a property that corresponds to the Image signal block parameter. You must always provide the input image to the step method of the object as a single multidimensional signal.

See Also

Was this topic helpful?