Wednesday 27 February 2013

Noisy Bit-Planes

When we create bit planes of any image then some of them appears near to the original image & some of them are pure dark .So these bit planes are noisy .To detecting noisy bit plane we need to compare each pixel to its three adjacent pixels .If  we talk about pixel(x,y) then we need to compare it to the pixel(x-1,y),pixel(x-1,y-1)& pixel(x-1,y-1) .If pixel(x,y) is same as the at least two of them then this pixel is not noisy.A noisy noisy bit plane will have 49 to 51% pixels that are noise.

Sunday 24 February 2013

Different Color Spaces


We already know that pixels are the smallest point in an image.Our eyes are most sensible for Red ,Green & Blue colors.Every pixel is made by these three colors.These three colors produce thousand of colors which we can see with their different combinations.

There are many other color spaces used :-
1)RGB
2)sRGB
3)RGBA
4)CMY
5)CMYK
6) HSL
7)HSB/HSV
8)HSI
9)YUV
10)YCbCr
11)Y'UV
12)Y'CbCr
13)YPbPr
14)YIQ
15)CIEXYZ
16)CIELAB
17)CIELUV
18)CIEUVW
19)TSL
20)RG Chromaticity
21)CIERGB
22)Y'CH
23)YCoCg
24)AYCoCg
25)YDbDr

1)RGB:-RGB Color space is an additive model in which they are added together to produce various range of  colors.The image which we see is the combination of these three colors.This is the most simple color space which is widely used.These color images are generally expressed in RGB values which is also know as color channel.We can easily calculate it in a 24-bit image & stores in three different arrays.We can also get the input image to put these three array values in a sequence.Popular usage of typical RGB are digital cameras ,video cameras ,image scanners etc which are used as input device.Typical output devices are LCD ,LED,PLASMA T.V.,Projectors etc.


2)sRGB:-sRGB is a standard color space created by HP & Microsoft co-operatively.It is used in monitors ,printers & internet.The sRGB color space is well specified & is designed to match home & office view conditions.LCDs ,digital cameras & scanners & printers all follow the RGB  color space.
sRGB also defines a non-linear transformation between the intensity of these primaries.
ChromaticityRedGreenBlueWhite point
x0.64000.30000.15000.3127
y0.33000.60000.06000.3290
Y0.21260.71530.07211.0000
                               





3)RGBA:-RGBA stands for red ,green,blue,alpha.It is actually an extension  of RGB color space.It have additional integral alpha value.Alpha channel is normally used as an opacity channel.If a pixel have a value of 0% in its alpha channel .Then it is fully transparent.Whereas a pixel having 100% in its alpha channel is fully opaque pixel.

4)CMY:-When we use color printing there is a problem occur because paper cannot generate light ,But it only reflects light which scattered on it.Then we need to apply ink on that surface.We need Cyan color to remove Red ,Magenta to remove Blue & Yellow to remove Green.These are called subtractive colors.This image simply a negative of RGB color Space .It means if we need to convert a CMY image to RGB image when we apply a process to get a negative image .Then declare it as a CMY image.

5)CMYK:-   It is an extension to the  CMY color space The main problem with CMY color space is it only removes only RGB colors & not removing all the light that is being reflected.So to resolve this problem we add a black color to remove all reflecting light.In CMYK K is stands for key which is Black & an another reason for using k Because the first letter of black is used for blue.The main benefit of using black color is that the text printed are black & black is less expensive than others.

6)HSL:-  HSL is the most common cylindrical co-ordinate representation .It have wide use in color pickers in image editing softwares.HSL stands for hue,saturation & lightness.In each cylinder the angle around the central vertical axis corresponds to hue,the distance from the axis corresponds to saturation & the distance along the  axis corresponds the lightness.

7)HSV/HSB:-HSV is the most common cylindrical co-ordinate representation.It also have wide use in color pickers in image editing softwares.HSV stands for hue,saturation & value and also called as HSB(B for brightness).In each cylinder the angle around the central vertical axis corresponds to hue,the distance from the axis corresponds to saturation & the distance along the  axis corresponds the brightness or value.

8)HSI:-It is also common in computer vision application.HSI stands for hue saturation and intensity.

9)YUV:-YUV is a color space typically used as a part of color image pipeline.It encodes a color image or video taking human perception into account,allowing reduced bandwidth for chrominance components thereby typical enabling transmission errors or compression artifacts to be more efficiently masked by the human perception than using a direct RGB representation .

