visionhdl.ColorSpaceConverter
Convert color information between color spaces
Description
The visionhdl.ColorSpaceConverter
System object™ converts between R'G'B' and Y'CbCr color spaces, and also converts R'G'B'
to intensity.
Note
The ColorSpaceConverter
System object operates on gamma-corrected color spaces. However, to simplify use of
the System object, the property arguments do not include the prime notation.
To convert color information between color spaces:
Create the
visionhdl.ColorSpaceConverter
object and set its properties.Call the object with arguments, as if it were a function.
To learn more about how System objects work, see What Are System Objects?
Creation
Description
returns a System object that converts between color spaces. Set properties using one or
more name-value pairs. Enclose each property name in single quotes. CSC
= visionhdl.ColorSpaceConverter(Name
,Value
)
Properties
Usage
Description
[
converts a single pixel from one color space to another. The input
pixelout
,ctrlout
] = CSC(pixelin
,ctrlin
)pixelin
is a vector of three values representing one
pixel in R'G'B' or Y'CbCr color space. If the Conversion
property is set to 'RGB to YCbCr'
or 'YCbCr to
RGB'
, then the output pixelout
is a vector of
three values representing one pixel. If the Conversion
property is set to 'RGB to intensity'
, then the output
pixelout
is a scalar value representing one
pixel.
This object uses a streaming pixel interface with a structure for frame control
signals. This interface enables the object to operate independently of image size
and format and to connect with other Vision HDL Toolbox™ objects. The object accepts and returns a three-component vector that
represents a single pixel and a structure that contains five control signals. The
control signals indicate the validity of each pixel and its location in the frame.
To convert a pixel matrix into a pixel stream and control signals, use the visionhdl.FrameToPixels
object.
For a full description of the interface, see Streaming Pixel Interface.
Input Arguments
Output Arguments
Object Functions
To use an object function, specify the
System object as the first input argument. For
example, to release system resources of a System object named obj
, use
this syntax:
release(obj)
Examples
Algorithms
This System object implements the algorithms described on the Color Space Converter block reference page.
Extended Capabilities
Version History
Introduced in R2015aSee Also
Color Space Converter | rgb2ycbcr
(Image Processing Toolbox) | ycbcr2rgb
(Image Processing Toolbox) | rgb2gray
| visionhdl.FrameToPixels