Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 89

COL LEGE OF E N GI N E ER I N G ROOR K EE

Established in 1998

Digital Image Processing (TCS-071)

Session: 2020-21

Digital Image Processing


COURSE OBJECTIVE

The aim of this course is,


 Describe and explain basic principles of digital image
processing.
 Design and implement algorithms that perform basic image
processing (e.g. noise removal and image enhancement).
 Design and implement algorithms for advanced image
analysis (e.g. image compression, image segmentation).
 Assess the performance of image processing algorithms and
systems.

Digital Image Processing


Digital Image Processing
Color Image Processing

Digital Image Processing


Color Image Processing

Color Image Processing:-


 Color is a powerful descriptor that often
simplifies object identification and extraction
from a scene.
 Human can discern thousands of color shades
and intensities, compared to about only two
dozen shades of gray.

Digital Image Processing


Preview

Digital Image Processing


Preview

Digital Image Processing


Color Image Processing

 Color image processing is divide into two major


area:
 Full-Color Processing: images are acquired
with a full-color sensor, such as a color TV
camera or color scanner.
 Pseudo-Color Processing: The problem is one of
assigning a color to a particular monochrome
intensity or range of intensities.

Digital Image Processing


Color Fundamentals

The experiment of Sir Isaac Newton, in 1666.

Digital Image Processing


Color Fundamentals (con’t)c

Digital Image Processing


Color Fundamentals
• Colors are seen as variable combinations of the primary color s of light:
red (R), green (G), and blue (B).

• The primary colors can be mixed to produce the secondary colors:


magenta (red+blue), cyan (green+blue), and yellow (red+green).

• Mixing the three primaries, or a secondary with its opposite primary color,
produces white light.

Primary and secondary colors of light

Digital Image Processing


Color Fundamentals
• However, the primary colors of pigments are cyan (C),
magenta (M), and yellow (Y), and the secondary colors are
red, green, and blue.
• A proper combination of the three pigment primaries, or a
secondary with its opposite primary, produces black.

Primary and secondary colors of pigments

Digital Image Processing


Color Fundamentals (con’t)c

 Basic quantities to describe the quality of light source:


 Radiance: Total amount of energy that flows from the
light source (in W).
 Luminance: A measure of the amount of energy an
observer perceives from the light source (in lm)
 Brightness: A subjective descriptor that embodies the
achromatic notion of intensity and is practical
impossible to measure.

Digital Image Processing


Color Fundamentals (con’t)

Standard wavelength values for the


primary colors

Digital Image Processing


Color Fundamentals (con’t)

Digital Image Processing


Color Fundamentals (con’t)

 The characteristics generally used to distinguish one color


from another are Brightness, Hue, and Saturation.
 Hue: Represents dominant color as perceive by an
observer.
 Saturation: Relative purity or the amount of white light
mixed with a hue

 Hue and saturation taken together are called Chromaticity,


and therefore, a color may be characterized by its Brightness
and Chromaticity.

Digital Image Processing


Color Fundamentals (con’t)

 Tri-stimulus values: The amount of Red, Green and Blue


needed to form any particular color
Denoted by: X, Y and Z

 Tri-chromatic coefficient:

X Y Z
x y z
X Y  Z X Y  Z X Y  Z

x  y  z 1

Digital Image Processing


Color Fundamentals (con’t)

Chromaticity Diagram

Green Point =
62% green,
25% red,
13% blue.

Digital Image Processing


Color Fundamentals (con’t)

Color Gamut
produced by RGB
monitors

Color Gamut
produced by high
quality color printing
device

Digital Image Processing


Color characteristics

The characteristics used to distinguish one color


from another are:
 Brightness: means the amount of intensity
(i.e. color level).
 Hue: represents dominant color as perceived
by an observer.
 Saturation: refers to the amount of white light
mixed with a hue.

Digital Image Processing


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, generally accept way.
 RGB (red,green,blue) : monitor, video camera.
 CMY(cyan,magenta,yellow),CMYK (CMY, black) model for
color printing.
 and HSI model,which corresponds closely with the way
humans describe and interpret color.

Digital Image Processing


The RGB color model
• In this model, each color appears in its primary colors red,
green, and blue.
• This model is based on a Cartesian coordinate system.
• The color subspace is the cube shown in the figure below.
• The different colors in this model are points on or inside the
cube, and are defined by vectors extending from the origin.

Digital Image Processing


The RGB color model…
• All color values R, G, and B have been normalized in the range [0, 1].
However, we can represent each of R, G, and B from 0 to 255.
• Each RGB color image consists of three component images, one for each
primary color as shown in the figure below. These three images are
combined on the screen to produce a color image.

Scheme of RGB color image


Digital Image Processing
The RGB color model…
• The total number of bits used to represent each pixel in RGB image is
called pixel depth.
• For example, in an RGB image if each of the red, green, and blue images is
an 8-bit image, the pixel depth of the RGB image is 24-bits.
• The figure below shows the component images of an RGB image.

Full color Red Green Blue

A full-color image and its RGB component images

Digital Image Processing


The RGB Color Models