10)YCbCr:-YCbCr is family of color spaces as a part of  the color image pipeline in video & digital photography system.YCbCr is a practical approximation to color processing & perceptual uniformity.
YCbCr stands for Y ,Cb & Cr where Y is luminance component,Cb & Cr is the two chroma component.
Cb and Cr are derivations from grey on blue-yellow and red-cyan axes.

11)Y'UV:-Y'UV defines a color space in terms of Y'which is luma & two chrominance component(UV).The Y'UV color model is used in the PAL and SECAM composite color video standards .Previous black and white used only luma information.Color information where added separately vai a sub-carrier so that a black and white receiver would still be able to receive and display a color picture transmission in the receiver's native black and white format.Formulas for RGB to Y'UV and Y'UV to RGB  color conversion are following:-



\begin{bmatrix} Y' \\ U \\ V \end{bmatrix}
=
\begin{bmatrix}
  0.299   &  0.587   &  0.114 \\
 -0.14713 & -0.28886 &  0.436 \\
  0.615   & -0.51499 & -0.10001
\end{bmatrix}
\begin{bmatrix} R \\ G \\ B \end{bmatrix}

\begin{bmatrix} R \\ G \\ B \end{bmatrix}
=
\begin{bmatrix}
 1 &  0       &  1.13983 \\
 1 & -0.39465 & -0.58060 \\
 1 &  2.03211 &  0
\end{bmatrix}
\begin{bmatrix} Y' \\ U \\ V \end{bmatrix}


12)Y'CbCr:-Y'CbCr is not an absolute color space,rather it is way of encoding  RGB information.THe actual color displayed depends on the actual RGB primaries used to display the signal.It is also a color approximation to color processing  & perceptual uniformity.

13)YPbPr:-YPbPr is a color space used in video electronics,in particular in reference component video cables.YPbPr is the analog version of the YCbCr color space the two are numerically equavalent but YPbPr is designed for use in anoalog systems where YCbCr is intended for digital video.YCbCr cables are also referred to as  Yipper cables.YPbPr is commonly called as component video but this is imprecise as there are many other types of component video most of which are some form of RGB.Pb and Pr are derivations from grey on blue-yellow and red-cyan axes.Here Y stands for luminance ,Pb carries difference between blue luma and Pr carries difference between red and luma.
YPbPr is converted from the RGB components:-

Y=.2126R+.7152G+.0722B
Pb=B-Y
Pr=R-Y

14)YIQ:-YIQ is the color space used by NTSC color TV system,employed mainly in north America ,central America & Japan.It is currently in used only for low power television stations,as full power analog transmission.The YIQ system is intended to take advantage of human color response characteristic.The eye is more sensitive to the changes in orange-blue range(I) than in the purple-green range(Q)-therefore less bandwidth is required for Q than I.In the YIQ .Y represents luma information is the only component used by the black & white TV receivers.I & Q represents the chrominance information.Formulas for RGB to YUV and YUV to RGB  color conversion are following:-


R, G, B, Y \in \left[ 0, 1 \right], \quad I \in \left[-0.5957, 0.5957\right], \quad Q \in \left[-0.5226, 0.5226\right]

\begin{bmatrix} Y \\ I \\ Q \end{bmatrix}
=
\begin{bmatrix}
  0.299    &  0.587    &  0.114 \\
  0.595716 & -0.274453 & -0.321263 \\
  0.211456 & -0.522591 &  0.311135
\end{bmatrix}
\begin{bmatrix} R \\ G \\ B \end{bmatrix}

\begin{bmatrix} R \\ G \\ B \end{bmatrix}
=
\begin{bmatrix}
  1 &  0.9563 &  0.6210 \\
  1 & -0.2721 & -0.6474 \\
  1 & -1.1070 &  1.7046
\end{bmatrix}
\begin{bmatrix} Y \\ I \\ Q \end{bmatrix}


15)CIEXYZ:-CIEXYZ color space is derived from CIERGB color space .In CIEXYZ ,Y is the luminance,Z is quasi equal to the blue stimulation & X is a mix of cone response curves chosen to be non negative .  The CIE defined the standard (colorimetric) observer.The value of XYZ is determined by following formula:-




