CS654: Digital Image Analysis
In this lecture series, the fundamentals of color image processing and color models are explored. Topics covered include the conversion of RGB to HSI models, intensity and saturation components, and techniques for processing color images. The lectures delve into the intricacies of color representation, RGB primaries, and the calculation of hue values. Various images and diagrams aid in understanding the concepts discussed.
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
CS654: Digital Image Analysis Lecture 30: Color Model Conversion
Recap of Lecture 29 Color image processing Fundamentals of colors Primary and secondary colors (light and pigment) Color models
Outline of Lecture 30 HSI Model Conversion from HIS RGB, RGB HIS Pseudo color image processing Application Image processing techniques on color images
Images: Gonzalez & Woods, 3rd edition Color Models
Images: Gonzalez & Woods, 3rd edition The HSI Color Models
Color model conversion Intensity (I) Saturation (S)
Color model conversion 120 60
HSI to RGB Conversion HIS Color triangle HIS Color solid
HSI model color representation RGB primaries ? ? ? ? = ? = ? = ? + ? + ? ? + ? + ? ? + ? + ? Where, ?,?,? [0,1] Also and ?,?,? [0,1] ? + ? + ? = 1 For any ?,?,? value the intensity component (?) is given by ? =? ?(? + ? + ?)
Calculation of Hue (H) 1 3,1 ?;?0=? 3,1 Let, ? = ? = ?,?,? 3 ?0=? ?;?0=? ? ?????? has ?0 ?0 ?????? has ?0 ?0 Line ????separates the ?0> ?0, region from the ?0< ?0 region. RG ??? ??? =1 3;??? ???? =2 ? ?,?,? 3
Calculation of Hue 0 ? 180 ? ? . ?? ? = ? ? ?? ? cos? Where, ?= Hue 20.5 2 2 ? 1 + ? 1 + ? 1 ? ? = 3 3 3 ?.? ? ??+ ??+ ?? ? ? + ? + ?? ? ? + ? + ?? ? ? = ?.? ?? ?? ? =
Calculation of Hue 0 ? 180 ? ? . ?? ? = 2 3 ? 1 +1 ? 1 +1 ? 1 3 3 3 3 3 2? ? ? 3(? + ? + ?) = ? ? ? ? + (? ?) ? = cos ? ? ??+ (? ?)(? ?)?.? If ??> ?? then ? = ??? ?
Calculation of Saturation (S) ? 1 3 ? ? =|??| |?? | =|??| |??|= ?? |??| |??| ? ? 1 3 ? = 1 3? ? = (? ??) ? = 3 ?
Calculation of S In the RG sector ?0= min(?0,?0,?0) ? = ? ???(??,??,??) ? ? = ? ? + ? + ?[??? ?,?,? ] RG
The HSI Color Models Converting colors from RGB to HSI if B G = H 360 if B G 1 + [( ) ( )] R G R B 2 = 1 cos + 2 / 1 2 [( ) ( )( )] R G R B G B 3 G = 1 [min( , , )] S R G B + + ( ) R B 1 = + + ( ) I R G B 3
Converting colors from HSI to RGB Input: HSI values within the range 0,1 Output: Corresponding RGB values in the same range RG
Saturation calculation: RG region ? =? We know that ? = 1 3? ?(? ?) A plane that contains ? and is perpendicular to the red axis Value of ? is the projection of ? onto the red axis
Saturation calculation: RG region From similar triangles, ???? ??? =? ? = 1 ?; ? ? = |????| ?? cos ? + |???| ? =|???| |????|+ ?? |????|cos ? =1 ?? |????|cos ? 3+ ?
Saturation calculation: RG region ? =1 ?? |????|cos ? 3+ ?? = ?|?? | Angle formed at ? by line segments ???? and ??? is 60 ??? = ?? cos(60 ?) ?? = ???/cos 60 ? ? =1 ? ??? ? =? ???? ? ??? ?? ? 3+ |????|cos 60 ? cos ? ? + ?
HSI to RGB: RG Sector H 0 120 120 cos S H = = + = + 1 ( I ) 3 ( ) G I R B B S 1 R I cos( 60 ) H
HSI to RGB: GB Sector H 120 240 = H 120 H 120 cos S H = 1 ( I ) = + R S = + 3 ( ) 1 B I R G G I cos( 60 ) H
HSI to RGB: BR Sector H 240 360 = H 240 H 120 cos S H = = + = + 1 ( I ) G S 3 ( ) 1 R I G B B I cos( 60 ) H
The HSI Color Models RGB H H S S I RGB I
Pseudocolor Image Processing False color processing Assigning colors to gray values based on a specified criterion. Human visualization and interpretation of gray-scale events in an image or sequence of images.
Pseudocolor: example A pseudocolor MRI of a knee created using three different grayscale scans A grayscale MRI of a knee
Basic of Full Color Image Processing Let c represent an arbitrary vector in RGB color space c R R = = c c G G c B B For an image of size M*N, ( , ) ( , ) c x y R x y R = = ( , ) ( , ) ( , ) c x y c x y G x y G ( , ) ( , ) c x y B x y B
Basic of Full-Color Image Processing Major categories of full-color Image processing: Per-color-component processing Vector-based processing
Color Transformation Processing the components of a color image within the context of a single color model. ) y i = ( , ) ( , g ( i x y T f x ) = 2 , 1 = ,2 , , , ,..., s T r r r n 1 i n Color components of g Color components of f Color mapping functions
Color Transformation: Example CMYK Some difficulty in interpreting the HUE: RGB Discontinuity where 0 and 360 meet. Hue is undefined for a saturation 0 HSI
Color Transformation: Modify the Intensity = s r = 3 , 2 , 1 = s kr i = ( , ) ( , ) g x y kf x y 1 1 r i i = s = + 3 , 2 , 1 = 1 ( ) s kr k i 2 2 i i = s kr 3 3
Tone and Color Correction The tonal range of an image, also called its key-type, refers to its general distribution of color intensities. High-key images: Most of the information is concentrated at high intensities. Low-key images: Most of the information is concentrated at low intensities.
Tonal correction: Example Middle-key Image
Tonal correction: Example High-key Image
Tonal correction: Example Low-key Image
Color correction The proportion of any color can be increased by decreasing the amount of the opposite (or complementary) color in the image or by raising the proportion of the two immediately adjacent colors or decreasing the percentage of the two colors adjacent to the complement. Magenta Removing Red and Blue Adding Green
Histogram Processing Histogram Equalizing the Intensity Saturation Adjustment