You are on page 1of 38

CSE4019 Image Processing

Module1
Dr.G.Malathi
Associate Professor Senior,
Imaging and Computer Vision Research Group Chair
School of Computing Science and Engineering
Vellore Institute of Technology, Chennai

1
Syllabus
Module1: Introduction, Digital Image, its
Representations 6 hours
Image Representation and image processing
Paradigm – Elements of digital image processing
– image model – Sampling and quantization –
relationships between pixels – connectivity,
distance measures between pixels – color
image(overview, various color models) – various
image formats –bmp, jpeg, tiff,pnd, gif, etc

2
Color fundamentals
• The color that human perceive in an object =
the light reflected from the object

scene
Illumination source

reflection
eye
Primary and secondary colors
• In 1931, CIE(International Commission on
Illumination) defines specific wavelength values
to the primary colors
– B = 435.8 nm, G = 546.1 nm, R = 700 nm
– However, we know that no single color may be called
red, green, or blue
• Secondary colors: G+B=Cyan, R+G=Yellow,
R+B=Magenta
Additive Colours

Any Media

https://www.sessions.edu/color-calculator/
Subtractive Colours

Print media
primary colors of pigments
• Primary color of pigments
– Color that subtracts or absorbs a primary color of
light and reflects or transmits the other two

Color of light: R G B

Color of pigments: absorb R absorb G absorb B


Cyan Magenta Yellow
Color Fundamentals
Approximately 66% of these cones are sensitive to
red light, 33% to green light and 6% to blue light
Absorption curves for the different cones have
been determined experimentally
Achromatic vs Chromatic Light

• Achromatic (void of color) Light: Its only


contribute is its ‘Intensity’ or amount

• Chromatic Light: spans the electromagnetic


spectrum from approximately 400 to 700nm
Color characterization

Brightness: chromatic notion of intensity


Hue: dominant color perceived by an observer
Saturation: relative purity or the amount of white
mixed with a hue

120o
G
S
H
R 0o

240o B 10
Quantities for description of quantity of
Chromatic Source of Light

• Three basic quantities are used to describe the quantity of a


chromatic source of light:

– Radiance

– Luminance

– Brightness
Radiance

The total amount of Energy that


flows from a Light Source
Luminance

N
measure of amount of energy an
observer perceives from a light
source

• For example light emitted from a source operating in


Infrared region of Spectrum could have significant energy
(Radiance) but a human observer will hardly perceive it so
luminance is zero.
Brightness

• It is a subjective measure

• It embodies the achromatic notion of


intensity and is one of the key factors
in describing color sensation
Human Perception

• Detailed experimental evidences has established that the 6


to 7 million cones in the human eye can be divided into
three principal sensing categories, corresponding roughly to
red, green and blue

• Approximately 65% of all cones are sensitive to Red Light,


33% are sensitive to Green Light and about 2% are
sensitive to Blue Light (most sensitive)
Human Perception
• Due to these absorption characteristic of Human Eye colors
are seen as variable combinations of the so-called ‘Primary
Colors’ Red, Green and Blue

• The primary colors can be added to produce secondary


colors of Light

– Magenta (Red+Blue)
– Cyan (Green+Blue)
– Yellow (Red+Green)
Primary Color of Light vs Primary Color of
Pigments

• Red, Green and Blue Colors are Primary Colors of Light

• In Primary Color of Pigments a primary color is defined as


the one that subtracts or absorbs a primary color of Light
and reflects or transmits the other two

• A proper combination of three pigment primaries or a


secondary with its opposite primary produces Black

• Color Television Reception is an example of the additive


nature of Light Colors
Chromaticity Diagram

• Another approach for specifying colors is to use


chromaticity diagram

• Shows color compositions as a function of x(red) and


y(green)

• For any x and y the corresponding value of z(blue) can be


obtained as

z=1-x-y
Chromaticity Diagram
Color Models
• The purpose of a color model (also called Color Space or Color
System) is to facilitate the specification of colors in some
standard way