X= \int_{380}^{780} I(\lambda)\,\overline{x}(\lambda)\,d\lambda
Y= \int_{380}^{780} I(\lambda)\,\overline{y}(\lambda)\,d\lambda
Z= \int_{380}^{780} I(\lambda)\,\overline{z}(\lambda)\,d\lambda

where λ is the wavelength of the monochromatic light.

16)CIELAB:-A lab color space is a color opponent with dimention  L for lightness ,a & b for the color opponent of dimension based on non-linearly compressed  CIEXYZ color space co-ordinates.CIELAB co-ordinates based on a cube root transformation of the color data.The lightness co-relate in CIELAB is calculated using the cube root of the relative luminance.The main advantage of CIELAB is it is designed to approximate human vision.It aspires to perceptual uniformity and its component closely matches human perception of lightness .CIELAB color space is most complete color space because it describes all the color visible to the  human eye & was created to serve as a device dependent model to be used as a reference.The
three co-ordinates of CIELAB represent the lightness of the color (L*=0 yields black while L *=100 yields diffuse white ),its position between Red/Magenta & green (a* negative values indicate green while positive value indicates magenta),& its position between yellow & blue(b* ,negative value indicates blue while positive value indicates yellow).There is no simple formula for RGB and CMY conversion because these two color space are device dependent.Following are the formula for the CIEXYZ to CIELAB & CIELAB to CIEXYZ :-

Forward transformation
\begin{align}
  L^\star &= 116 f(Y/Y_n) - 16\\
  a^\star &= 500 \left[f(X/X_n) - f(Y/Y_n)\right]\\
  b^\star &= 200 \left[f(Y/Y_n) - f(Z/Z_n)\right]
\end{align}
where
f(t) = \begin{cases}
  t^{1/3} & \text{if } t > (\frac{6}{29})^3 \\
  \frac13 \left( \frac{29}{6} \right)^2 t + \frac{4}{29} & \text{otherwise}
\end{cases} 

Here Xn,Yn & Zn are the CIE XYZ tristumulus values of the reference white point .

Reverse transformation

The reverse transformation is most easily expressed using the inverse of the function f above:
\begin{align}
  Y &= Y_n f^{-1}\left(\tfrac{1}{116}\left(L^*+16\right)\right)\\
  X &=  X_n f^{-1}\left(\tfrac{1}{116}\left(L^*+16\right) + \tfrac{1}{500}a^*\right)\\
  Z &=  Z_n f^{-1}\left(\tfrac{1}{116}\left(L^*+16\right) - \tfrac{1}{200}b^*\right)\\
\end{align}
where
f^{-1}(t) = \begin{cases}
  t^3 & \text{if } t > \tfrac{6}{29} \\
3\left(\tfrac{6}{29}\right)^2\left(t - \tfrac{4}{29}\right) & \text{otherwise}
\end{cases}

17)CIELUV:-In colorimetry ,the CIE 1976(L*,u*,v*) color space commonly known by its abbreviation CIELUV .CIELUV is an Adams chromatic valence color space & is an update of CIE 1964 color space 
          Following are the formula for the CIEXYZ to CIELUV & CIELUV to CIEXYZ :-

The forward transformation


\begin{align}
L^* &= \begin{cases}
  \left(\frac{29}{3}\right)^3 Y / Y_n,&   Y / Y_n \le \left(\frac{6}{29}\right)^3 \\
  116 \left( Y / Y_n \right)^{1/3} - 16,&  Y / Y_n  >   \left(\frac{6}{29}\right)^3      
\end{cases}\\
u^* &= 13 L^*\cdot (u^\prime - u_n^\prime) \\
v^* &= 13 L^*\cdot (v^\prime - v_n^\prime)
\end{align}
the quantities u'n & v'n are the chromaticity co-ordinates of a specified white ponit & Yn is its luminance.
Equation for u' & v' are given below:-
\begin{align}
u^\prime &= \frac{4 X}{X + 15 Y + 3 Z} &= \frac{4 x}{-2 x + 12 y + 3} \\
v^\prime &= \frac{9 Y}{X + 15 Y + 3 Z} &= \frac{9 y}{-2 x + 12 y + 3}
\end{align}

The reverse transformation

The transform from (u',v') to (x,y) is:-
\begin{align}
  x &= \frac{9u^\prime}{6u^\prime - 16v^\prime + 12}\\
  y &= \frac{4v^\prime}{6u^\prime - 16v^\prime + 12}
