0% found this document useful (0 votes)
31 views

Chapt 04

Uploaded by

Meseret Abiy
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views

Chapt 04

Uploaded by

Meseret Abiy
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 39

Chapter 4

Color in Image and Video

1
Color in image and video
 Color in image is ubiquitous on the web and
in multimedia productions.
 The latest html versions standards
attempts to address this issue by
specifying color In terms of a standard
“SRGB”.

2
Light and Spectra
 In 1672, Isaac Newton
discovered that white
light could be split into
many colors by a prism.
 The colors produced
by light passing
through prism are
arranged in precise
array or spectrum.
 The colors spectral
signature is identified
by its wavelength.
3
Light
Light is fundamental for color vision
Unless there is a source of light, there is nothing to see!
What do we see?
We do not see objects, but the light that has been
reflected by or transmitted through the objects

4
Light and EM waves
Light is an electromagnetic wave and that its
color is characterized by the wavelength of the
wave.
If its wavelength is comprised between 400 and
700 nm (visible spectrum),
the wave can be detected by the human eye and is
called monochromatic light

5
Light and EM waves
 Most light sources produce contributions over
many wavelengths humans can`t detect all light.
 We measure visible light using a device called a
SpectroPhotoMeter
 Just contributions that fall In the visible
wavelength
 Shortwavelength produce a blue sensation and
 Medium wavelength produce a green
 Long wavelength produce a red one

6
What is color?
 It is an attribute of objects (like texture, shape,
smoothness, etc.)
 It depends on:

 1) spectral characteristics of the light source(s) (e.g.,


sunlight) illuminating the objects (relative spectral
power distribution(s) SPD)
 2) spectral properties of objects (reflectance)

 3) spectral characteristics of the sensors of the


imaging device (e.g., the human eye or a digital
camera)
7
Primary and Secondary
Colors
 Due to the different absorption curves of the
cones, colors are seen as variable combinations of
the so-called primary colors: red, green, and blue
 Their wavelengths were standardized by the CIE
in 1931: red=700 nm, green=546.1 nm, and
blue=435.8 nm
 The primary colors can be added to produce the
secondary colors of light, magenta (R+B), cyan
(G+B), and yellow (R+G)

8
Color in Images and Video
Basics of Color
 Light and Spectra
 Visible light is an electromagnetic wave in the 400 nm -
700 nm range.

 Most light we see is not one wavelength, it's a


combination of many wavelengths.

9
The color of objects
 Here we consider the color of an object
illuminated by white light.
 Color is produced by the absorption of selected
wavelengths of light by an object.
 Objects can be thought of as absorbing all colors
except the colors of their appearance which are
reflected back.
 A blue object illuminated by white light absorbs
most of the wavelengths except those
corresponding to blue light.
 These blue wavelengths are reflected by the
object.
10
The Color of The Objects
 Fig shows White
light composed of
all wavelengths of
visible light
incident on a pure
blue object.
 Only blue light is
reflected from the
surface.

11
Human Vision
 Eye works like a Camera
 With the lens focusing on image onto the retina (upside-
down and left-right reversed)
 Our perception of color arises from the composition of
light - the energy spectrum of photons - which enter the
eye.
 The retina on the inner surface of the back of the eye
contains photosensitive cells.
 These cells contain pigments which absorb visible light.
 Retina consists of an array of Rods and three kinds of
Cones do named b/c of their shape
 The rod come into play when light levels are low and
produces an image in shades of gray(“at night all cats are
gray!”
 For higher light levels the cones each produce a signal.
12
Human Vision
 b/c of their differing pigments the three
kinds of cones are most sensitive to red(R),
green (G), and blue (B) light.
 Higher light levels result in more neurons
firing ,but just what happens in the brain
further down the pipeline is the subject of
debate.
 However, it seems likely that the brain
makes use of differences R-G,G-B and B-R
as well as combining all of R,G and B into a
high-light level a chromatic channel.
13
Human Vision

14
Basics of Color (…Contd)
 The Human Retina
 The eye functions on the same principle as a camera
 Each neuron is either a rod or a cone.
 The rods contain the elements that are sensitive to light intensities.
Rods are not sensitive to color.
 Cones come in 3 types: red, green and blue. Each responds differently
to various frequencies of light. The following figure shows the spectral-
response functions of the cones and the luminous-efficiency function of
the human eye

15
Cones and Color
 The cones provide humans with vision during the daylight and
are believed to be separated into three types, where each
type is more sensitive to a particular wavelength
 The color signal to the brain comes from the response of
the 3 cones to the spectra being observed. That is, the
signal consists of 3 numbers:

where E is the light and S is the sensitivity function

16
Color Composition
 A color can be specified as the sum of three colors. So
colors form a 3 dimensional vector space.
 The following figure shows the amounts of three primaries

needed to match all the wavelengths of the visible spectrum.

17
Color Spaces
 Color space specifies how color information is
represented. It is also called color model.
 Any color could be described in a three
dimensional graph, called a color space.
 Mathematically the axis can be tilted or moved in
different directions to change the way the space
is described, without changing the actual colors.
 The values along an axis can be linear or non-
linear.
 This gives a variety of ways to describe colors
that have an impact on the way we process a color
image.
18
Color Models
 The purpose of a color model
 (or color space or color system) is to facilitate the
specification of colors in some standard way
 A color model provides a coordinate system and a
subspace in it where each color is represented by a
single point

19
Color Models
There are different ways of representing
color. Some of these are:
 RGB color space
 YUV color space
 YIQ color space
 CMY/CMYK color space
 CIE color space
 HSV color space
 HSL color space
 YCbCr color space
20
Color Models for Images
RGB Additive Model CMY Subtractive Model
 CRT displays have three phosphors  Cyan, Magenta, and Yellow
(RGB) which produce a combination (CMY) are complementary
of wavelengths when excited with colors of RGB.
electrons  CMY model is mostly used in
 A color image is a 2-D array of printing devices where the
(R,G,B) integer triplets. These color pigments on the paper
triplets encode how much the absorb certain colors (e.g., no
corresponding phosphor should be red light is reflected from
excited in devices such as a cyan ink).
monitor.

Blue Yellow Red


Cyan
Black(1,1,1)
Magenta White(1,1,1) Green

Magenta
Black(0,0,0) Green White(0,0,0)

Cyan Blue
Red Yellow
21
RGB Additive Model
 Red-Green-Blue
 • Most commonly known color space
 – used (internally) in every monitor,TV,Camera
and Scanner
 – additive

22
The RGB Color Model
If R,G, and B are represented with 8 bits (24-bit RGB
Image), the total number of colors is (28)3 =16,777,216

23
CRT Displays
 CRT displays have three
phosphors (RGB) which
produce a combination
of wavelengths when
excited with electrons.
 The gamut of colors is
all colors that can be
reproduced using the
three Primaries.
 The gamut of a color
monitor is smaller than
that of color models,
E.g. CIE(LAB) Model
24
CMY Subtractive Model
 Cyan-Magenta-Yellow

 • Used internally in color


printers and other peripheral
devices
 • Substractive

 • Complementary to RGB:

 •C=1-R

 •M=1-G

 •Y=1-B

 • Also CMYK (blacK)

 – mostly for printer use

25
CMYK
 K is for blacK
 Save on color inks, by using black ink preferably
 is used in color printing (e.g., to produce darker black than simply mixing CMY),
 K = min(C,M,Y)
 C = C-K
 M = M-K
 Y = Y-K
 Colors on self-luminous devices, such as televisions and computer monitors, are
produced by adding the three RGB primary colors in different proportions.
 However, color reproduction media, such as printed matter and paintings, produce
colors by absorbing some wavelengths and reflecting others.
 The three RGB primary colors, when mixed, produce white, but the three CMY
primary colors produce black when they are mixed together.
 Since actual inks will not produce pure colors, black (K) is included as a separate
color, and the model is called CMYK.
 With the CMYK model, the range of reproducible colors is narrower than with RGB,
so when RGB data is converted to CMYK data, the colors seem dirtier.
26
Conversion between RGB and CMY

 E.g., convert White from (1, 1, 1) in RGB to


(0, 0, 0) in CMY
 C=1-R
 M=1-G
 Y=1-B

27
Color Models for Video YIQ Model
YUV Model  Although U and V nicely define the
 Established in 1982 to build digital video standard color differences, they do not align
 Works in PAL (50 fields/sec) or NTSC (60 fields/sec) with the desired human perceptual
 The YUV color space is commonly used in European television. color sensitivities. Hence, I and Q are
 Human perception is more sensitive to luminance used instead.
(brightness) than chrominance (color). Therefore,
instead of separating colors, one can separate the
brightness info. from the color info.

 I = 0.74(R - Y) - 0.27(B - Y) =
0.596R - 0.275G - 0.321B
 Q = 0.48(R - Y) + 0.41(B - Y) =
 0.212R - 0.523G + 0.311B
 Y is luminance  YIQ is used in NTSC color TV
 Y = 0.299R + 0.587G + 0.114B broadcasting, it is downward
 Chrominance is defined as the difference between a compatible with B/W TV where only Y
color and a reference white at the same luminance. It
can be represented by U and V -- the color is used.
differences.  The YIQ color space is commonly used
 U=B-Y in North American television systems.
 V=R-Y  I is orange-Blue axis, Q is the purple-
 Eye is most sensitive to Y. Therefore, any error in the
resolution of the luminance (Y) is more important than
green axis.
the chrominance (U,V) values.  Eye is most sensitive to Y, next to I,
 In PAL, 5 (or 5.5) MHz is allocated to Y, 1.3 MHz to U next to Q. In NTSC broadcast TV, 4.2
and V. MHz is allocated to Y, 1.5 MHz to I,
 CD-I and DVI also use the YUV model 0.55 MHz to Q.
28
YUV color model and Cubes

29
Color Models for Video (…Contd)
YCbCr Color Model
 The YCbCr model is closely related to the YUV, but with the coordinates
shifted to allow all positive valued coefficients. it is a scaled and shifted
YUV.
 C = ((B - Y)/ 2) + 0.5
b

 Cr = ((R - Y) / 1.6) + 0.5


 The chrominance values in YCbCr are always in the range of 0 to 1.
 Y-Luma component
 Y = + 0.299 * R + 0.587 * G + 0.114 * B
 Cb = 128 - 0.168736 * R - 0.331264 * G + 0.5 * B
 Cr = 128 + 0.5 * R - 0.418688 * G - 0.081312 * B

 During development and testing of JPEG it became apparent that


chrominance sub sampling in this space allowed a much better
compression than simply compressing RGB or CYM.
 Sub sampling means that only one half or one quarter as much detail
is retained for the color as for the brightness.
 YC C is used in JPEG and MPEG.
b r

30
CIE
 In 1931, the CIE (Commite Internationale de E.clairage)
developed a color model based on human perception.
 They are based on the human eyes.
 response to red green and blue colors, and are designed to
accurately represent human color perception.
 The CIE is a device-independent color model and because of
this it is used as a standard for other colors to compare with.
 Device-independent means color can be reproduced faithfully
on any type of device, such as scanners, monitors, and
printers (color quality does not vary depending on the device).
 There are different versions of CIE color model. The most
commonly used are:
 CIE XYZ color model
 CIE L*a*b color model
31
CIE XYZ
 CIE XYZ color model defines three
primaries called X, Y, and Z that can be
combined to match any color humans see.
 This relates to color perception of human
eye.
 The Y primary is defined to match the
luminous efficiency of human eye.
 X and Z are obtained based on experiment
involving human observers.

32
CIE XYZ
 Edges represent pure
colors
 Every color could be
assigned a particular
point on the coordinate
plane
 The spectral purity of
colors decreases as you
move from the edges to
the center of the diagram
 Brightness is not taken
into consideration in this
model

33
CIE Lab Color Model
 A refined CIE model,
named CIE L*a*b is
introduced in 1976
 It is an improvement of
CIE XYZ color model
 L. represents Luminance
 a . ranges from green to
red
 b . ranges from blue to
yellow, a & b represents
chrominance
 Used by Photoshop

34
HSL Color Space
 HSL stands for Hue Saturation Lightness.
 H-represents hue (color)
 S-represents saturation. It goes from fully
saturated color to equivalent gray.
 The HSL color space stands for Hue, Saturation,
Lightness (also luminance or uminosity).
 HSL is drawn as a double cone or double hexcone.
 The two apexes of the HSL double hexcone
correspond to black and white.
 The angular parameter corresponds to hue,
distance from the axis corresponds to saturation,
and distance along the black white axis
corresponds to lightness.
35
HSL Color Space picture

36
HSV Color Space (also called
HSB)
 Stands for Hue
Saturation Value.
 H-represents color
type (red, blue,
yellow). It ranges from
0-360 degrees.
 Saturation-the
vibrancy of color. It
ranges from 0-100%.
 Value-brightness of
color. It ranges from
0-100%.
37
The color space choice
 In August 1991, the International Group 4 color fax Committee decided to
assume YCbCr would be the standard as they continued their studies.
 They noted that YCbCr was mandatory for compatibility with business image
systems such as desktop publishing.
 For professional graphics, it was mandatory along with CIELAB for
calibration.
 At the high end of publishing, many color spaces had to be supported,
including YCbCr.
 In fact, YCbCr was the most widely used color space in all areas.
 By the November 1992 Group 4 color fax meeting in Tokyo, CIELAB 1976
was selected as the primary color space, with YCbCr as one of several
secondary options.
 Some of the people involved argue that the particular meeting was
dominated by people with special interests, and don't believe that decision
will stand.
 If CIELAB becomes the fax standard, it would logically be our choice.
 However, YCbCr is much more widely used, and preferred by many technical
experts.
 Beside the RGB representation, YIQ and YUV are the two commonly used in
video.
38
Summary: Color
 Color images are encoded as triplets of values.
 RGB is an additive color model that is used for light-emitting devices,
e.g., CRT displays. CMY is a subtractive model that is used often for
printers
 Three common systems of encoding in video are RGB, YIQ, and
YcrCb(YUV).
 Besides the hardware-oriented color models (i.e., RGB, CMY, YIQ, YUV),
HSB (Hue, Saturation, and Brightness, e.g., used in Photoshop) and HLS
(Hue, Lightness, and Saturation) are also commonly used.
 Sometimes, an alternative CMYK model (K stands for Black) is used in
color printing (e.g., to produce darker black than simply mixing CMY).
K := min (C, M, Y); C := C – K; M := M – K; Y := Y - K.
 Two common color models in imaging are RGB and CMY, two common
color models in video are YUV and YIQ.
 YUV uses properties of the human eye to prioritize information. Y is the
black and white (luminance) image, U and V are the color difference
(chrominance) images. YIQ uses similar idea.
39

You might also like