cvtcolorcv

Convert the image, handle, to a different color space.

Syntax

R = cvtcolorcv(handle, colorspace...)

R = cvtcolorcv(handle, colorspace, channels)

Inputs

handle
Handle of an image.
Type: integer
colorspace
Color space code. Valid values are 0 to 142.
Type: integer
channels
Optional parameter specifying channels in the output. Default value is 0, indicating R will have the same number of channels as handle.
Type: integer

Outputs

R
Handle of the output image in the color space specified.
Type: integer

Example

Converts image from convert RGB/BGR to CIE Luv:

handle = imreadcv('image1.jpg');
colorspace = 50;
R = cvtcolorcv(handle, colorspace);