\end{align}
the transform from CIELUV to CIEXYZ is as follows:-
\begin{align}
  u^\prime&= \frac{u^*}{13L^*} + u^\prime_n \\
  v^\prime&= \frac{v^*}{13L^*} + v^\prime_n \\
  Y &= \begin{cases}
    Y_n \cdot L^* \cdot \left(\frac{3}{29}\right)^3,& L^* \le 8 \\
    Y_n \cdot \left(\frac{L^* + 16}{116}\right)^3,& L^* > 8
  \end{cases}\\
  X &= Y \cdot \frac{9u^\prime}{4v^\prime} \\
  Z &= Y \cdot \frac{12 - 3u^\prime - 20v^\prime}{4v^\prime} \\
\end{align}
 18)CIEUVW:-The CIEUVW is based on CIE 1964 color space is based on the CIE 1960 UCS.Wyszecki invented the UVW color space in order to be able to calculate color differences without having to hold the luminance constant.He defines a lightness index W* by simplifying expression .The chromaticty component U* & V* are defined such that the white point maps to the origin .

19)TSL:-TSL (Tint,Satuartion & Light) is a color space used in face detection & based on Hue ,Saturation & Luma.The formula for the transformation RGB  to TSL is :-

T =
\begin{cases}
\frac{1}{2\pi} \arctan{\frac{r'}{g'}} + \frac{1}{4}, & \mbox{if}~g'>0 \\
\frac{1}{2\pi} \arctan{\frac{r'}{g'}} + \frac{3}{4}, & \mbox{if}~g'<0 \\
0,                                         & \mbox{if}~g'=0 \\
\end{cases}
S = \sqrt{\frac{9}{5}\left( r'^2 + g'^2 \right)}
L = 0.299R + 0.587G + 0.114B


where
r' = r - \tfrac{1}{3}
g' = g - \tfrac{1}{3}
r = \tfrac{R}{R+G+B}
g = \tfrac{G}{R+G+B}
The reverse transformation from TSL to RGB is:-
R = k \cdot r
G = k \cdot g
B = k \cdot (1-r-g)
where

r =
\begin{cases}
\frac{\sqrt{5}}{3} S, & \mbox{if}~T=0 \\
x \cdot g + \frac{1}{3}, & \mbox{if}~T \ne 0 \\
\end{cases}
g =
\begin{cases}
- \sqrt{\frac{5}{9(x^2+1)}} \cdot S, & \mbox{if}~T>\frac{1}{2} \\
\sqrt{\frac{5}{9(x^2+1)}} \cdot S, & \mbox{if}~T<\frac{1}{2} \\
0,                                         & \mbox{if}~T=0 \\
\end{cases}
k = \frac{1}{0.185r + 0.473g + 0.114}
x = - \cot ({2\pi \cdot T})

20)RG Chromaticity:-The RG chromaticity space ,two dimension of the normalized RGB color space ,a two dimention color space in which there is no intensity information.Unlike RGB  color space ,In the rg chromaticty a color is represented by the proportin of Red.,Green & blue in the color ,rather than the intensity of each Since these proportion must always  add up  to atotal of 1,we are able to read just red & green proportions of the color & can calculate blue value if necessary.Rg chromaticty contains less information than RGB & HSV color space ,It has no of useful properties for computer vision application .
Given a color(R,G,B) where R,G,B= intensity of red,green & blue ,this can be converted to color (r,g) where r,g imply the proportion red & green in the original color:
 r = \frac{R}{R+G+B}
 g = \frac{G}{R+G+B} 
the inverse transformation is not possible ,as the intensity information is lost during the coversion to rg chromaticity.

21)CIERGB:-The CIE RGB  color space is one of many RGB color spaces ,distinguished by a particular set of mono chromatic primary colors.The RGB tristimulus values for a color with a spectral power distribution I(λ) would then be given by :






R= \int_0^\infty I(\lambda)\,\overline{r}(\lambda)\,d\lambda
G= \int_0^\infty I(\lambda)\,\overline{g}(\lambda)\,d\lambda
B= \int_0^\infty I(\lambda)\,\overline{b}(\lambda)\,d\lambda0

22)Y'CH:-Y'CH is stands for luma,chroma and hue .The formula for Y'CH to RGB color space is following:-

