CCT2RGB_CVIP

cct2rgb_cvip() - This function Converts CCT (Cylindrical Coordinate)Color value to RGB Color value.

Contents

SYNTAX

OutputImage = cct2rgb_cvip(InputImage, type)

Input parameters include:

              (0 = Forward non normalized output)
              (1 = gives normalized output)

Output parameter includes:

DESCRIPTION

This function converts CCT (Cylindrical Coordinate) Color value to RGB Color value. The CCT transform is different than most color mappings because it does not completely decouple brightness from color information. With this transform we can align the z-axis along the R, G, or B axis of choice; this choice will be application dependent.The cylindrical coordinates are found as follows, assuming z-axis is aligned along the blue axis:

                z = B
                d = (R^2+G^2)^(1/2)
                theta = atan(G/R)

The CCT may be useful in applications where one of the RGB colors is of primary importance,since it can be mapped directly to the z component, and the ratio of the other two is significant. Here the brightness information is now contained in the d and z coordinates, while the color information is still distributed across all three components, but in a different manner than with the original RGB data.

To view the 8-bit image of type double, divide outputImage by 255. To view the 16-bit image of type double, divide outputImage by 65535.

REFERENCE

1. Scott E Umbaugh. DIGITAL IMAGE PROCESSING AND ANALYSIS: Applications with MATLAB and CVIPtools, 3rd Edition.

EXAMPLE

% Read Image

  ipImage1=imread('Car.bmp');

% Call function

  cctImage = rgb2cct_cvip(ipImage1, 1);
  outputImage=cct2rgb_cvip( cctImage, 1);

% Display Input Image

  figure;imshow(ipImage1);title('Original RGB Image');
  figure;imshow(cctImage);title('Input CCT Image');


% Display Output Image

  figure;imshow(outputImage,[]);title('Output RGB Image');

CREDITS

Author: Deependra Mishra, March 2017
Copyright © 2017-2018 Scott E Umbaugh
For updates visit CVIP Toolbox Website