Вы находитесь на странице: 1из 80

Digital Image Processing

CSC331
Color Image Processing

Todays lecture

Color image processing


Primary and secondary colors
Color characteristics
Chromaticity diagram and its use
Color models
RGB color model

Color Fundamentals
The human visual system can distinguish hundreds
of thousands of different color shades and
intensities, but only around 100 shades of grey.
Therefore, in an image, a great deal of extra
information may be contained in the color, and this
extra information can then be used to simplify image
analysis, e.g. object identification and extraction
based on color.
When color is available, it gives much more
information about an image than intensity alone.
Color is very useful for recognition of objects in an
image both for humans and computers.

Types of color renderings


True-color or full color
False-color image
Pseudo color image

Types of color renderings


True-color or full color
An image is called a "true-color"
image when it offers a natural color
rendition, or when it comes close to
it.
This means that the colors of an
object in an image appear to a
human observer the same way as if
this observer were to directly view
the object:
a blue sky blue, green plants and so on

Types of color renderings..


False-color image
Sacrifices natural color rendition in order
to ease the detection of features that
are not readily discernible otherwise
for example the use of near infrared for
the detection of vegetation in satellite
images

Types of color renderings..


Pseudo color image
Is derived from a grayscale image by mapping each
intensity value to a color according to a table or
function. Pseudo color is typically used when a single
channel of data is available (e.g. temperature,
elevation, soil composition, tissue type, and so on), in
contrast to false color which is commonly used to
display three channels of data.

A typical example for the use of pseudo color is


thermography ("thermal imaging"), where
infrared cameras feature only one spectral band
and show their grayscale images in pseudo color.
8

10

Color Spectrum
white light with a prism (1666, Newton)

11

How do we perceive color ?


we see an object because light falls on the
object or the object is illuminated by certain
source of light, the light gets reflected from the
object, it reaches our eye, then only we can see
the object.
Similarly, we can perceive the color depending
upon the nature of the light which is reflected
by the object surface.
The nature of the light through the spectrum in
the visible range gives different colors so we
are able to observe it.
12

How do we perceive color ..


The actual color perceived by a human of an
object depends on both the color of the
illumination and the reflectivity of the object, as
well as the sensitivity of human perception.
Objects appear to be different colors because
they absorb and reflect different colors of light.
A blue object, for example, reflects blue light
while absorbing other colors.
Grey objects or grey images reflect and absorb
all frequencies of light about equally, so they
do not appear colored.
13

Physical
Background
Visible light: a narrow band of
electromagnetic radiation
380nm (blue) 780nm
(red)
Wavelength: Each physically
distinct colour corresponds to
at least one wavelength in this
band.
Pure Colours: Pure or
monochromatic colours do not
exist in nature.

Problems with Processing Colour


Images
When processing colour images, the
problem is that a camera are heavily
dependent on the lighting conditions.

Lighting conditions
The lighting conditions of the scene
have a large effect on the colours
recorded.

Image taken lit by a


flash.

Image taken lit by a


tungsten lamp.

The following four images of the same scene


were acquired under different lighting conditions:

Quality of light
Radiance
Radiance is the total amount of energy which comes
out of a light source and is measured in the form of in
units of watts (symbol:W)

Luminance
luminance, it is the amount of energy that is
perceived by an observer.
Luminance measured in units of lumens(symbol:lm)

Brightness.
it is actually a subjective measure and it is practically
not possible to measure the amount of brightness.

18

Dealing with Lighting


Changes
Knowing just the RGB values is not enough
to know everything about the image.
The R, G and B primaries used by different
devices are usually different.

For scientific work, the camera and lighting


should be calibrated.
For multimedia applications, this is more
difficult to organise:
Algorithms exist for estimating the illumination
colour.

Primary colors
Color is sensed by the eye using three kinds of cones
cells, each sensitive primarily to red, green or blue,
though there is significant overlap.
We refer to red, green and blue as the primary colors,
and denote to set as RGB.
International Commission
on Illumination(CIE)
red = 740 nm
green = 646.1nm
blue = 555.8nm

Color Fundamentals
Secondary colors:
magenta (red +
blue), cyan (green +
blue), and yellow
(red + green)