\begin{align}
  H^\prime &= \frac{H}{60^\circ} \\
  X        &= C (1 - |H^\prime \;\bmod 2 - 1|)
\end{align}

  (R_1, G_1, B_1) =
    \begin{cases}
      (0, 0, 0) &\mbox{if } H \mbox{ is undefined} \\
      (C, X, 0) &\mbox{if } 0 \leq H^\prime < 1 \\
      (X, C, 0) &\mbox{if } 1 \leq H^\prime < 2 \\
      (0, C, X) &\mbox{if } 2 \leq H^\prime < 3 \\
      (0, X, C) &\mbox{if } 3 \leq H^\prime < 4 \\
      (X, 0, C) &\mbox{if } 4 \leq H^\prime < 5 \\
      (C, 0, X) &\mbox{if } 5 \leq H^\prime < 6
    \end{cases}
Then we can find RG, and B by adding the same amount to each component, to match luma:
\begin{align}
  &m = Y^\prime_{601} - (.30R_1 + .59G_1 + .11B_1) \\
  &(R, G, B) = (R_1 + m, G_1 + m, B_1 + m)
\end{align}

23)YCoCg:-YCoCg stands for luminance,two color components orange and green.This color space was invented to use similar encoding techniques as YCbCr,but with frames in RGB color space.Is is possible to losslessly transform from RGB to YCoCg when using 2 more bits for YCoCg representation than for RGB .E.g.  it is possible to losslessly transform a pixel from a 30-bit RGB  frame into a pixel in a 32-bit  YCoCg .This assumes that each R,G and B component will have 10 bits of information which Y' will have 10 bits and Co and Cg will each have 11 bits. Following are the formula for the RGB  to YCoCg & YCoCg to RGB :-

Forward transformation

\begin{bmatrix} Y \\ Cg \\ Co \end{bmatrix}
=
\begin{bmatrix} 1/4  &  1/2  &  1/4\\ 
                -1/4 &  1/2  & -1/4\\ 
                1/2  &  0    & -1/2\end{bmatrix}
\cdot
\begin{bmatrix} R \\ G \\ B \end{bmatrix}


The reverse transformation


\begin{bmatrix} R \\ G \\ B \end{bmatrix}
=
\begin{bmatrix} 1  &  -1  & 1\\ 
                1  &  1  &  0\\ 
                1  & -1  & -1\end{bmatrix}
\cdot
\begin{bmatrix} Y \\ Cg \\ Co \end{bmatrix}

24)AYCoCg:-It is a color space wherein each color is represented as a quad (A,Y,Co,Cg) where A represents the alpha(transparency) component,Y represents the luminance component and Co and Cg represent the two chrominance(color) component orange and green respectively.Conversion between  the ARGB and AYCoCg color spaces can be performed by using forward and reverse transformation.The alpha channel is never converted in either direction.

Forward transformation
A = A


|Y|    | 1/4   1/2    1/4|   |R|
|Co| = |  1     0     -1 | * |G|
|Cg|   |-1/2    1    -1/2|   |B|


The reverse transformation

A = A

|R|   |1   1/2   -1/2|   |Y |
|G| = |1    0     1/2| * |Co|
|B|   |1  -1/2   -1/2|   |Cg|
25)YDbDr:-YDbDr is the color space used in the SÉCAM analog terrestrial colour television broadcasting standard, which is used in France and some countries of the former Eastern Bloc. It is very close to YUV (PAL) and its related color spaces such as YIQ (NTSC), YPbPr and YCbCr.
YDbDr is composed of three components - ,  and .  is the luminance,  and  are the chrominance components, representing the red and blue color differences.Formulas for RGB to YDbDr  and YDbDr  to RGB  color conversion are following:-
Forward transformation
\begin{align}
Y   &= +0.299 R +0.587 G +0.114 B\\
D_B &= -0.450 R -0.883 G +1.333 B\\
D_R &= -1.333 R +1.116 G +0.217B\\
\begin{bmatrix} Y \\ D_B \\ D_R \end{bmatrix} &=
\begin{bmatrix} 0.299 & 0.587 & 0.114 \\ 
-0.450 & -0.883 & 1.333 \\ 
-1.333 & 1.116 & 0.217 \end{bmatrix}
\begin{bmatrix} R \\ G \\ B \end{bmatrix}\end{align}

The reverse transformation