• A color model is a specification of a coordinate system and a


subspace within that system where each color is represented
by a single point

• Color Models

RGB (Red, Green, Blue)


CMY (Cyan, Magenta, Yellow)
HSI (Hue, Saturation, Intensity)
YIQ (Luminance,In phase, Quadrature)
YUV (Y' stands for the luma component (the brightness) and U
and V are the chrominance (color) components )
RGB Model

• Each color is represented


in its primary color
components Red, Green
and Blue

• This model is based on


Cartesian Coordinate
System
CMY and CMYK Color Model
• Cyan, magenta, and yellow are the secondary colors with respect to the
primary colors of red, green, and blue. However, in this subtractive model,
they are the primary colors and red, green, and blue, are the secondaries.
In this model, colors are formed by subtraction, where adding different
pigments causes various colors not to be reflected and thus not to be
seen. Here, white is the absence of colors, and black is the sum of all of
them. This is generally the model used for printing.

• Most devices that deposit color pigments on paper (such as Color Printers
and Copiers) requires CMY data input or perform RGB to CMY conversion
internally

C 1.00 R

M = 1.00
- G

Y 1.00 B
CMY and CMYK Color Model

• CMY is a Subtractive Color Model

• Equal amounts of Pigment primaries (Cyan, Magenta and


Yellow) should produce Black

• In practice combining these colors for printing produces a


“Muddy-Black” color

• So in order to produce “True-Black” a fourth color “Black” is


added giving rise to CMYK model
CMY Color Model
CMY Color Model
Color Mixing
• https://www.sessions.edu/color-calculator/

26
Color pixel
• A pixel at (x,y) is a vector in the color space
– RGB color space

 R( x, y) 
c( x, y )  G( x, y )
 B( x, y) 
c.f. gray-scale image

f(x,y) = I(x,y)
Distance Measures
0 1 1 1 (c)
1 1 0 1
1 1 1 1 (b)
1 (a) 1 1 1

Distance Metric must satisfy the following


properties:
• D(a,b) is well defined. Finite for all a and b
• D(a,b)≥ 0. If a=b then D(a,b)=0
• The distance D(a,b)=D(b,a)
• D(a,b)+D(b,c) ≥ D(a,c)
29
Distance Measures
• Euclidean distance between the pixels a and b,
with coordinates (x,y) and (s,t) is given as
• De(a,b)= 𝑥−𝑠 2 + 𝑦−𝑡 2

• Euclidean distance is the straight line distance


between the between the two pixels

30
Distance Measures
• City block distance between the pixels a and b,
with coordinates (x,y) and (s,t) is given as
• Dc(a,b)= 𝑥 − 𝑠 + 𝑦 − 𝑡
• City block distance measures the path
between the pixels based on the four
connected neighborhood (D4).

31
Distance Measures
• Chess board distance between the pixels a
and b, with coordinates (x,y) and (s,t) is given
as
• D8(a,b)=max( 𝑥 − 𝑠 + 𝑦 − 𝑡 )
• The chessboard distance metric measures the
path between the pixels based on an eight
connected neighbourhood
• D4 – 1 hop distance
• DN – 2 hop distance
32
Distance Measures
• Estimating distances in digital image is useful
in different shape representation and shape
recognition tasks
Distance Measures
• Finding the distance between two points by
knowing the coordinates of the two points.

De(P,Q) = [(x-s)2 + (y-t)2)]1/2


Distance Measures
• City Block distance or D4
• Checkerboard Distance or D8
• Euclidean Distance
Euclidean Distance
• D(p,q)= [(x-s)2 + (y-t)2)]1/2

Set of S= { q|D(p,q)≤ r} are the points contained


in a disk of radius r centered at p

r
P
City Block Distance
q
(s,t)

Distance travelled along x


p
(x,y)

D4 = |x-s| +|y-t|
Flipped Class
• https://digital-photography-
school.com/understanding-all-the-different-
image-file-formats/

38

You might also like