Digital Image Processing


The RGB Color Models (con’t)

Digital Image Processing


The RGB Color Models (con’t)

Digital Image Processing


The RGB Color Models (con’t)

Safe RGB Colors (Safe Web colors)

Digital Image Processing


The RGB Color Models (con’t)

Digital Image Processing


The CMY and CMYK Color Models

 Cyan, Magenta and Yellow are the secondary colors


of light
 Most devices that deposit colored pigments on
paper, such as color printers and copiers, require CMY
data input.

 C  1  R 
 M   1  G 
    
 Y  1  B 
where, all color values have been normalized to the range [0, 1].

Digital Image Processing


The CMY and CMYK Color Models
 In printing, combining equal amounts of cyan, magenta, and yellow
produce muddy-looking black.
 In order to produce true black, a fourth color, black, is added, giving rise to
the CMYK color model.

Full color Cyan Magenta


Yellow

A full-color image and its


Black
CMYK component images

Digital Image Processing


The HSI color model
• The RGB and CMY color models are not suited for describing colors in terms
of human interpretation. When we view a color object, we describe it by its
hue, saturation, and brightness (intensity).
• Hence the HSI color model has been presented. The HSI model decouples
the intensity component from the color-carrying information (hue and
saturation) in a color image.
• This model is an ideal tool for developing color image processing
algorithms.
• The hue, saturation, and intensity values can be obtained from the RGB
color cube. That is, we can convert any RGB point to a corresponding point
is the HSI color model by working out the geometrical formulas.

Digital Image Processing


The HSI Color Models

Digital Image Processing


The HSI Color Models

Digital Image Processing


The HSI Color Models

Digital Image Processing


The HSI Color Models
 Converting colors from RGB to HSI

 if B  G
H 
360   if B  G
 1 
[( R  G )  ( R  B )]
1  2 
  cos  1/ 2 
 [( R  G ) 2
 ( R  B )( G  B )] 
 
3
S  1 [min( R, G, B )]
( R  G  B)
1
I  ( R  G  B)
3
Digital Image Processing
The HSI Color Models

 Converting colors from HIS to


RGB
 RG sector : 0  H  120

B  I (1  S )

 S cos H 
R  I 1  
 cos( 60 
 H ) 

G  3I  ( R  B )

Digital Image Processing


The HSI Color Models

 Converting colors from HIS to


RGB
 GB sector : 120  H  240

H  H  120
R  I (1  S )
 S cos H 
G  I 1  
 cos( 60 
 H ) 
B  3I  ( R  G )

Digital Image Processing


The HSI Color Models

 Converting colors from HIS to


RGB
 BR sector : 240  H  360

H  H  240
G  I (1  S )
 S cos H 
B  I 1  
 cos( 60 
 H ) 
R  3I  (G  B )

Digital Image Processing


The HSI Color Models

Digital Image Processing


The HSI Color Models
RGB H H S

S I I RGB

Digital Image Processing


Pseudocolor Image Processing

 Pseudocolor (also called false color) image processing


consists of assigning colors to gray values based on a
specified criterion.

 The principal use of pseudocolor is for human visualization


and interpretation of gray-scale events in an image or
sequence of images.

Digital Image Processing


Intensity Slicing

Digital Image Processing


Intensity Slicing (con’t)

Digital Image Processing


Intensity Slicing (con’t)

Digital Image Processing


Intensity Slicing (con’t)

Digital Image Processing


Gray Level to Color Transformations

Digital Image Processing


Gray Level to Color Transformations

Digital Image Processing


Gray Level to Color Transformations

Digital Image Processing


Gray Level to Color Transformations

Digital Image Processing


Gray Level to Color Transformations

Digital Image Processing


Gray Level to Color Transformations

Digital Image Processing


Basic of Full Color Image Processing

Let c represent an arbitrary vector in RGB color space

cR   R 
c  cG   G 
cB   B 
For an image of size M*N,

 c R ( x, y )   R ( x, y ) 
c( x, y )  cG ( x, y )  G ( x, y )
cB ( x, y )   B ( x, y ) 

Digital Image Processing


Basic of Full Color Image Processing

Digital Image Processing


Basic of Full-Color Image Processing

 Major categories of full-color Image process-


ing:
 Per-color-component processing
 Vector-based processing

Digital Image Processing


Basic of Full-Color Image Processing
Color Transformation

Processing the components of a color image


within the context of a single color model.

g ( x, y )  T  f ( x, y ) 
si  Ti r1 , r2 ,  , rn , i  1,2,..., n

Color components of g Color components of f

Color mapping functions

Digital Image Processing


Full-Color Image Processing
Color Transformation

CMYK

 Some difficulty in interpreting the


RGB
HUE:
 Discontinuity where 0 and 360º
meet.
 Hue is undefined for a
HSI
saturation 0
Digital Image Processing
Full-Color Image Processing
Color Transformation: Modify the Intensity

si  kri i  1,2,3 s1  r1
g ( x, y )  kf ( x, y )
si  kri  (1  k ) i  1,2,3
s2  r2
Digital Image Processing s3  kr3
Full-Color Image Processing
Color Transformation: Color Complement