\begin{align}
R &= Y +0.000092303716148 D_B -0.525912630661865 D_R\\
G &= Y -0.129132898890509 D_B +0.267899328207599 D_R\\
B &= Y +0.664679059978955 D_B -0.000079202543533 D_R\\
\begin{bmatrix} R \\ G \\ B \end{bmatrix} &=
\begin{bmatrix} 1 & 0.000092303716148 & -0.525912630661865 \\
1 & -0.129132898890509 & 0.267899328207599 \\
1 & 0.664679059978955 & -0.000079202543533 \end{bmatrix}
\begin{bmatrix} Y \\ D_B \\ D_R \end{bmatrix}\end{align}

Friday 22 February 2013

RGB channel Equalixzation for 8-bit & 24-bit


Today,I perform various type of histogram equalization or contrast equalization .These are performed on following type of images:-     

a) 8-bit color
b) 8-bit gs
c) 24-bit color
d) 24-bit gs

Each type of image uses following five methods:
a) b
b) g
c) r
d) rgb ( All together but channel by channel)
e) r+g+b (each separately)

So ,I get total 20 output images for 4 input images which are respectively 8-bit gray scale,8-bit color,24-bit gray scale & 24-bit color image.Output images are in above sequence. Here is the input images & output images:

Input Images


Output Images for first image which is 8-bit grayscale






Output Images for second image which is 8-bit color image

Output Images for third image which is 24-bit grayscale image


Output Images for fourth image which is 24-bit color image


Wednesday 20 February 2013

HSL/HSV/HSI Blog

Cylindrical Coordinate System:-Cylindrical co-ordinate system is a three dimensional co-ordinate system that specifies point positions by the distance from a chosen reference axis,the direction from the axis relative to a chosen reference direction & the distance from a chosen reference plane perpendicular to the axis.The latter distance is given as a positive or negative no depending on which side of reference plane faces the point.
        HSL & HSV are the two most common cylindrical co-ordinate system.HSL & HSV are developed  in 1970.They are widely used today in color pickers in image editing software,less commonly in image analysis
& computer vision.

HSV:-HSV stands for Hue,saturation & value.often also called HSB ,B for brightness. It is also called hex cone model.
HSL:- HSL stands for hue,saturation & light ,often also callled HLS.It is also called double hex cone model.

*We can calculate Chroma from RGB with the following formula :-

\begin{align}
  M &= \operatorname{max}(R, G, B) \\
  m &= \operatorname{min}(R, G, B) \\
  C &= M - m
\end{align}

*We can calculate Hue from RGB with the following formula :-

\begin{align}
  H^\prime &=
    \begin{cases}
      \mathrm{undefined},        &\mbox{if } C = 0 \\
      \frac{G - B}{C} \;\bmod 6, &\mbox{if } M = R \\
      \frac{B - R}{C} + 2,       &\mbox{if } M = G \\
      \frac{R - G}{C} + 4,       &\mbox{if } M = B
    \end{cases} \\
  H        &= 60^\circ \times H^\prime
\end{align}

*We can calculate Lightness from following formula :-

(i)In the HSI model intensity is defined as average of three components:

           I = 1/3(R+G+B)

(ii)In the HSV "hexcone" model value is defined as the largest component of color.

          V=M=max(R,G,B)
(iii)In the bi-hexcone model lightness is defined as the average of largest & smallest color component.

          L= 1/2(M+m)

(iv)Luma is the weighted average of gamma corrected R,G & B

        Y^\prime_{601} = 0.30R + 0.59G + 0.11B\,\!

* Following are the formula for the saturation for HSV,HSL & HSI:-

 \begin{align}
  S_{HSV} &=
    \begin{cases}
      0,           &\mbox{if } C = 0 \\
      \frac{C}{V}, &\mbox{otherwise}
    \end{cases} \\
  S_{HSL} &=
    \begin{cases}
      0,              &\mbox{if } C = 0 \\
      \frac{C}{1 - |2L - 1|},   &\mbox{otherwise}
    \end{cases}
\end{align}


S_{HSI} =
  \begin{cases}
    0,               &\mbox{if } C=0 \\
    1 - \frac{m}{I}, &\mbox{otherwise}
  \end{cases}


Uses of HSI,HSV & HSL:-HSI ,HSV & HSL are often used computer vision,Image analysis for feature detection & image segmentation.It is used in robot vision ,object recognition,content based image analysis & analysis of medical images.It is also used in color pickers of image editors.


