<< ComputeChannelVariance Image Processing Design CreateCumulatedHistogram >>

Image Processing Design >> Image Processing Design > ConvertColorSpace

ConvertColorSpace

converts a color image from a color space to another one or to a gray level image

Calling Sequence

Result = ConvertColorSpace(PixelList, Dimensions, Conversion);

Parameters

PixelList

linear list of the pixels of a color image, must be a vector of type uint8 or double

Dimensions

vector of type double containing the numbers of rows, columns and channels

Conversion

constant of type uint8, can be CONVERSION_RGB2GRAY, CONVERSION_RGB2LAB or CONVERSION_LAB2RGB

Result

vector of the same length and type as PixelList

Description

This function transforms the pixels of a color image from one color space to another one. If the list of pixels is of type double, it is transformed to a list of floats internally. This function is called by RGB2Gray, RGB2LAB and LAB2RGB so you do not need to call it yourself.

Examples

global IPD_PATH;

RGB = ReadImage(IPD_PATH + 'demos\teaset.png');

global CONVERSION_RGB2LAB;

LABPixelList = ConvertColorSpace(RGB(:), size(RGB), CONVERSION_RGB2LAB);

LAB = matrix(LABPixelList, size(RGB));

figure(); ShowImage(LAB(:, :, 1), 'L*');

figure(); ShowImage(LAB(:, :, 2), 'a*');

figure(); ShowImage(LAB(:, :, 3), 'b*');

See also


Report an issue
<< ComputeChannelVariance Image Processing Design CreateCumulatedHistogram >>