Digital Image Processing


Full-Color Image Processing
Color Transformation: Color Complement

Digital Image Processing


Full-Color Image Processing
Color Transformation: Color Slicing

Motive: Highlighting a specific range of colors in an


image

Basic Idea:
 Display the color of interest so that they stand out
from background
 Use the region defined by the colors as a mask for
further processing

  W
0.5 if  rj  a j  
si    2  any1 j  n , i  1,2,..., n
r otherwise
i
Digital Image Processing
Full-Color Image Processing
Color Transformation: Color Slicing

1. Colors of interest are enclosed by cube (or hypercube


for n>3)
  W
0.5 if  rj  a j  
si    2  any1 j  n , i  1,2,..., n
r otherwise
i

2. Colors of interest are enclosed by Sphere

 n
 0.5 if  (rj  a j )  R0
2 2
si   j 1
, i  1,2,..., n
ri otherwise

Digital Image Processing


Full-Color Image Processing
Color Transformation: Color Slicing

Cube Sphere

Digital Image Processing


Full-Color Image Processing
Color Transformation: Tone and Color Correction

The tonal rang 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.

Digital Image Processing


Full-Color Image Processing
Color Transformation: Tonal Correction
Middle-key Image

Digital Image Processing


Full-Color Image Processing
Color Transformation: Tonal Correction
High-key Image

Digital Image Processing


Full-Color Image Processing
Color Transformation: Tonal Correction
Low-key Image

Digital Image Processing


Full-Color Image Processing
Color Transformation: 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 Adding Green


and Blue

Digital Image Processing


Full-Color Image Processing
Color Transformation: Color Correction

Digital Image Processing


Full-Color Image Processing
Color Transformation: Histogram Processing

Histogram
Equalizing the Saturation
Intensity Adjustment

Digital Image Processing


Full-Color Image Processing
Color Image Smoothing

Averaging:
1
c ( x, y ) 
K
 c( x , y )
( x , y )S xy

1 
  R ( x, y ) 
 K ( x , y )S xy 
1 
c ( x, y )    G ( x, y ) 
 K ( x , y )S xy 
1 
 K  B ( x, y ) 
 ( x , y )S xy 
Digital Image Processing
Full-Color Image Processing
Color Image Smoothing

Red

Green Blue

Digital Image Processing


Full-Color Image Processing
Color Image Smoothing

Hue Saturation Intensity

Digital Image Processing


Full-Color Image Processing
Color Image Smoothing
Averaging R,G and B Averaging Intensity Difference

Digital Image Processing


Full-Color Image Processing
Color Image Sharpening

The Laplacian of Vector c :

  2 R ( x, y ) 
 2 
 c( x, y )   G ( x, y )
2

  2 B ( x, y ) 
 

Digital Image Processing


Full-Color Image Processing
Color Image Sharpening
Sharpening R,G and B Sharpening Intensity Difference

Digital Image Processing


Full-Color Image Processing
Color Segmentation

Segmentation is a process that partitions an


image into regions

 Segmentation in HIS Color Space


 Segmentation in RGB Vector Space
 Color Edge Detection

Digital Image Processing


Full-Color Image Processing
Color Segmentation: in HIS Color Space

Digital Image Processing


Full-Color Image Processing
Color Segmentation: in RGB Vector Space
z is similar to a if the distance between them is less than a
specified threshold.
Euclidian Distance: D(z, a)  z  a

 (z  a)T (z  a) 1/ 2

 ( z  a )  ( z  a 
1/ 2
G )  ( z B  aB )
2 2 2
R R G

D(z, a)  (z  a) C (z  a)


1 1/ 2
Generalized form: T

Digital Image Processing


Full-Color Image Processing
Color Segmentation: in RGB Vector Space

Digital Image Processing


Full-Color Image Processing
Color Segmentation: Color Edge Detection

Digital Image Processing


Full-Color Image Processing
Color Segmentation: Color Edge Detection
R G B
u r g b
x x x
R G B
v r g b
y y y
2 2 2
R G B
g xx  u T u   
x x x
2 2 2
R G B
g yy  v v 
T
 
y y y
R R G G B B
g xy  u v 
T
 
x y x y x y
Digital Image Processing
Full-Color Image Processing
Color Segmentation: Color Edge Detection

1  2 g xy 
  tan 
1

2  g xx  g yy 
1/ 2

 
F ( )   g xx  g yy  g xx  g yy cos 2  2 g xy sin 2 
1 
2 

Digital Image Processing


Full-Color Image Processing
Color Segmentation: Color Edge Detection

Digital Image Processing


Full-Color Image Processing
Color Segmentation: Color Edge Detection

Digital Image Processing


Full-Color Image Processing
Noise in Color Images

Digital Image Processing


Full-Color Image Processing
Noise in Color Images

Digital Image Processing


Full-Color Image Processing
Noise in Color Images

Digital Image Processing


Full-Color Image Processing
Color Image Compression

Digital Image Processing


THANK YOU!

Digital Image Processing

You might also like