HSL to RGB:-
 For converting HSL to RGB ,First of all ,we need to compute chroma:-

                                  
C =
 \begin{align}
  (1 - \left\vert 2 L - 1 \right\vert) \times S_{HSL}
 \end{align}

                                            where C is Chroma
                                            L for Lightness
                                            Shsl for saturation


Next,we find the point on one of the bottom three faces of the RGB cube which has the same hue & chroma as our color.

       \begin{align}
  H^\prime &= \frac{H}{60^\circ} \\
  X        &= C (1 - |H^\prime \;\bmod 2 - 1|)
\end{align}



  (R_1, G_1, B_1) =
    \begin{cases}
      (0, 0, 0) &\mbox{if } H \mbox{ is undefined} \\
      (C, X, 0) &\mbox{if } 0 \leq H^\prime < 1 \\
      (X, C, 0) &\mbox{if } 1 \leq H^\prime < 2 \\
      (0, C, X) &\mbox{if } 2 \leq H^\prime < 3 \\
      (0, X, C) &\mbox{if } 3 \leq H^\prime < 4 \\
      (X, 0, C) &\mbox{if } 4 \leq H^\prime < 5 \\
      (C, 0, X) &\mbox{if } 5 \leq H^\prime < 6
    \end{cases}

Finally ,we add the equal amounts of R,G & B to reach the proper value.

\begin{align}
  &m = L - \textstyle{\frac{1}{2}}C \\
  &(R, G, B) = (R_1 + m, G_1 + m, B_1 + m)
\end{align}




HSV to RGB:-

 For converting HSV to RGB ,First of all ,we need to compute chroma,by multiplying saturation by the maximum chroma for a given value.


                                             C = V \times S_{HSV}\,\!
                                            where C is Chroma
                                            V for value
                                            Shsv for saturation


Next,we find the point on one of the bottom three faces of the RGB cube which has the same hue & chroma as our color.

       \begin{align}
  H^\prime &= \frac{H}{60^\circ} \\
  X        &= C (1 - |H^\prime \;\bmod 2 - 1|)
\end{align}



  (R_1, G_1, B_1) =
    \begin{cases}
      (0, 0, 0) &\mbox{if } H \mbox{ is undefined} \\
      (C, X, 0) &\mbox{if } 0 \leq H^\prime < 1 \\
      (X, C, 0) &\mbox{if } 1 \leq H^\prime < 2 \\
      (0, C, X) &\mbox{if } 2 \leq H^\prime < 3 \\
      (0, X, C) &\mbox{if } 3 \leq H^\prime < 4 \\
      (X, 0, C) &\mbox{if } 4 \leq H^\prime < 5 \\
      (C, 0, X) &\mbox{if } 5 \leq H^\prime < 6
    \end{cases}

Finally ,we add the equal amounts of R,G & B to reach the proper value.

\begin{align}
  &m = V - C \\
  &(R, G, B) = (R_1 + m, G_1 + m, B_1 + m)
\end{align}

Luma/Chroma/Hue to RGB:-

Here we already have Hue & Chroma so we use same strategy:-

 \begin{align}
  H^\prime &= \frac{H}{60^\circ} \\
  X        &= C (1 - |H^\prime \;\bmod 2 - 1|)
\end{align}



  (R_1, G_1, B_1) =
    \begin{cases}
      (0, 0, 0) &\mbox{if } H \mbox{ is undefined} \\
      (C, X, 0) &\mbox{if } 0 \leq H^\prime < 1 \\
      (X, C, 0) &\mbox{if } 1 \leq H^\prime < 2 \\
      (0, C, X) &\mbox{if } 2 \leq H^\prime < 3 \\
      (0, X, C) &\mbox{if } 3 \leq H^\prime < 4 \\
      (X, 0, C) &\mbox{if } 4 \leq H^\prime < 5 \\
      (C, 0, X) &\mbox{if } 5 \leq H^\prime < 6
    \end{cases}

Finally ,we add the equal amounts of R,G & B to reach the proper value.

\begin{align}
  &m = Y^\prime_{601} - (.30R_1 + .59G_1 + .11B_1) \\
  &(R, G, B) = (R_1 + m, G_1 + m, B_1 + m)
\end{align}