Color Representation and Quantization

Color Representation and Quantization

Lecture 2 Color Representation and Quantization Yao Wang Polytechnic Institute of NYU, Brooklyn, NY 11201 With contributions from Zhu Liu, AT&T Labs Most figures from Gonzalez/Woods: Digital Image Processing Lecture Outline • Color perception and representation – Human ppperception of color – Trichromatic color mixing theory – Different color representations • ClColor image dildisplay – True color image – Indexed color images • Pseudo color images • Quantization Fundamentals – Uniform, non-uniform, dithering • Color quantization Yao Wang, NYU-Poly EL5123: color and quantization 2 Light is part of the EM wave Yao Wang, NYU-Poly EL5123: color and quantization 3 Illuminating and Reflecting Light • Illuminating sources (primary light): – emit light (e.g. the sun, light bulb, TV monitors) – perceived color depends on the emitted freq. – follow additive rule • R+G+B=White • Reflecting sources (secondary light): – reflect an incoming light (e.g. the color dye, matte surface, cloth) – perceived color depends on reflected freq (=emitted freq-absorbed freq.) – follow subtractive rule • R+G+B=Black Yao Wang, NYU-Poly EL5123: color and quantization 4 Eye vs. Camera Camera components Eye components Lens Lens, cornea Shutter Iris, pupil Film RtiRetina Cable to transfer images Optic nerve send the info to the brain Yao Wang, NYU-Poly EL5123: color and quantization 5 Human Perception of Color • Retina contains receptors – Cones • Day vision, can perceive color tone • Red, green, and blue cones – Rods • Night vision, perceive brightness only • Color sensation – Luminance (brightness) – Chrominance From http://www.macula.org/anatomy/ • Hue (color tone) retinaframe.html • Saturation (color purity) Yao Wang, NYU-Poly EL5123: color and quantization 6 Frequency Responses of Cones and the Luminous Efficiency Function Ci C()ai ()d, i r, g,b, y Yao Wang, NYU-Poly EL5123: color and quantization 7 Tri-chromatic Color Mixing • Tri-chromatic color mixing theory – Any color can be obtained by mixing three primary colors with a right proportion • Primary colors for illuminating sources: – Red, Green, Blue (RGB) – Color monitor works by exciting red, green, blue phosphors using separate electronic guns – follow additive rule: R+G+B=White • Primary colors for reflecting sources (also known as secondary colors): – Cyan, Magenta, Yellow (CMY) – Color printer works by using cyan, magenta, yellow and black (CMYK) dyes – follow subtractive rule: R+G+B=Black Yao Wang, NYU-Poly EL5123: color and quantization 8 RGB vs CMY Magenta = Red + Blue Magenta = White - Green Cyan = Blue + Green Cyan = White - Red Yellow = Green + Red Yellow = White - Blue Yao Wang, NYU-Poly EL5123: color and quantization 9 Demo with Photoshop • Show the mixing using RGB, CMY colors – Using the “window>color” tool (in “show color”, click on right arrow button to choose different color sliders) (can also click F6) – Sample image: RGBadd, CMYsub • Use the dropper tool, click on different part of the image, see the color information in “show color” • Select different color coordinates Yao Wang, NYU-Poly EL5123: color and quantization 10 A Color Image Red Green Blue Yao Wang, NYU-Poly EL5123: color and quantization 11 Tristimuls Values • Tristimulus value – The amounts of red , green, and blue needed to form any particular color are called the tristimulus values, denoted by X, Y, and Z. – Trichromatic coefficients X Y Z x , y , z . X Y Z X Y Z X Y Z – Only two chromaticity coefficients are necessary to specify the chrominance of a light. x y z 1 Yao Wang, NYU-Poly EL5123: color and quantization 12 CIE Chromaticity Diagram CIE (Commission Internationale de L’Eclairage, International Commission on Illumination ) system of color specification x axis: red y axis: green e.g. GREEN: x: 25%, y: 62%, z: 13%. Colors on the boundary: spectrum colors , highest saturation Yao Wang, NYU-Poly EL5123: color and quantization 13 Color Gamut A line segment indicates all colors that can be produced by mixing two colors corresponding to the end points of the line. EhEach co lor mo dlhdifftdel has different co lor range (or gamu t)RGBdlht). RGB model has a larger gamu tthCMYt than CMY. Therefore, some color that appears on a screen may not be printable and is replaced by the closest color in the CMY gamut. Yao Wang, NYU-Poly EL5123: color and quantization 14 Demo with Photoshop • Using photoshop to show how to replace a out of gamut color by its closest in-gamut color. • Choose “window->show color”, choose the “CMYK slider” • While having “RGBadd” in display, use Eyedropper tool to click on “red”, “green” or “blue”, you will see a warning about out of gamut color, and the suggested replacement color • Also open “gamut” image, click on out of gamut region Yao Wang, NYU-Poly EL5123: color and quantization 15 Three Attributes of Color • Luminance (brightness) • Chrominance – Hue (color tone) and Saturation (color purity) • Represented by a “color cone” or “color solid” θ Yao Wang, NYU-Poly EL5123: color and quantization 16 Color Models • Specify three primary or secondary colors – Red, Green, Blue. – Cyan, Magenta, Yellow. • Specify the luminance and chrominance – HSB or HSI (Hue, saturation, and brightness or intensity) – YIQQ( (used in NTSC color TV) – YCbCr (used in digital color TV) • Amplitude specification: – 8 bits per color component, or 24 bits per pixel – Total of 16 million colors – A 1kx1k true RGB color requires 3 MB memory Yao Wang, NYU-Poly EL5123: color and quantization 17 RGB Color Model RGB 24-bit color cube Yao Wang, NYU-Poly EL5123: color and quantization 18 CMY and CMYK Color Models • Conversion between RGB and CMY (assuming maximum value is 1) C 1 R R 1 C M 1 G, G 1 M . Y 1 B B 1 Y • Equal amounts of Cyan, Magenta, and Yellow produce black. In pppractice, this produce mudd y-looking black. To produce true black, a fourth color, black is added, which is CMYK color model. Yao Wang, NYU-Poly EL5123: color and quantization 19 HSI Color Model •Huerepresents dominant color as perceived by an observer. It is an attribute associated with the dominant wavelength. • Saturation refers to the relative purity or the amount of white light mixed with a hue. The pure spectrum colors are fully saturated. Pink and lavender are less saturated. • Intensity reflects the brightness. Yao Wang, NYU-Poly EL5123: color and quantization 20 Conversion Between RGB and HSI • Converting color from RGB to HSI 1 (R G) (R B) if B G 1 2 H with cos 360 if B G 1 2 2 (R G) (R B)(G B) 3 S 1 [min(R,G, B)] (R G B) 1 I [R G B] 3 • Converting color from HSI to RGB RG sector (0≤H<120) GB sector (120≤H<240) BR sector (240≤H<360) B I(1 S) R I(1 S) G I(1 S) S cos(H 120) S cos H G I 1 S cos(H 240) R I 1 B I 1 cos(60 H ) cos(60 (H 120)) cos(60 (H 240)) G 1 (R B) B 1 (R G) R 1 (G B) Yao Wang, NYU-Poly EL5123: color and quantization 21 YIQ Color Coordinate System • YIQ is defined by the National Television System Committee (NTSC) – Y describes the luminance, I and Q describes the chrominance. – A more compact representation of the color. – YUV plays similar role in PAL and SECAM. • Conversion between RGB and YIQ Y 0.299 0.587 0.114 R R 1.0 0.956 0.621 Y I 0.596 0.274 0.322G, G 1.0 0.272 0.649 I Q 0.211 0.55323 0.311 B B 1.0 1.106 1.703 Q Yao Wang, NYU-Poly EL5123: color and quantization 22 YUV/YCbCr Coordinate • YUV is the color coordinate used in color TV in PAL system, somewhat different from YIQ. • YCbCr is the digital equivalent of YUV, used for digital TV, with 8 bit for each component, in range of 0-255 Yao Wang, NYU-Poly EL5123: color and quantization 23 Demo with Photoshop • Show the RGB, CMY, HSI models – Using the “window>show color” tool (in “show color”, click on right arrow button to choose different color sliders) – Sample image: RGBadd, CMYsub, fruit • Use the dropper tool, click on different part of the image, see the color information in “show color” • Select different color coordinates Yao Wang, NYU-Poly EL5123: color and quantization 24 Criteria for Choosing the Color Coordinates • The type of representation depends on the applications at hand. – For display or printing, choose primary colors so that more colors can be produced. E. g. RGB for displaying and CMY for printing. – For analytical analysis of color differences, HSI is more suitable. – For transmission or storage, choose a less redundant representation, eg. YIQ or YUV or YCbCr Yao Wang, NYU-Poly EL5123: color and quantization 25 Comparison of Different Color Spaces Yao Wang, NYU-Poly EL5123: color and quantization 26 Pseudo Color Display • Intensity slicing: Display different gray levels as different colors – Can be useful to visualize medical / scientific / vegetation imagery • E.g. if one is interested in features with a certain intensity range or several intensity ranges • Frequency slicing: Decomposing an image into different frequency components and represent them using different colors. Yao Wang, NYU-Poly EL5123: color and quantization 27 Intensity Slicing Color C4 C3 C2 C1 f0 =0 f1 f2 f3 f4 Gray level Pixels with gray -scale (intensity) value in the range of ( f i-1 , fi) are rendered with color Ci Yao Wang, NYU-Poly EL5123: color and quantization 28 Example Yao Wang, NYU-Poly EL5123: color and quantization 29 Another Example Yao Wang, NYU-Poly EL5123: color and quantization 30 Pseudo Color Display of Multiple Images • Display multi-sensor images as a single color image – Multi-sensor images: e.g.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    68 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us