But when we perceive a color, we do


not really think about how much of
red component, blue component and
green component that particular
color has.
But the way we try to distinguish the
color is based on the characteristics
which are called, hue, saturation,
brightness (intensity)
22

Hue
It represents the dominant wavelength in a mixture of colors. So, when
you look at a secondary color which is a mixture of different primary
colors, there will be one wavelength which is a dominant one, dominant
wavelength and the overall sensation of that particular secondary color
will be determined by the dominant wavelength.
Wavelength of the pure colour observed in the signal.
Distinguishes red, yellow, green, etc.
More the 400 hues can be seen by the human eye.

Saturation (degree of dilution)


Whenever we talk about a particular color red, there may be various
shades of red. So, the saturation indicates the purity of that particular
color or in other words, what is the amount of light which has been mixed
to that particular color to make it a diluted one.
Inverse of the quantity of white present in the signal. A pure colour has 100%
saturation, the white and grey have 0% saturation.
Distinguishes red from pink, marine blue from royal blue, etc.
About 20 saturation levels are visible per hue.

Brightness
Brightness achromatic notion of intensity.
Amount of light emitted.
Distinguishes the greylevels.
The human eye perceives about 100 levels

23

we normally perceive the color in the


form of hue, saturation and
brightness
In hardware, it is represented as red
green and blue

24

Chromaticity Diagram
The amounts of red, green, and blue needed to form
any particular color are called tristimulus values (X, Y
and Z). These represent three dimensional
coordinates of any perceived color.
The tristimulus values can be normalized to give
chromatic coefficients, x (red), y (green) and z (blue).
X
x
X Y Z

Y
y
X Y Z

Z
X Y Z

x y z 1
Note that because of normalization

International Commission
on Illumination(CIE) chromaticity
diagram

If the wavelength of the pure colors


are plotted in these coordinates, and
the mixtures of these wavelengths
are plotted inside the pure colors, the
result is known as the CIE
chromaticity diagram.
In the chromaticity diagram, white
light is defined as the mixture of
equal amounts of all wavelengths of
visible light.
26

Chromaticity Diagram

Since x, y and z are not


independent, only x and
y are enough to specify
a color.
And we can get by
z= 1-(x+y)
As we know x+y+z =

1.

Chromaticity
Chromaticity
Diagram
Diagram

Color mixing

Chromaticity
Chromaticity
Diagram
Diagram

mixing white light to


saturated color
Fixed x,y,z can not
represent all colors

Color Fundamentals (cont)

Color Gamut
produced by RGB
monitors

Color Gamut
produced by high
quality color
printing device

Color model

RGB model:
image displays like monitor

CMY model: cyan, magenta and yellow


useful for image printer

CMYK model: cyan, yellow magenta and black.


useful for image printers

HSI color model: hue, saturation and intensity or


brightness
application oriented or also, it is perception oriented
(how humans perceive a color)
31

Color Models -- RGB Model

RGB color model is based on Cartesian coordinate system

1-bit color (21 = 2 colors):


monochrome, often black and white

bit color (22 = 4 colors): CGA, gray-scale

4-bit color (24 = 16 colors):

33

8-bit color (28 = 256 colors):


3 bits (8 possible levels)

224 or 16,777,216 color


True color (24-bit)
32-bit color, is a variant of true color
in which the additional 8 bits are
allocated to transparency and
indicate how transparent the element
is to which the color is assigned,
when overlaid on other elements.
Deep color (30/36/48-bit)
30 bits (1.073 billion colors), 36 bits
(68.71 billion colors), and 48 bits
(281.5 trillion colors)

34

Safe RGB Color


Cube
6 shads of RGB
which 216 colors
can be
represented on
any display

35

Color
Color Models
Models --- RGB
RGB
Model
Model

For most
graphics
images used
for Internet
applications, a
set of 216
colors has
been selected
to represent
safe colors
which should
be reliably
displayed on
computer
monitors.

37

38

Color
Color Models
Models --- CMY
CMY and
and CMYK
CMYK
Models
Models

Cyan, Magenta and Yellow model.


RGB to CMY conversion

C 1 R
M 1 G

Y 1 B
For CMYK black color is add

3D-polar Coordinate Colour


