HSV2RGB_CVIP

hsv2rgb_cvip() - Converts Hue-Saturation-Value Color value to Red-Green-Blue Color value

Contents

SYNTAX

OutputImage = hsv2rgb_cvip(InputImage, type)

DESCRIPTION

This function converts HSV (Hue-Saturation-Value) Color value to RGB Color value. The RGB color model is an additive color model in which red, green and blue light are addd together in various ways to reproduce a broad array of colors. RGB color values are found from HSV color values as follows:

                 C = V * S
                 H' = H/60
                 X = C * (1-|H' mod 2 - 1|)
                            (0,0,0)  if H is undefined
                            (C,X,0)  if 0 <= H' <= 1
                            (X,C,0)  if 1 <= H' <= 2
                 R1,G1,B1 = (0,C,X)  if 2 <= H' <= 3
                            (0,X,C)  if 3 <= H' <= 4
                            (X,0,C)  if 4 <= H' <= 5
                            (C,0,X)  if 5 <= H' <= 6
                 m = V - C
                (R,G,B) = (R1+m, G1+m, B1+m)

REFERENCE

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

EXAMPLE

% Read image

 X = imread('Car.bmp');

% Call function

 S1 = rgb2hsv_cvip(X,0);

 S2 = hsv2rgb_cvip(S1);

% Display input image

 figure;imshow(X);title('Input image');

% Display output images

 figure;imshow(S1,[]);title('Output image from rgb2hsv');

 figure;imshow(remap_cvip(S2,[]));title('Output image from hsv2rgb');

CREDITS

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