Spaces
These spaces use a cylindrical (3D-polar)
coordinate system to encode the following three
visual coordinates:
Hue (dominant colour seen)
Saturation (degree of dilution)
Brightness
HS: gives chromatic information
I: gives intensity information
Many Gary scale image alogs can be used for colour by
converting RGB to HSI

Conversion of RGB to HSI

The transformation of the RGB colour space to a


hue, saturation and brightness colour space is
essentially a conversion from a set of rectangular
coordinates to a set of (3D-polar) cylindrical
coordinates.
H

Yet there are many such spaces


described in books.

Color Models -- HSI Model

Color
Color Models
Models --- HSI
HSI
Model
Model

Color
Color Models
Models --- HSI
HSI
Model
Model

Color
Color Models
Models --- HSI
HSI
Model
Model

Color Models -- HSI Model


Converting colors from RGB to HSI
if B G

H
360 if B G

3
min( R, G, B)
S 1
( R G B)

1
I ( R G B)
3

cos
1

1
2

( R G ) ( R B)

1
2

( R G ) ( R B )(G B )
2

Color
Color Models
Models --- HSI
HSI
Model
Model

Converting colors from HSI to RGB


RG sector (

0 o H 120 o)

B I (1 S )

S cos H
R I 1

o
cos(60 H )

G 3I ( R B )
GB sector (

120 o H 240 o )
S cosH 120
G I 1
, R I 1 S, B I R G

cos 180 H

BR sector (

240o H 360 o

S cosH 240
B I 1
, G I 1 S, R I G B

cos300 H

HSI property

48

Color
Color Models
Models --- HSI
HSI Model
Model

Color image processing


Pseudo-color image processing
Assign color to monochrome images
Intensity slicing
Gray level to color transformation
Spatial domain approach three different
transformation functions
Frequency domain approach three different filters

Full-color image processing


Color image enhancement and restoration
Color compensation

50

Pseudocolor
Pseudocolor Image
Image Processing
Processing
Intensity
Intensity Slicing
Slicing

The pseudocolors used to colorize a gray level


image do not represent the original, true colors if
there were originally a color image.

Pseudocolor
Pseudocolor Image
Image Processing
Processing
Intensity
Intensity Slicing
Slicing

Gray level to color transformation


spatial domain
Perform three independent transformations on
the gray level of any input pixel.
The three results can then serve as the red,
green, and blue components of a color image

53

How its done?

54

Examples

55

56

57

Full Color Image Processing

Two processing methods:


(1) process each channel (or color
component) separately, as if the color
image were three gray scale images;
(Color Transformations)
(2) process all channels with each pixel
represented as a vector. (vector
processing
Color transformations
Processing in RGB, HSI, or CMY(K) space

59

Full-Color Image Processing


Color Transformation

CMYK

RGB

Some difficulty in interpreting


the HUE:
Discontinuity where 0 and
360 meet.

HSI
H.R. Pourreza

Hue is undefined for a


saturation 0

Color
Color Transformations
Transformations
Example
Example

Color
Color Complement
Complement Transformations
Transformations

To the human visual system, colors have


complements.
Complements are basically given by subtracting
one color from white, or by changing a hue by
180 degrees.

Color
Color Complement
Complement Transformations
Transformations

63

Color
Color Complement
Complement Transformations
Transformations
Example
Example

Transformation to red, green and


blue components

65

color slicing

Cube of width W
66

Color
Color Slicing
Slicing
Example
Example

Color slicing: highlighting a specific range of


colors in an image.

Cube

Spher
e

Tone correction
A color images, we need to define
the tone. So, a color image may have
a flat tone, it may have a light tone
or it may have a dark tone
These tones are determined by the
distribution of the intensity values of
different RGB components within the
image.
68

Tone correction

69

Tone
Tone and
and Color
Color Corrections
Corrections
Tone
Tone Corrections
Corrections

Tone
Tone and
and Color
Color Corrections
Corrections
Tone
Tone Corrections
Corrections

Tone
Tone and
and Color
Color Corrections
Corrections
Tone
Tone Corrections
Corrections

73

74

75

76

77

78

neighborhood processing technique


Smoothing

79

Sharpening

80

Вам также может понравиться