SlideShare a Scribd company logo
Digital Image Processing
Gopal Krishan Prajapat
Image Processing Books
• Gonzalez, R. C. and Woods, R. E., "Digital
Image Processing", Prentice Hall.
• Jain, A. K., "Fundamentals of Digital Image
Processing", PHI Learning, 1
st
Ed.
• Bernd, J., "Digital Image Processing", Springer,
6
th
Ed.
• Burger, W. and Burge, M. J., "Principles of
Digital Image Processing", Springer
• Scherzer, O., " Handbook of Mathematical
Methods in Imaging", Springer
Sunday, December 18, 2022 2
Why we need Image Processing?
• Improvement of pictorial information for
human perception
• Image processing for autonomus machine
applications
• Efficient storage and transmission
Sunday, December 18, 2022 3
What is digital image processing?
• An image may be defined as a two dimensional
function f(x,y), where ‘x’ and ‘y’ are spatial(plane)
coordinates and the amplitude of ‘f’ at any pair of
coordinates (x,y) is called the intensity or gray
level of the image at that point.
• When x,y, and the amplitude values of ‘f’ are all
finite, descrete quantities we call the image a
digital image.
• The field of digital image processing refers to
processing digital images by means of digital
computers.
Sunday, December 18, 2022 4
What is digital image processing?
(Cont…)
Sunday, December 18, 2022 5
Image Processing Applications
• Automobile driver assistance
– Lane departure warning
– Adaptive cruise control
– Obstacle warning
• Digital Photography
– Image Enhancement
– Compression
– Color manipulation
– Image editing
– Digital cameras
• Sports analysis
– sports refereeing and commentary
– 3D visualization and tracking sports actions
Sunday, December 18, 2022 6
Image Processing Applications(Cont…)
• Film and Video
– Editing
– Special effects
• Image Database
– Content based image retrieval
– visual search of products
– Face recognition
• Industrial Automation and Inspection
– vision-guided robotics
– Inspection systems
• Medical and Biomedical
– Surgical assistance
– Sensor fusion
– Vision based diagnosis
• Astronomy
– Astronomical Image Enhancement
– Chemical/Spectral Analysis
Sunday, December 18, 2022 7
Image Processing Applications(Cont...)
• Arial Photography
– Image Enhancement
– Missile Guidance
– Geological Mapping
• Robotics
– Autonomous Vehicles
• Security and Safety
– Biometry verification (face, iris)
– Surveillance (fences, swimming pools)
• Military
– Tracking and localizing
– Detection
– Missile guidance
• Traffic and Road Monitoring
– Traffic monitoring
– Adaptive traffic lights
Sunday, December 18, 2022 8
Brief History of IP
• In 1920s, submarine cables were used to transmit
digitized newspaper pictures between London &
New York – using Bartlane cable picture
transmission System.
• Specialized printing equipments(eg. Telegraphic
printer) used to code the picture for cable
transmission and its reproduction on the
receiving end.
• In 1921, printing procedure was changed to
photographic reproduction from tapes perforated
at telegraph receiving terminals.
• This improved both tonal quality & resolution.
Sunday, December 18, 2022 9
Brief History of IP(Cont…)
Sunday, December 18, 2022 10
Brief History of IP(Cont…)
• Bartlane system was capable of coding 5 distinct
brightness levels. This was increased to 15 levels
by 1929.
• Improvement of processing techniques continued
for next 35 years .
• In 1964 computer processing techniques were
used to improve the pictures of moon tranmitted
by ranger 7 at Jet Propulsion Laboratory.
• This was the basis of modern Image Processing
techniques.
Sunday, December 18, 2022 11
Image Processing Steps
Sunday, December 18, 2022 12
Components of IP System
Sunday, December 18, 2022 13
Image Acquisition Process
Sunday, December 18, 2022 14
Image Sensing and Acquisition
Sunday, December 18, 2022 15
Image Sensing and Acquisition(Cont…)
• Image acquisition using a single sensor
Sunday, December 18, 2022 16
Image Sensing and Acquisition(Cont…)
• Using sensor strips
Sunday, December 18, 2022 17
Image Representation
Sunday, December 18, 2022 18
x
y
IMAGE
An image is a 2-D light intensity function F(X,Y).
F(X,Y) = R(X,Y)* I(X,Y) , where
R(X,Y) = Reflectivity of the surface of the corresponding image point.
I(X,Y) = Intensity of the incident light.
A digital image F(X,Y) is discretized both in spatial coordinates and brightness.
It can be considered as a matrix whose row, column indices specify a point in
the image & the element value identifies gray level value at that point known
as pixel or pels.
Image Representation (Cont..)
Sunday, December 18, 2022 19
(0,0) (0,1) ... (0, 1)
(1,0) (1,1) ... (1, 1)
( , )
... ... ... ...
( 1,0) ( 1,1) ... ( 1, 1)
f f f N
f f f N
f x y
f M f M f M N

 
 

 

 
 
   
 
Image Representation in Matrix form
Image Representation (Cont..)
Sunday, December 18, 2022 20
Image Representation (Cont..)
Sunday, December 18, 2022 21
Image Representation (Cont..)
Sunday, December 18, 2022 22
( , ) ( , ) ( , )
( , ): intensity at the point ( , )
( , ): illumination at the point ( , )
(the amount of source illumination incident on the scene)
( , ): reflectance/transmissivity
f x y i x y r x y
f x y x y
i x y x y
r x y

at the point ( , )
(the amount of illumination reflected/transmitted by the object)
where 0 < ( , ) < and 0 < ( , ) < 1
x y
i x y r x y

Image Representation (Cont..)
• By theory of real numbers :
Between any two given points there are infinite
number of points.
• Now by this theory :
An image should be represented by infinite
number of points.
Each such image point may contain one of the
infinitely many possible intensity/color values
needing infinite number of bits.
Obviously such a representation is not possible in
any digital computer.
Sunday, December 18, 2022 23
Image Sampling and Quantization
• By above slides we came to know that we need to
find some other way to represent an image in
digital format.
• So we will consider some discrete set of points
known as grid and in each rectangular grid
consider intensity of a particular point. This
process is known as sampling.
• Image representation by 2-d finite matrix –
Sampling
• Each matrix element represented by one of the
finite set of discrete values - Quantization
Sunday, December 18, 2022 24
Sunday, December 18, 2022 25
Image Sampling and Quantization
Sunday, December 18, 2022 26
Sunday, December 18, 2022 27
Sunday, December 18, 2022 28
Sunday, December 18, 2022 29
Sunday, December 18, 2022 30
Sunday, December 18, 2022 31
Sunday, December 18, 2022 32
Sunday, December 18, 2022 33
Sunday, December 18, 2022 34
Colour Image Processing
• Why we need CIP when we get information from
black and white image itself?
1. Colour is a very powerful descriptor & using the
colour information we can extract the objects of
interest from an image very easily which is not so easy
in some cases using black & white pr simple gray level
image.
2. Human eyes can distinguish between thousands of
colours & colour shades whereas when we talk about
only black and white image or gray scale image we
can distinguish only about dozens of intensity
distinguishness or different gray levels.
Sunday, December 18, 2022 35
Color Image processing(Cont…)
• The color that human perceive in an object =
the light reflected from the object
Illumination source
scene
reflection
Humen eye
Colour Image Processing(Cont...)
• In CIP there are 2 major areas:
1.FULL CIP : Image which are acquired by full colour
TV camera or by full color scanner, than, you find
that all the colour you perceive they are present in
the images.
2.PSEUDO CIP : Is a problem where we try to assign
certain colours to a range of gray levels. Pseudo CIP is
mostly used for human interpretation.
So here it is very difficult to distinguish between two
ranges which are very nearer to each other or gray
intensity value are very near to each other.
Sunday, December 18, 2022 37
Colour Image Processing(Cont...)
• Problem with CIP
Interpretation of color from human eye is a
psycophisological problem and we have not yet
been fully understand what is the mechanism by
which we really interpret a color.
Sunday, December 18, 2022 38
Colour Image Processing(Cont...)
• In 1666 Isacc Newton discover color spectrum
by optical prism.
Sunday, December 18, 2022 39
Colour Image Processing(Cont...)
• We can perceive the color depending on the nature of light
which is reflected by the object surface.
• Spectrum of light or spectrum of energy in the visible range that
we are able to perceive a color(400 nm to 700 nm)
Sunday, December 18, 2022 40
Colour Image Processing(Cont...)
• Attribute of Light
Achromatic Light : A light which has no color
component i.e., the only attribute which
describes that particular light is the intensity of
the light.
Chromatic Light : Contain color component.
• 3 quantities that describe the quality of light:
Radiance
Luminance
Brightness
Sunday, December 18, 2022 41
Colour Image Processing(Cont...)
• Radiance : Total amount of energy which comes
out of a light (Unit : watts)
• Luminance : Amount of energy that is perceived
by an observer (Unit : Lumens)
• Brightness : It is a subjective thing. Practically we
can’t measure brightness.
We have 3 primary colors:
Red
Blue
Green
Sunday, December 18, 2022 42
Colour Image Processing(Cont...)
• Newton discovered 7 different color but only 3
colors i.e., red, green and blue are the primary
colors. Why?
Because by mixing these 3 colors in some proportion
we can get all other colors.
There are around 6-7 millions cone cells in our eyes
which are responsible for color sensations.
Around 65% cone cells are sensitive to red color.
Around 33% cone cells are sensitive to green color.
Around 2% cone cells are sensitive to blue color.
Sunday, December 18, 2022 43
Colour Image Processing(Cont...)
• According to CIE standard
Red have wavelength : 700 nm
Green have wavelength : 546.1 nm
Blue have wavelength : 435.6 nm
But, practically :
Red is sensitive to 450 nm to 700 nm
Green is sensitive to 400 nm to 650 nm
Blue is sensitive to 400 nm to 550 nm
Sunday, December 18, 2022 44
Colour Image Processing(Cont...)
• Note : In practical no single wavelength can
specify any particular color.
• By spectrum color also we can see that there is
no clear cut boundaries between any two color.
• One color slowly or smoothly get merged into
another color i.e., there is no clear cut boundary
between transition of color in spectrum.
• So, we can say a band of color give red, green
and blue color sensation respectively.
Sunday, December 18, 2022 45
Colour Image Processing(Cont...)
• Mixing of Primary color generates the secondary
colors i.e.,
 RED+BLUE=Magenta
 GREEN+BLUE = Cyan
 RED+GREEN = yellow
• Here red, green and blue are the primary color
and magenta, cyan and yellow are the secondary
color.
• Pigments : The primary color of pigment is
defined as wavelength which are absorbed by the
pigment and it reflect other wavelength.
Sunday, December 18, 2022 46
Colour Image Processing(Cont...)
• Primary color of light should be opposite of primary color of
pigment i.e., magenta , cyan and yellow are primary color of
pigment.
• If we mix red, green and blue color in appropriate proportion
we get white light and similarly when we mix magenta, cyan
and yellow we get black color.
Sunday, December 18, 2022 47
Colour Image Processing(Cont...)
• For hardware i.e., camera, printer, display
device, scanner this above concept of color is
used i.e., concept of primary color
component.
• But when we perceive a color for human
beings we don’t think that how much
red,green and blue components are mixed in
that particular color.
• So the way by which we human differentiate
or recognize or distinguish color are :
Brightness, Hue and Saturation.
Sunday, December 18, 2022 48
Colour Image Processing(Cont...)
• Spectrum colors are not diluted i.e., spectrum
colors are fully saturated . It means no white
light or white component are added to it.
• Example: Pink is not spectrum color.
Red + white = pink
Here red is fully saturated.
• So, Hue+Saturation indicates chromaticity of
light and Brightness gives some sentation of
intensity.
Sunday, December 18, 2022 49
Colour Image Processing(Cont...)
• Brightness : Achromatic notion of Intensity.
• Hue : It represents the dominant wavelength
present in a mixture of colors.
• Saturation : eg., when we say color is red i.e.,
we may have various shades of red. So
saturation indicates what is the purity of red
i.e., what is the amount of light which has
been mixed to that particular color to make it
a diluted one.
Sunday, December 18, 2022 50
Colour Image Processing(Cont...)
• The amount of red, green and blue
component is needed to get another color
component is known as tristimulus.
• Tristimulus = (X,Y,Z)
• Chromatic cofficient for red = X/(X+Y+Z) , for
green = Y/(X+Y+Z) , for blue = Z/(X+Y+Z).
• Here X+Y+Z=1
• So any color can be specified by its chromatic
cofficient or a color can be specified by a
chromaticity diagram.
Sunday, December 18, 2022 51
Colour Image Processing(Cont...)
• Here Z = 1-(X+Y) , In chromaticity diagram around the
boundary we have all the color of the spectrum colors and
point of equal energy is : white color.
Sunday, December 18, 2022 52
Colour Image Processing(Cont...)
• Color Models : A coordinate system within
which a specified color will be represented by
a single point.
• RGB , CMY , CMYK : Hardware oriented
• HSI : Hue , Saturation and Intensity :
Application oriented / Perception oriented
• In HSI model : I part gives you gray scale
information. H & S taken together gives us
chromatic information.
Sunday, December 18, 2022 53
Colour Image Processing(Cont...)
• RGB Color Model : Here a color model is represented
by 3 primary colors i.e., red , green and blue.
• In RGB color model we can have 224 different color
combinations but practically 216 different colors can
be represented by RGB model.
• RGB color model is based on Cartesian coordinate
system.
• This is an additive color model
• Active displays, such as computer monitors and
television sets, emit combinations of red, green and
blue light.
Sunday, December 18, 2022 54
Colour Image Processing(Cont...)
• RGB Color Model
Sunday, December 18, 2022 55
Colour Image Processing(Cont...)
• RGB Color Model
• RGB 24-bit color cube is shown below
Sunday, December 18, 2022 56
Colour Image Processing(Cont...)
• RGB example:
Sunday, December 18, 2022 57
Original Green Band Blue Band
Red Band
Colour Image Processing(Cont...)
• CMY Color Model : secondary colors of light, or
primary colors of pigments & Used to generate
hardcopy output
Sunday, December 18, 2022 58
Source: www.hp.com
Passive displays, such as colour inkjet printers, absorb light instead of
emitting it. Combinations of cyan, magenta and yellow inks are used. This
is a subtractive colour model.
Colour Image Processing(Cont...)
• Equal proportion of CMY gives a muddy black
color i.e., it is not a pure black color. So, to get
pure black color with CMY another
component is also specified known as Black
component i.e., we get CMYK model.
• In CMYK “K” is the black component.
Sunday, December 18, 2022 59
































B
G
R
Y
M
C
1
1
1
Colour Image Processing(Cont...)
• HSI Color Model (Based on human perception of
colors )
• H = What is the dominant specified color present in a
particular color. It is a subjective measure of color.
• S = How much a pure spectrum color is really diluted
by mixing white color to it i.e., Mixing more “white”
with a color reduces its saturation.
If we mix white color in different proportion with a
color we get different shades of that color.
• I = Chromatic notation of brightness of black and
white image i.e., the brightness or darkness of an
object.
Sunday, December 18, 2022 60
Colour Image Processing(Cont...)
• HSI Color Model
Sunday, December 18, 2022 61
H
dominant
wavelength
S
purity
% white
I
Intensity
Colour Image Processing(Cont...)
• HSI Color Model
Sunday, December 18, 2022 62
RGB -> HSI model
Colour Image Processing(Cont...)
• HSI Color Model
Sunday, December 18, 2022 63
Colour Image Processing(Cont...)
• Pseudo-color Image Processing
Pseudo-Color = False Color
Assign colors to gray values based on a specified
criterion
For human visualization and interpretation of
gray-scale events
Intensity slicing
Gray level to color transformations
Sunday, December 18, 2022 64
Colour Image Processing(Cont...)
• Pseudo-color Image Processing(cont…)
Intensity slicing
 Here first consider an intensity image to be a 3D plane.
 Place a plane which is parallel to XY plane(it will slice the
plane into two different hubs).
 We can assign different color on two different sides of
the plane i.e., any pixel whose intensity level is above
the plane will be coded with one color and any pixel
below the plane will be coded with the other.
 Level that lie on the plane itself may be arbitrarily
assigned one of the two colors.
Sunday, December 18, 2022 65
Colour Image Processing(Cont...)
Intensity slicing
 Geometric interpretation of the intensity slicing
technique
Sunday, December 18, 2022 66
Colour Image Processing(Cont...)
Intensity slicing
 Let we have total ‘L’ number of intensity values: 0 to (L-1)
 L0 corresponds to black [ f(x , y) = 0]
 LL-1 corresponds to white [ f(x , y) = L-1]
 Suppose ‘P’ number of planes perpendicular to the
intensity axis i.e., they are parallel to the image plane and
these planes will be placed at the intensity values given
by L1,L2,L3,………,LP.
 Where , 0< P < L-1.
Sunday, December 18, 2022 67
Colour Image Processing(Cont...)
• Intensity slicing
 The P planes partition the gray scale(intensity)
into (P+1) intervals, V1,V2,V3,………,VP+1.
 Color assigned to location (x,y) is given by the
relation
f(x , y) = Ck if f(x , y) ∈ Vk
Sunday, December 18, 2022 68
Colour Image Processing(Cont...)
• Intensity slicing Numerical
Sunday, December 18, 2022 69
Colour Image Processing(Cont...)
• Intensity slicing Numerical
Sunday, December 18, 2022 70
Colour Image Processing(Cont...)
• Intensity slicing
 Give ROI(region of interest) one color and rest part
other color
 Keep ROI as it is and rest assign one color
 Keep rest as it is and give ROI one color
Sunday, December 18, 2022 71
Colour Image Processing(Cont...)
• Intensity slicing Example
Sunday, December 18, 2022 72
Colour Image Processing(Cont...)
• Intensity slicing Example
Sunday, December 18, 2022 73
Colour Image Processing(Cont...)
• Intensity slicing Example
Sunday, December 18, 2022 74
Colour Image Processing(Cont...)
• Pseudo-coloring is also used from gray to color
image transformation.
• Gray level to color transformation
Sunday, December 18, 2022 75
Colour Image Processing(Cont...)
• Gray level to color transformation
fR(X,Y) = f(x,y)
fG(X,Y) = 0.33f(x,y)
fB(X,Y) = 0.11f(x,y)
 Combining these 3 planes we get the pseudo
color image.
 Application of Pseudo CIP : Machine using at
railways and airport for bag checking.
Sunday, December 18, 2022 76
Colour Image Processing(Cont...)
• Gray level to color transformation Example
Sunday, December 18, 2022 77
Colour Image Processing(Cont...)
• Gray level to color transformation Example
Sunday, December 18, 2022 78
Image Enhancement
• Intensity Transformation Functions
• Enhancing an image provides better contrast and a more
detailed image as compare to non enhanced image.
Image enhancement has very applications. It is used to
enhance medical images, images captured in remote
sensing, images from satellite e.t.c
• The transformation function has been given below
s = T ( r )
• where r is the pixels of the input image and s is the pixels
of the output image. T is a transformation function that
maps each value of r to each value of s.
Sunday, December 18, 2022 79
Image Enhancement(Cont…)
• Image enhancement can be done through gray
level transformations which are discussed below.
• There are three basic gray level transformation.
• Linear
• Logarithmic
• Power – law
Sunday, December 18, 2022 80
Image Enhancement(Cont…)
• Linear Transformation
 Linear transformation includes simple identity and negative
transformation.
 Identity transition is shown by a straight line. In this transition,
each value of the input image is directly mapped to each other
value of output image. That results in the same input image
and output image. And hence is called identity transformation.
• Negative Transformation
 The second linear transformation is negative transformation,
which is invert of identity transformation. In negative
transformation, each value of the input image is subtracted
from the L-1 and mapped onto the output image.
Sunday, December 18, 2022 81
Image Enhancement(Cont…)
Sunday, December 18, 2022 82
Image Enhancement(Cont…)
• Negative Transformation
s = (L – 1) – r
s = 255 – r
Sunday, December 18, 2022 83
Image Enhancement(Cont…)
• Logarithmic Transformations
 The log transformations can be defined by this
formula
s = c log(r + 1).
 Where s and r are the pixel values of the output
and the input image and c is a constant. The value
1 is added to each of the pixel value of the input
image because if there is a pixel intensity of 0 in
the image, then log (0) is equal to infinity. So 1 is
added, to make the minimum value at least 1.
Sunday, December 18, 2022 84
Image Enhancement(Cont…)
• Logarithmic Transformations
 In log transformation we decrease the dynamic range of a
particular intensity i.e., here intensity of the pixels are
increased which we require to get more information. The
maximum information is contained in the center pixel.
 Log transformation is mainly applied in frequency domain.
Sunday, December 18, 2022 85
Image Enhancement(Cont…)
• Logarithmic Transformation
Sunday, December 18, 2022 86
Image Enhancement(Cont…)
• Power – Law transformations
• This symbol γ is called gamma, due to which this
transformation is also known as gamma
transformation.
Sunday, December 18, 2022 87
s = crγ, c,γ –positive constants
curve the grayscale components either to brighten
the intensity (when γ < 1) or darken the intensity
(when γ > 1).
Image Enhancement(Cont…)
• Power – Law transformations
Sunday, December 18, 2022 88
Image Enhancement(Cont…)
• Power – Law transformations
• Variation in the value of γ varies the enhancement
of the images. Different display devices / monitors
have their own gamma correction, that’s why they
display their image at different intensity.
• This type of transformation is used for enhancing
images for different type of display devices. The
gamma of different display devices is different.
For example Gamma of CRT lies in between of 1.8
to 2.5, that means the image displayed on CRT is
dark.
Sunday, December 18, 2022 89
Image Enhancement(Cont…)
• Power – Law transformations
 Gamma Correction
 Different camera or video recorder devices do not
correctly capture luminance. (they are not linear)
Different display devices (monitor, phone screen, TV) do
not display luminance correctly neither. So, one needs to
correct them, therefore the gamma correction function
is needed. Gamma correction function is used to correct
image's luminance.
s=cr^γ
s=cr^(1/2.5)
Sunday, December 18, 2022 90
Image Enhancement(Cont…)
Sunday, December 18, 2022 91
Image Enhancement(Cont…)
Sunday, December 18, 2022 92
Image Enhancement(Cont…)
• Piecewise-Linear Transformation Functions
 Three types:
 Contrast Stretching
 Intensity Level Slicing
 Bit-Plane Slicing
Sunday, December 18, 2022 93
Image Enhancement(Cont…)
• Contrast stretching
 Aims increase the dynamic range of the gray
levels in the image being processed.
 Contrast stretching is a process that expands the
range of intensity levels in a image so that it
spans the full intensity range of the recording
medium or display device.
 Contrast-stretching transformations increase the
contrast between the darks and the lights
Sunday, December 18, 2022 94
Image Enhancement(Cont…)
• Contrast stretching
Sunday, December 18, 2022 95
Image Enhancement(Cont…)
• Contrast stretching
 The locations of (r1,s1) and (r2,s2) control the shape of
the transformation function.
– If r1= s1 and r2= s2 the transformation is a linear
function and produces no changes.
– If r1=r2, s1=0 and s2=L-1, the transformation becomes
a thresholding function that creates a binary image.
– Intermediate values of (r1,s1) and (r2,s2) produce
various degrees of spread in the gray levels of the
output image, thus affecting its contrast.
– Generally, r1≤r2 and s1≤s2 is assumed.
Sunday, December 18, 2022 96
Image Enhancement(Cont…)
Sunday, December 18, 2022 97
Thresholding function
Image Enhancement(Cont…)
Sunday, December 18, 2022 98
Image Enhancement(Cont…)
Sunday, December 18, 2022 99
Image Enhancement(Cont…)
Sunday, December 18, 2022 100
Image Enhancement(Cont…)
Sunday, December 18, 2022 101
Image Enhancement(Cont…)
Sunday, December 18, 2022 102
Image Enhancement(Cont…)
Sunday, December 18, 2022 103
Image Enhancement(Cont…)
Sunday, December 18, 2022 104
Image Enhancement(Cont…)
Sunday, December 18, 2022 105
Image Enhancement(Cont…)
Sunday, December 18, 2022 106
Image Enhancement(Cont…)
Sunday, December 18, 2022 107
Image Enhancement(Cont…)
• Intensity-level slicing
 Highlighting a specific range of gray levels in an
image.
 One way is to display a high value for all gray levels
in the range of interest and a low value for all
other gray levels (binary image).
 The second approach is to brighten the desired
range of gray levels but preserve the background
and gray-level tonalities in the image
Sunday, December 18, 2022 108
Image Enhancement(Cont…)
• Intensity Level Slicing
Sunday, December 18, 2022 109
Image Enhancement(Cont…)
• Bit-Plane Slicing
• To highlight the contribution made to the total
image appearance by specific bits.
– i.e. Assuming that each pixel is represented by 8 bits,
the image is composed of 8 1-bit planes.
– Plane 0 contains the least significant bit and plane 7
contains the most significant bit.
– Only the higher order bits (top four) contain visually
significant data. The other bit planes contribute the
more subtle details.
– Plane 7 corresponds exactly with an image thresholded
at gray level 128.
Sunday, December 18, 2022 110
Image Enhancement(Cont…)
• Bit-Plane Slicing
Sunday, December 18, 2022 111
Image Enhancement(Cont…)
• Histogram Processing
 Two Types : (a). Histogram Stretching (b). Histogram
equalization
 Histogram Stretching
 Contrast is the difference between maximum and
minimum pixel intensity.
 Pictorial view to represent the distribution of pixel which
tell frequency of pixel.
Sunday, December 18, 2022 112
Image Enhancement(Cont…)
• The histogram of digital image with gray values
is the discrete function
Sunday, December 18, 2022 113
1
1
0 ,
,
, 
L
r
r
r 
n
n
r
p k
k 
)
(
nk: Number of pixels with gray value rk
n: total Number of pixels in the image
The function p(rk) represents the fraction of the total
number of pixels with gray value rk.
The shape of a histogram provides useful information for
contrast enhancement.
Image Enhancement(Cont…)
• Histogram Processing
Sunday, December 18, 2022 114
Dark image
Bright image
Image Enhancement(Cont…)
• Histogram Processing
Sunday, December 18, 2022 115
Low contrast image
High contrast image
Image Enhancement(Cont…)
• Histogram Stretching
Sunday, December 18, 2022 116
Image Enhancement(Cont…)
• Histogram Stretching (cont…)
• In the above example (0,8) is smin and smax respectively and
rmin = 0 , rmax = 4 is given.
• S-0 = (8 – 0) / (4 – 0) * (r – 0)
• s=(8/4) r
• S= 2r
• Now we have a relation between r and s.
• So get different values of ‘s’ for given rmin to rmax .
Sunday, December 18, 2022 117
Image Enhancement(Cont…)
• Histogram Stretching (cont…)
Sunday, December 18, 2022 118
Image Enhancement(Cont…)
• Histogram Stretching
Sunday, December 18, 2022 119
Image Enhancement(Cont…)
• Histogram Stretching
Sunday, December 18, 2022 120
Image Enhancement(Cont…)
• Histogram Equalization
– Recalculate the picture gray levels to make the
distribution more equalized
– Used widely in image editing tools and computer
vision algorithms
– Can also be applied to color images
Sunday, December 18, 2022 121
Objective of histogram equalization
• We want to find T(r) so that
Ps(s) is a flat line.
Historgram, color v.4e
122
sk
rk
L-1
L-1 r
T(r)
0
Objective:
To find the
Relation s=T(r)
Pr(r)
r
Ps(s)=a constant
s
L-1
L-1
L-1
Equalized distribution
Input random distribution
The original image
The probability of
these levels are lower)
The probability of
these levels are higher
The probability of all
levels are the same
In Ps(s)
s=T(r)
we want to prove ps(s)= constant
)
3
(
calculus
of
thorem
l
Fundementa
•
)
2
(
)
(
)
(
)
(
)
(
by
sides
both
ate
differenti
1
)
(
)
(
Theory
y
probabilit
Basic
•















x
a
s
r
r
s
r
s
f(x)
f(t)dt
dx
d
dr
ds
s
p
r
p
ds
dr
r
p
s
p
ds
dr
r
p
ds
s
p
constant
1
1
)
(
show
(3)
and
(2)
(1),
formula
and
formula
above
with the
continue
:
Exercise
...
)
(
)
1
(
)
(
)
1
(
)
(
)
1
(
)
(
:
)
1
(
,
)
(
)
(
Since
0
0









 












L
s
p
dr
dw
w
p
L
d
dr
r
dT
dr
ds
dw
w
p
L
r
T
s
from
dr
r
dT
dr
ds
r
T
s
s
r
r
r
r
123
•
 





r
r dw
w
p
L
r
T
s
0
)
1
(
)
(
)
1
(
)
(
Image Enhancement(Cont…)
• Histogram Equalization
Sunday, December 18, 2022 124
• Let rk, k[0..L-1] be intensity levels and let p(rk) be its
normalized histogram function.
• Histogram equalization is applying the transformation of
‘r’ to get ‘s’ where ‘r’ belongs to 0 to L-1.
• As, T(r) is continuous & differentiable
ʃPss ds=ʃprr dr =1
differentiating w.r.t ‘s’ we get :
Image Enhancement(Cont…)
• Histogram Equalization(cont…)
 So, e.q. (1)
 The transformation function T(r) for histogram
equalization is :
 Differentiate w.r.t ‘r’ :
 As we know, , SO,
 From eq.(1) we get, which is a constant.
Sunday, December 18, 2022 125
s
p
r
p
dr
ds
s
r





r
r dw
w
p
L
r
T
S
0
)
(
)
1
(
)
(




r
r dw
w
p
dr
d
L
r
T
dr
d
dr
ds
0
)
(
)
1
(
)
(
Histogram Equalization : Discrete form for
practical use
• From the continuous form (1) to discrete form
1
,..,
2
,
1
,
0
,
1
make
to
need
we
,
)
(
If
:
histogram
normlzied
a
obtain
that to
Recall
)
(
)
1
(
)
(
)
1
(
)
(
)
1
(
)
(
0
0
0



















L
k
n
MN
L
s
MN
n
r
p
r
P
L
r
T
s
dw
w
p
L
r
T
s
k
j
j
k
k
k
k
j
j
r
k
k
r
r
126
Histogram Equalization - Example
• Let f be an image with size 64x64 pixels and L=8 and let f has the intensity
distribution as shown in the table
p r(rk )=nk/MN
nk
rk
0.19
790
0
0.25
1023
2
0.21
850
1
0.16
656
3
0.08
329
4
0.06
245
5
0.03
122
6
0.02
81
7
.
00
.
7
,
86
.
6
,
65
.
6
,
23
.
6
,
67
.
5
,
55
.
4
08
.
3
))
(
)
(
(
7
)
(
7
)
(
33
.
1
)
(
7
)
(
7
)
(
7
6
5
4
3
2
1
0
1
0
1
1
0
0
0
0
0



















s
s
s
s
s
s
r
p
r
p
r
p
r
T
s
r
p
r
p
r
T
s
r
r
j
j
r
r
j
j
r
round the values to the nearest integer
Sunday, December 18, 2022 128
Histogram Equalization - Example
Sunday, December 18, 2022 129
Histogram Equalization - Example
Sunday, December 18, 2022 130
Filtering
• Image filtering is used to:
 Remove noise
 Sharpen contrast
 Highlight contours
 Detect edges
 Image filters can be classified as linear or nonlinear.
 Linear filters are also know as convolution filters as
they can be represented using a matrix multiplication.
 Thresholding and image equalisation are examples of
nonlinear operations, as is the median filter.
Sunday, December 18, 2022 131
Filtering(cont…)
• There are two types of processing:
• Point Processing (eg. Histogram equalization)
• Mask Processing
 Two types of filtering methods:
• Smoothing
Linear (Average Filter) and Non-Linear (Median
Filter)
• Sharpening
Laplacian
Gradient
Sunday, December 18, 2022 132
Filtering(Cont…)
Sunday, December 18, 2022 133
output image
Filtering(Cont…)
• Correlation [ 1-D & 2-D]
• Convolution [ 1-D & 2-D]
• In correlation we use weight to get output image and for
applying convolution we just rotate the weight 180
degree.
• Eg. Weight
• After 180 degree rotation
• After 180 degree rotation
Sunday, December 18, 2022 134
1 2 3
3 2 1
1 2 3
4 5 6
7 8 9
9 8 7
6 5 4
3 2 1
Filtering(Cont…)
• 1-D Correlation
• I =
• W=
• Output =
• For convolution just rotate mask 180 degree.
Sunday, December 18, 2022 135
1 2 3 4
1 2 3
[(2*1)+(3*2)]
8
[(1*1)+(2*2)+
(3*3)]
14
[(1*2)+(2*3)+
(3*4)]
20
[(1*3)+(4*2)]
11
Filtering(Cont…)
• A filtering method is linear when the output is a
weighted sum of the input pixels. Eg. Average filter
• Methods that do not satisfy the above property are
called non-linear. Eg. Median filter
• Average (or mean) filtering is a method of ‘smoothing’
images by reducing the amount of intensity variation
between neighbouring pixels.
• The average filter works by moving through the image
pixel by pixel, replacing each value with the average value
of neighbouring pixels, including itself.
Sunday, December 18, 2022 136
Filtering(Cont…)
• Average filter mask (2-D):
Sunday, December 18, 2022 137
Filtering(Cont…)
Sunday, December 18, 2022 138
Filtering(Cont…)
Sunday, December 18, 2022 139
Filtering(Cont…)
Sunday, December 18, 2022 140
Filtering(Cont…)
Sunday, December 18, 2022 141
Filtering(Cont…)
Sunday, December 18, 2022 142
Filtering(Cont…)
• When we apply average filter noise is removed
but blurring is introduced and to remove blurring
we use weighted filter.
Sunday, December 18, 2022 143
Filtering(Cont…)
• Median Filter (non-linear filter)
• Very effective in removing salt and pepper or impulsive noise
while preserving image detail
• Disadvantages: computational complexity, non linear filter
• The median filter works by moving through the image pixel by
pixel, replacing each value with the median value of
neighbouring pixels.
• The pattern of neighbours is called the "window", which
slides, pixel by pixel over the entire image 2 pixel, over the
entire image.
• The median is calculated by first sorting all the pixel values
from the window into numerical order, and then replacing the
pixel being considered with the middle (median) pixel value.
Sunday, December 18, 2022 144
Filtering(Cont…)
• Median Filter Example:
Sunday, December 18, 2022 145
Filtering(Cont…)
Sunday, December 18, 2022 146
Filtering(Cont…)
Sunday, December 18, 2022 147
Filtering(Cont…)
Sunday, December 18, 2022 148
Filtering(Cont…)
Sunday, December 18, 2022 149
Filtering(Cont…)
Sunday, December 18, 2022 150
• From left to right: the results of a 3 x 3, 5 x 5 and 7 x 7 median filter
Filtering(Cont…)
 Sharpening(high pass filter) is performed by noting only the
gray level changes in the image that is the differentiation.
• Sharpening is used for edge detection ,line detection, point
detection and it also highlight changes.
 Operation of Image Differentiation
• Enhance edges and discontinuities (magnitude of output gray
level >>0)
• De-emphasize areas with slowly varying gray-level values
(output gray level: 0)
 Mathematical Basis of Filtering for Image Sharpening
• First-order and second-order derivatives
• Approximation in discrete-space domain
• Implementation by mask filtering
Sunday, December 18, 2022 151
Filtering(Cont…)
 Common sharpening filters:
• Gradient (1st order derivative)
• Laplacian (2nd order derivative)
• Taking the derivative of an image results in sharpening
the image.
• The derivative of an image (i.e., 2D function) can be
computed using the gradient.
Sunday, December 18, 2022 152
Filtering(Cont…)
 Gradient (rotation variant or non-isotropic)
Sunday, December 18, 2022 153
or
Sensitive to
vertical
edges
Sensitive to
horizontal
edges
Filtering(Cont…)
 Gradient
Sunday, December 18, 2022 154
Kernels used in prewitt edge detection
Filtering(Cont…)
• Laplacian
Sunday, December 18, 2022 155
Original Mask
, C = +1 or C= -1
Filtering(Cont…)
• Laplacian(rotation invariant or isotropic)
Sunday, December 18, 2022 156
(b)Extended
Laplacian
mask to
increase
sharpness
and it covers
diagonal
also, so ,
provide good
results.
Image Transforms
• Many times, image processing tasks are best
performed in a domain other than the spatial
domain.
• Key steps
(1) Transform the image
(2) Carry the task(s) in the transformed domain.
(3) Apply inverse transform to return to the spatial
domain.
Math Review - Complex numbers
• Real numbers:
1
-5.2

• Complex numbers
4.2 + 3.7i
9.4447 – 6.7i
-5.2 (-5.2 + 0i)
1


i
We often denote in EE i by j
Math Review - Complex numbers
• Complex numbers
4.2 + 3.7i
9.4447 – 6.7i
-5.2 (-5.2 + 0i)
• General Form
Z = a + bi
Re(Z) = a
Im(Z) = b
• Amplitude
A = | Z | = √(a2 + b2)
• Phase
 =  Z = tan-1(b/a)
Real and imaginary parts
Math Review – Complex Numbers
• Polar Coordinate
Z = a + bi
• Amplitude
A = √(a2 + b2)
• Phase
 = tan-1(b/a)
a
b


A

Math Review – Complex Numbers and
Cosine Waves
• Cosine wave has three properties
– Frequency
– Amplitude
– Phase
• Complex number has two properties
– Amplitude
– Wave
• Complex numbers to represent cosine waves at varying frequency
– Frequency 1: Z1 = 5 +2i
– Frequency 2: Z2 = -3 + 4i
– Frequency 3: Z3 = 1.3 – 1.6i
Simple but great idea !!
Fourier Transforms & its Properties
• Jean Baptiste Joseph Fourier (1768-1830)
Sunday, December 18, 2022 162
• Had crazy idea (1807):
• Any periodic function can be
rewritten as a weighted sum of
Sines and Cosines of different
frequencies.
• Don’t believe it?
– Neither did Lagrange,
Laplace, Poisson and other
big wigs
– Not translated into English
until 1878!
• But it’s true!
– called Fourier Series
– Possibly the greatest tool
used in Engineering
Fourier Transforms & its Properties
• In image processing:
– Instead of time domain: spatial domain (normal image
space)
– frequency domain: space in which each image value at
image position F represents the amount that the
intensity values in image I vary over a specific distance
related to F
Sunday, December 18, 2022 163
Fourier Transforms & its Properties
• Fourier Transforms & Inverse Fourier Transforms
Sunday, December 18, 2022 164
Fourier Transforms & its Properties
Sunday, December 18, 2022 165
Fourier Transforms & its Properties
Sunday, December 18, 2022 166
Fourier Transforms & its Properties
Sunday, December 18, 2022 167
Fourier Transforms & its Properties
• As we deal with 2-d discrete images so we need to
discuss 2-D discrete Fourier Transforms.
Sunday, December 18, 2022 168
Fourier Transforms & its Properties
• Inverse F.T
Sunday, December 18, 2022 169
Fourier Transforms & its Properties
• If the image is represented as square array i.e.,
M=N than F.T and I.F.T is given by equation:
Sunday, December 18, 2022 170
Fourier Transforms & its Properties
Sunday, December 18, 2022 171
Fourier Transforms & its Properties
• Separability property
Sunday, December 18, 2022 172
Fourier Transforms & its Properties
Sunday, December 18, 2022 173
Fourier Transforms & its Properties
• Periodicity: The DFT and its inverse are periodic wit
period N.
Sunday, December 18, 2022 174
Fourier Transforms & its Properties
Sunday, December 18, 2022 175
• Scaling: If a signal is multiply by a scalar quantity ‘a’
than its Fourier Transformation is also multiplied by
same scalar quantity ‘a’.
Fourier Transforms & its Properties
• Distributivity:
Sunday, December 18, 2022 176
but …
Fourier Transforms & its Properties
• Average:
Sunday, December 18, 2022 177
Average:
F(u,v) at u=0, v=0:
So:
Fourier Transforms & its Properties
Sunday, December 18, 2022 178
Frequency Domain Filters
Frequency Domain Filters
Frequency Domain Filters
• Low pass filter: it allows low frequency range signal to pass as
output.(Useful for noise suppression)
• High pass filter: it allows high pass frequency range to pass as
output. (Useful for edge detection)
• D(u,v) is distance of (u , v) in frequency domain from the origin of
the frequency rectangle.
• Do implies that all signals lies in this range i.e., D(u,v)<= Do all
low pass frequency to pass to the output and rest are not allowed
to pass as output.
Frequency Domain Filters
Frequency domain filters
Frequency Domain Filters
• In the above example, for the same cut of
frequency the blurring is more in Ideal low
pass filter than in butterworth filter and as cut
of frequency increases the number of
undesired lines are increased in Ideal low pass
filter than in butterworth filter.
Frequency domain filters
Frequency domain filters

More Related Content

Similar to DIP-CHAPTERs

DIP Notes Unit-1 PPT , engineering, computer Science
DIP Notes Unit-1 PPT , engineering, computer ScienceDIP Notes Unit-1 PPT , engineering, computer Science
DIP Notes Unit-1 PPT , engineering, computer Science
baaburao4200
 
Unit-1Chapter-1Lecture-2.pptxkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk...
Unit-1Chapter-1Lecture-2.pptxkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk...Unit-1Chapter-1Lecture-2.pptxkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk...
Unit-1Chapter-1Lecture-2.pptxkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk...
MonikaSharma151258
 
Week06 bme429-cbir
Week06 bme429-cbirWeek06 bme429-cbir
Week06 bme429-cbirIkram Moalla
 
DIP-Questions.pdf
DIP-Questions.pdfDIP-Questions.pdf
DIP-Questions.pdf
AratiKothari2
 
Chapter01 (2)
Chapter01 (2)Chapter01 (2)
Chapter01 (2)
shabanam tamboli
 
computervision1.pdf it is about computer vision
computervision1.pdf it is about computer visioncomputervision1.pdf it is about computer vision
computervision1.pdf it is about computer vision
shesnasuneer
 
CHAPTER_1_updated_8_aug.ppt
CHAPTER_1_updated_8_aug.pptCHAPTER_1_updated_8_aug.ppt
CHAPTER_1_updated_8_aug.ppt
BUCHUPALLIVIMALAREDD2
 
PPT s06-machine vision-s2
PPT s06-machine vision-s2PPT s06-machine vision-s2
PPT s06-machine vision-s2
Binus Online Learning
 
1 [Autosaved].pptx
1 [Autosaved].pptx1 [Autosaved].pptx
1 [Autosaved].pptx
SsdSsd5
 
Chap_1_Digital_Image_Fundamentals_DD (2).pdf
Chap_1_Digital_Image_Fundamentals_DD (2).pdfChap_1_Digital_Image_Fundamentals_DD (2).pdf
Chap_1_Digital_Image_Fundamentals_DD (2).pdf
MrNeon5
 
Image characterisation &amp; aerial photographic film technology
Image characterisation &amp; aerial photographic film technologyImage characterisation &amp; aerial photographic film technology
Image characterisation &amp; aerial photographic film technology
pritiverma34
 
It 603
It 603It 603
It 603
vanaja nakka
 
It 603
It 603It 603
It 603
vanaja nakka
 
Computer Vision - Image Formation.pptx
Computer Vision - Image Formation.pptxComputer Vision - Image Formation.pptx
Computer Vision - Image Formation.pptx
AmmarahMajeed
 
Chapter 1 and 2 gonzalez and woods
Chapter 1 and 2 gonzalez and woodsChapter 1 and 2 gonzalez and woods
Chapter 1 and 2 gonzalez and woods
asodariyabhavesh
 
Human Visual System in Digital Image Processing.ppt
Human Visual System in Digital Image Processing.pptHuman Visual System in Digital Image Processing.ppt
Human Visual System in Digital Image Processing.ppt
GSCWU
 
Intro+Imaging.ppt
Intro+Imaging.pptIntro+Imaging.ppt
Intro+Imaging.ppt
shohel rana
 
Introduction to DIGITAL IMAGE PROCESSING - DAY 1
Introduction to DIGITAL IMAGE PROCESSING - DAY 1Introduction to DIGITAL IMAGE PROCESSING - DAY 1
Introduction to DIGITAL IMAGE PROCESSING - DAY 1
vijayanand Kandaswamy
 
Dip review
Dip reviewDip review
Dip review
Harish Reddy
 

Similar to DIP-CHAPTERs (20)

DIP Notes Unit-1 PPT , engineering, computer Science
DIP Notes Unit-1 PPT , engineering, computer ScienceDIP Notes Unit-1 PPT , engineering, computer Science
DIP Notes Unit-1 PPT , engineering, computer Science
 
Unit-1Chapter-1Lecture-2.pptxkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk...
Unit-1Chapter-1Lecture-2.pptxkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk...Unit-1Chapter-1Lecture-2.pptxkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk...
Unit-1Chapter-1Lecture-2.pptxkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk...
 
Week06 bme429-cbir
Week06 bme429-cbirWeek06 bme429-cbir
Week06 bme429-cbir
 
DIP-Questions.pdf
DIP-Questions.pdfDIP-Questions.pdf
DIP-Questions.pdf
 
Chapter01 (2)
Chapter01 (2)Chapter01 (2)
Chapter01 (2)
 
computervision1.pdf it is about computer vision
computervision1.pdf it is about computer visioncomputervision1.pdf it is about computer vision
computervision1.pdf it is about computer vision
 
CHAPTER_1_updated_8_aug.ppt
CHAPTER_1_updated_8_aug.pptCHAPTER_1_updated_8_aug.ppt
CHAPTER_1_updated_8_aug.ppt
 
PPT s06-machine vision-s2
PPT s06-machine vision-s2PPT s06-machine vision-s2
PPT s06-machine vision-s2
 
1 [Autosaved].pptx
1 [Autosaved].pptx1 [Autosaved].pptx
1 [Autosaved].pptx
 
It 603
It 603It 603
It 603
 
Chap_1_Digital_Image_Fundamentals_DD (2).pdf
Chap_1_Digital_Image_Fundamentals_DD (2).pdfChap_1_Digital_Image_Fundamentals_DD (2).pdf
Chap_1_Digital_Image_Fundamentals_DD (2).pdf
 
Image characterisation &amp; aerial photographic film technology
Image characterisation &amp; aerial photographic film technologyImage characterisation &amp; aerial photographic film technology
Image characterisation &amp; aerial photographic film technology
 
It 603
It 603It 603
It 603
 
It 603
It 603It 603
It 603
 
Computer Vision - Image Formation.pptx
Computer Vision - Image Formation.pptxComputer Vision - Image Formation.pptx
Computer Vision - Image Formation.pptx
 
Chapter 1 and 2 gonzalez and woods
Chapter 1 and 2 gonzalez and woodsChapter 1 and 2 gonzalez and woods
Chapter 1 and 2 gonzalez and woods
 
Human Visual System in Digital Image Processing.ppt
Human Visual System in Digital Image Processing.pptHuman Visual System in Digital Image Processing.ppt
Human Visual System in Digital Image Processing.ppt
 
Intro+Imaging.ppt
Intro+Imaging.pptIntro+Imaging.ppt
Intro+Imaging.ppt
 
Introduction to DIGITAL IMAGE PROCESSING - DAY 1
Introduction to DIGITAL IMAGE PROCESSING - DAY 1Introduction to DIGITAL IMAGE PROCESSING - DAY 1
Introduction to DIGITAL IMAGE PROCESSING - DAY 1
 
Dip review
Dip reviewDip review
Dip review
 

Recently uploaded

Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
AafreenAbuthahir2
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
Kamal Acharya
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
Jayaprasanna4
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
addressing modes in computer architecture
addressing modes  in computer architectureaddressing modes  in computer architecture
addressing modes in computer architecture
ShahidSultan24
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
ankuprajapati0525
 
Event Management System Vb Net Project Report.pdf
Event Management System Vb Net  Project Report.pdfEvent Management System Vb Net  Project Report.pdf
Event Management System Vb Net Project Report.pdf
Kamal Acharya
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
seandesed
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
AhmedHussein950959
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
Democratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek AryaDemocratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek Arya
abh.arya
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
Divya Somashekar
 

Recently uploaded (20)

Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
ethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.pptethical hacking in wireless-hacking1.ppt
ethical hacking in wireless-hacking1.ppt
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
addressing modes in computer architecture
addressing modes  in computer architectureaddressing modes  in computer architecture
addressing modes in computer architecture
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
 
Event Management System Vb Net Project Report.pdf
Event Management System Vb Net  Project Report.pdfEvent Management System Vb Net  Project Report.pdf
Event Management System Vb Net Project Report.pdf
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
Democratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek AryaDemocratizing Fuzzing at Scale by Abhishek Arya
Democratizing Fuzzing at Scale by Abhishek Arya
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
 

DIP-CHAPTERs

  • 2. Image Processing Books • Gonzalez, R. C. and Woods, R. E., "Digital Image Processing", Prentice Hall. • Jain, A. K., "Fundamentals of Digital Image Processing", PHI Learning, 1 st Ed. • Bernd, J., "Digital Image Processing", Springer, 6 th Ed. • Burger, W. and Burge, M. J., "Principles of Digital Image Processing", Springer • Scherzer, O., " Handbook of Mathematical Methods in Imaging", Springer Sunday, December 18, 2022 2
  • 3. Why we need Image Processing? • Improvement of pictorial information for human perception • Image processing for autonomus machine applications • Efficient storage and transmission Sunday, December 18, 2022 3
  • 4. What is digital image processing? • An image may be defined as a two dimensional function f(x,y), where ‘x’ and ‘y’ are spatial(plane) coordinates and the amplitude of ‘f’ at any pair of coordinates (x,y) is called the intensity or gray level of the image at that point. • When x,y, and the amplitude values of ‘f’ are all finite, descrete quantities we call the image a digital image. • The field of digital image processing refers to processing digital images by means of digital computers. Sunday, December 18, 2022 4
  • 5. What is digital image processing? (Cont…) Sunday, December 18, 2022 5
  • 6. Image Processing Applications • Automobile driver assistance – Lane departure warning – Adaptive cruise control – Obstacle warning • Digital Photography – Image Enhancement – Compression – Color manipulation – Image editing – Digital cameras • Sports analysis – sports refereeing and commentary – 3D visualization and tracking sports actions Sunday, December 18, 2022 6
  • 7. Image Processing Applications(Cont…) • Film and Video – Editing – Special effects • Image Database – Content based image retrieval – visual search of products – Face recognition • Industrial Automation and Inspection – vision-guided robotics – Inspection systems • Medical and Biomedical – Surgical assistance – Sensor fusion – Vision based diagnosis • Astronomy – Astronomical Image Enhancement – Chemical/Spectral Analysis Sunday, December 18, 2022 7
  • 8. Image Processing Applications(Cont...) • Arial Photography – Image Enhancement – Missile Guidance – Geological Mapping • Robotics – Autonomous Vehicles • Security and Safety – Biometry verification (face, iris) – Surveillance (fences, swimming pools) • Military – Tracking and localizing – Detection – Missile guidance • Traffic and Road Monitoring – Traffic monitoring – Adaptive traffic lights Sunday, December 18, 2022 8
  • 9. Brief History of IP • In 1920s, submarine cables were used to transmit digitized newspaper pictures between London & New York – using Bartlane cable picture transmission System. • Specialized printing equipments(eg. Telegraphic printer) used to code the picture for cable transmission and its reproduction on the receiving end. • In 1921, printing procedure was changed to photographic reproduction from tapes perforated at telegraph receiving terminals. • This improved both tonal quality & resolution. Sunday, December 18, 2022 9
  • 10. Brief History of IP(Cont…) Sunday, December 18, 2022 10
  • 11. Brief History of IP(Cont…) • Bartlane system was capable of coding 5 distinct brightness levels. This was increased to 15 levels by 1929. • Improvement of processing techniques continued for next 35 years . • In 1964 computer processing techniques were used to improve the pictures of moon tranmitted by ranger 7 at Jet Propulsion Laboratory. • This was the basis of modern Image Processing techniques. Sunday, December 18, 2022 11
  • 12. Image Processing Steps Sunday, December 18, 2022 12
  • 13. Components of IP System Sunday, December 18, 2022 13
  • 14. Image Acquisition Process Sunday, December 18, 2022 14
  • 15. Image Sensing and Acquisition Sunday, December 18, 2022 15
  • 16. Image Sensing and Acquisition(Cont…) • Image acquisition using a single sensor Sunday, December 18, 2022 16
  • 17. Image Sensing and Acquisition(Cont…) • Using sensor strips Sunday, December 18, 2022 17
  • 18. Image Representation Sunday, December 18, 2022 18 x y IMAGE An image is a 2-D light intensity function F(X,Y). F(X,Y) = R(X,Y)* I(X,Y) , where R(X,Y) = Reflectivity of the surface of the corresponding image point. I(X,Y) = Intensity of the incident light. A digital image F(X,Y) is discretized both in spatial coordinates and brightness. It can be considered as a matrix whose row, column indices specify a point in the image & the element value identifies gray level value at that point known as pixel or pels.
  • 19. Image Representation (Cont..) Sunday, December 18, 2022 19 (0,0) (0,1) ... (0, 1) (1,0) (1,1) ... (1, 1) ( , ) ... ... ... ... ( 1,0) ( 1,1) ... ( 1, 1) f f f N f f f N f x y f M f M f M N                    Image Representation in Matrix form
  • 22. Image Representation (Cont..) Sunday, December 18, 2022 22 ( , ) ( , ) ( , ) ( , ): intensity at the point ( , ) ( , ): illumination at the point ( , ) (the amount of source illumination incident on the scene) ( , ): reflectance/transmissivity f x y i x y r x y f x y x y i x y x y r x y  at the point ( , ) (the amount of illumination reflected/transmitted by the object) where 0 < ( , ) < and 0 < ( , ) < 1 x y i x y r x y 
  • 23. Image Representation (Cont..) • By theory of real numbers : Between any two given points there are infinite number of points. • Now by this theory : An image should be represented by infinite number of points. Each such image point may contain one of the infinitely many possible intensity/color values needing infinite number of bits. Obviously such a representation is not possible in any digital computer. Sunday, December 18, 2022 23
  • 24. Image Sampling and Quantization • By above slides we came to know that we need to find some other way to represent an image in digital format. • So we will consider some discrete set of points known as grid and in each rectangular grid consider intensity of a particular point. This process is known as sampling. • Image representation by 2-d finite matrix – Sampling • Each matrix element represented by one of the finite set of discrete values - Quantization Sunday, December 18, 2022 24
  • 25. Sunday, December 18, 2022 25 Image Sampling and Quantization
  • 35. Colour Image Processing • Why we need CIP when we get information from black and white image itself? 1. Colour is a very powerful descriptor & using the colour information we can extract the objects of interest from an image very easily which is not so easy in some cases using black & white pr simple gray level image. 2. Human eyes can distinguish between thousands of colours & colour shades whereas when we talk about only black and white image or gray scale image we can distinguish only about dozens of intensity distinguishness or different gray levels. Sunday, December 18, 2022 35
  • 36. Color Image processing(Cont…) • The color that human perceive in an object = the light reflected from the object Illumination source scene reflection Humen eye
  • 37. Colour Image Processing(Cont...) • In CIP there are 2 major areas: 1.FULL CIP : Image which are acquired by full colour TV camera or by full color scanner, than, you find that all the colour you perceive they are present in the images. 2.PSEUDO CIP : Is a problem where we try to assign certain colours to a range of gray levels. Pseudo CIP is mostly used for human interpretation. So here it is very difficult to distinguish between two ranges which are very nearer to each other or gray intensity value are very near to each other. Sunday, December 18, 2022 37
  • 38. Colour Image Processing(Cont...) • Problem with CIP Interpretation of color from human eye is a psycophisological problem and we have not yet been fully understand what is the mechanism by which we really interpret a color. Sunday, December 18, 2022 38
  • 39. Colour Image Processing(Cont...) • In 1666 Isacc Newton discover color spectrum by optical prism. Sunday, December 18, 2022 39
  • 40. Colour Image Processing(Cont...) • We can perceive the color depending on the nature of light which is reflected by the object surface. • Spectrum of light or spectrum of energy in the visible range that we are able to perceive a color(400 nm to 700 nm) Sunday, December 18, 2022 40
  • 41. Colour Image Processing(Cont...) • Attribute of Light Achromatic Light : A light which has no color component i.e., the only attribute which describes that particular light is the intensity of the light. Chromatic Light : Contain color component. • 3 quantities that describe the quality of light: Radiance Luminance Brightness Sunday, December 18, 2022 41
  • 42. Colour Image Processing(Cont...) • Radiance : Total amount of energy which comes out of a light (Unit : watts) • Luminance : Amount of energy that is perceived by an observer (Unit : Lumens) • Brightness : It is a subjective thing. Practically we can’t measure brightness. We have 3 primary colors: Red Blue Green Sunday, December 18, 2022 42
  • 43. Colour Image Processing(Cont...) • Newton discovered 7 different color but only 3 colors i.e., red, green and blue are the primary colors. Why? Because by mixing these 3 colors in some proportion we can get all other colors. There are around 6-7 millions cone cells in our eyes which are responsible for color sensations. Around 65% cone cells are sensitive to red color. Around 33% cone cells are sensitive to green color. Around 2% cone cells are sensitive to blue color. Sunday, December 18, 2022 43
  • 44. Colour Image Processing(Cont...) • According to CIE standard Red have wavelength : 700 nm Green have wavelength : 546.1 nm Blue have wavelength : 435.6 nm But, practically : Red is sensitive to 450 nm to 700 nm Green is sensitive to 400 nm to 650 nm Blue is sensitive to 400 nm to 550 nm Sunday, December 18, 2022 44
  • 45. Colour Image Processing(Cont...) • Note : In practical no single wavelength can specify any particular color. • By spectrum color also we can see that there is no clear cut boundaries between any two color. • One color slowly or smoothly get merged into another color i.e., there is no clear cut boundary between transition of color in spectrum. • So, we can say a band of color give red, green and blue color sensation respectively. Sunday, December 18, 2022 45
  • 46. Colour Image Processing(Cont...) • Mixing of Primary color generates the secondary colors i.e.,  RED+BLUE=Magenta  GREEN+BLUE = Cyan  RED+GREEN = yellow • Here red, green and blue are the primary color and magenta, cyan and yellow are the secondary color. • Pigments : The primary color of pigment is defined as wavelength which are absorbed by the pigment and it reflect other wavelength. Sunday, December 18, 2022 46
  • 47. Colour Image Processing(Cont...) • Primary color of light should be opposite of primary color of pigment i.e., magenta , cyan and yellow are primary color of pigment. • If we mix red, green and blue color in appropriate proportion we get white light and similarly when we mix magenta, cyan and yellow we get black color. Sunday, December 18, 2022 47
  • 48. Colour Image Processing(Cont...) • For hardware i.e., camera, printer, display device, scanner this above concept of color is used i.e., concept of primary color component. • But when we perceive a color for human beings we don’t think that how much red,green and blue components are mixed in that particular color. • So the way by which we human differentiate or recognize or distinguish color are : Brightness, Hue and Saturation. Sunday, December 18, 2022 48
  • 49. Colour Image Processing(Cont...) • Spectrum colors are not diluted i.e., spectrum colors are fully saturated . It means no white light or white component are added to it. • Example: Pink is not spectrum color. Red + white = pink Here red is fully saturated. • So, Hue+Saturation indicates chromaticity of light and Brightness gives some sentation of intensity. Sunday, December 18, 2022 49
  • 50. Colour Image Processing(Cont...) • Brightness : Achromatic notion of Intensity. • Hue : It represents the dominant wavelength present in a mixture of colors. • Saturation : eg., when we say color is red i.e., we may have various shades of red. So saturation indicates what is the purity of red i.e., what is the amount of light which has been mixed to that particular color to make it a diluted one. Sunday, December 18, 2022 50
  • 51. Colour Image Processing(Cont...) • The amount of red, green and blue component is needed to get another color component is known as tristimulus. • Tristimulus = (X,Y,Z) • Chromatic cofficient for red = X/(X+Y+Z) , for green = Y/(X+Y+Z) , for blue = Z/(X+Y+Z). • Here X+Y+Z=1 • So any color can be specified by its chromatic cofficient or a color can be specified by a chromaticity diagram. Sunday, December 18, 2022 51
  • 52. Colour Image Processing(Cont...) • Here Z = 1-(X+Y) , In chromaticity diagram around the boundary we have all the color of the spectrum colors and point of equal energy is : white color. Sunday, December 18, 2022 52
  • 53. Colour Image Processing(Cont...) • Color Models : A coordinate system within which a specified color will be represented by a single point. • RGB , CMY , CMYK : Hardware oriented • HSI : Hue , Saturation and Intensity : Application oriented / Perception oriented • In HSI model : I part gives you gray scale information. H & S taken together gives us chromatic information. Sunday, December 18, 2022 53
  • 54. Colour Image Processing(Cont...) • RGB Color Model : Here a color model is represented by 3 primary colors i.e., red , green and blue. • In RGB color model we can have 224 different color combinations but practically 216 different colors can be represented by RGB model. • RGB color model is based on Cartesian coordinate system. • This is an additive color model • Active displays, such as computer monitors and television sets, emit combinations of red, green and blue light. Sunday, December 18, 2022 54
  • 55. Colour Image Processing(Cont...) • RGB Color Model Sunday, December 18, 2022 55
  • 56. Colour Image Processing(Cont...) • RGB Color Model • RGB 24-bit color cube is shown below Sunday, December 18, 2022 56
  • 57. Colour Image Processing(Cont...) • RGB example: Sunday, December 18, 2022 57 Original Green Band Blue Band Red Band
  • 58. Colour Image Processing(Cont...) • CMY Color Model : secondary colors of light, or primary colors of pigments & Used to generate hardcopy output Sunday, December 18, 2022 58 Source: www.hp.com Passive displays, such as colour inkjet printers, absorb light instead of emitting it. Combinations of cyan, magenta and yellow inks are used. This is a subtractive colour model.
  • 59. Colour Image Processing(Cont...) • Equal proportion of CMY gives a muddy black color i.e., it is not a pure black color. So, to get pure black color with CMY another component is also specified known as Black component i.e., we get CMYK model. • In CMYK “K” is the black component. Sunday, December 18, 2022 59                                 B G R Y M C 1 1 1
  • 60. Colour Image Processing(Cont...) • HSI Color Model (Based on human perception of colors ) • H = What is the dominant specified color present in a particular color. It is a subjective measure of color. • S = How much a pure spectrum color is really diluted by mixing white color to it i.e., Mixing more “white” with a color reduces its saturation. If we mix white color in different proportion with a color we get different shades of that color. • I = Chromatic notation of brightness of black and white image i.e., the brightness or darkness of an object. Sunday, December 18, 2022 60
  • 61. Colour Image Processing(Cont...) • HSI Color Model Sunday, December 18, 2022 61 H dominant wavelength S purity % white I Intensity
  • 62. Colour Image Processing(Cont...) • HSI Color Model Sunday, December 18, 2022 62 RGB -> HSI model
  • 63. Colour Image Processing(Cont...) • HSI Color Model Sunday, December 18, 2022 63
  • 64. Colour Image Processing(Cont...) • Pseudo-color Image Processing Pseudo-Color = False Color Assign colors to gray values based on a specified criterion For human visualization and interpretation of gray-scale events Intensity slicing Gray level to color transformations Sunday, December 18, 2022 64
  • 65. Colour Image Processing(Cont...) • Pseudo-color Image Processing(cont…) Intensity slicing  Here first consider an intensity image to be a 3D plane.  Place a plane which is parallel to XY plane(it will slice the plane into two different hubs).  We can assign different color on two different sides of the plane i.e., any pixel whose intensity level is above the plane will be coded with one color and any pixel below the plane will be coded with the other.  Level that lie on the plane itself may be arbitrarily assigned one of the two colors. Sunday, December 18, 2022 65
  • 66. Colour Image Processing(Cont...) Intensity slicing  Geometric interpretation of the intensity slicing technique Sunday, December 18, 2022 66
  • 67. Colour Image Processing(Cont...) Intensity slicing  Let we have total ‘L’ number of intensity values: 0 to (L-1)  L0 corresponds to black [ f(x , y) = 0]  LL-1 corresponds to white [ f(x , y) = L-1]  Suppose ‘P’ number of planes perpendicular to the intensity axis i.e., they are parallel to the image plane and these planes will be placed at the intensity values given by L1,L2,L3,………,LP.  Where , 0< P < L-1. Sunday, December 18, 2022 67
  • 68. Colour Image Processing(Cont...) • Intensity slicing  The P planes partition the gray scale(intensity) into (P+1) intervals, V1,V2,V3,………,VP+1.  Color assigned to location (x,y) is given by the relation f(x , y) = Ck if f(x , y) ∈ Vk Sunday, December 18, 2022 68
  • 69. Colour Image Processing(Cont...) • Intensity slicing Numerical Sunday, December 18, 2022 69
  • 70. Colour Image Processing(Cont...) • Intensity slicing Numerical Sunday, December 18, 2022 70
  • 71. Colour Image Processing(Cont...) • Intensity slicing  Give ROI(region of interest) one color and rest part other color  Keep ROI as it is and rest assign one color  Keep rest as it is and give ROI one color Sunday, December 18, 2022 71
  • 72. Colour Image Processing(Cont...) • Intensity slicing Example Sunday, December 18, 2022 72
  • 73. Colour Image Processing(Cont...) • Intensity slicing Example Sunday, December 18, 2022 73
  • 74. Colour Image Processing(Cont...) • Intensity slicing Example Sunday, December 18, 2022 74
  • 75. Colour Image Processing(Cont...) • Pseudo-coloring is also used from gray to color image transformation. • Gray level to color transformation Sunday, December 18, 2022 75
  • 76. Colour Image Processing(Cont...) • Gray level to color transformation fR(X,Y) = f(x,y) fG(X,Y) = 0.33f(x,y) fB(X,Y) = 0.11f(x,y)  Combining these 3 planes we get the pseudo color image.  Application of Pseudo CIP : Machine using at railways and airport for bag checking. Sunday, December 18, 2022 76
  • 77. Colour Image Processing(Cont...) • Gray level to color transformation Example Sunday, December 18, 2022 77
  • 78. Colour Image Processing(Cont...) • Gray level to color transformation Example Sunday, December 18, 2022 78
  • 79. Image Enhancement • Intensity Transformation Functions • Enhancing an image provides better contrast and a more detailed image as compare to non enhanced image. Image enhancement has very applications. It is used to enhance medical images, images captured in remote sensing, images from satellite e.t.c • The transformation function has been given below s = T ( r ) • where r is the pixels of the input image and s is the pixels of the output image. T is a transformation function that maps each value of r to each value of s. Sunday, December 18, 2022 79
  • 80. Image Enhancement(Cont…) • Image enhancement can be done through gray level transformations which are discussed below. • There are three basic gray level transformation. • Linear • Logarithmic • Power – law Sunday, December 18, 2022 80
  • 81. Image Enhancement(Cont…) • Linear Transformation  Linear transformation includes simple identity and negative transformation.  Identity transition is shown by a straight line. In this transition, each value of the input image is directly mapped to each other value of output image. That results in the same input image and output image. And hence is called identity transformation. • Negative Transformation  The second linear transformation is negative transformation, which is invert of identity transformation. In negative transformation, each value of the input image is subtracted from the L-1 and mapped onto the output image. Sunday, December 18, 2022 81
  • 83. Image Enhancement(Cont…) • Negative Transformation s = (L – 1) – r s = 255 – r Sunday, December 18, 2022 83
  • 84. Image Enhancement(Cont…) • Logarithmic Transformations  The log transformations can be defined by this formula s = c log(r + 1).  Where s and r are the pixel values of the output and the input image and c is a constant. The value 1 is added to each of the pixel value of the input image because if there is a pixel intensity of 0 in the image, then log (0) is equal to infinity. So 1 is added, to make the minimum value at least 1. Sunday, December 18, 2022 84
  • 85. Image Enhancement(Cont…) • Logarithmic Transformations  In log transformation we decrease the dynamic range of a particular intensity i.e., here intensity of the pixels are increased which we require to get more information. The maximum information is contained in the center pixel.  Log transformation is mainly applied in frequency domain. Sunday, December 18, 2022 85
  • 86. Image Enhancement(Cont…) • Logarithmic Transformation Sunday, December 18, 2022 86
  • 87. Image Enhancement(Cont…) • Power – Law transformations • This symbol γ is called gamma, due to which this transformation is also known as gamma transformation. Sunday, December 18, 2022 87 s = crγ, c,γ –positive constants curve the grayscale components either to brighten the intensity (when γ < 1) or darken the intensity (when γ > 1).
  • 88. Image Enhancement(Cont…) • Power – Law transformations Sunday, December 18, 2022 88
  • 89. Image Enhancement(Cont…) • Power – Law transformations • Variation in the value of γ varies the enhancement of the images. Different display devices / monitors have their own gamma correction, that’s why they display their image at different intensity. • This type of transformation is used for enhancing images for different type of display devices. The gamma of different display devices is different. For example Gamma of CRT lies in between of 1.8 to 2.5, that means the image displayed on CRT is dark. Sunday, December 18, 2022 89
  • 90. Image Enhancement(Cont…) • Power – Law transformations  Gamma Correction  Different camera or video recorder devices do not correctly capture luminance. (they are not linear) Different display devices (monitor, phone screen, TV) do not display luminance correctly neither. So, one needs to correct them, therefore the gamma correction function is needed. Gamma correction function is used to correct image's luminance. s=cr^γ s=cr^(1/2.5) Sunday, December 18, 2022 90
  • 93. Image Enhancement(Cont…) • Piecewise-Linear Transformation Functions  Three types:  Contrast Stretching  Intensity Level Slicing  Bit-Plane Slicing Sunday, December 18, 2022 93
  • 94. Image Enhancement(Cont…) • Contrast stretching  Aims increase the dynamic range of the gray levels in the image being processed.  Contrast stretching is a process that expands the range of intensity levels in a image so that it spans the full intensity range of the recording medium or display device.  Contrast-stretching transformations increase the contrast between the darks and the lights Sunday, December 18, 2022 94
  • 95. Image Enhancement(Cont…) • Contrast stretching Sunday, December 18, 2022 95
  • 96. Image Enhancement(Cont…) • Contrast stretching  The locations of (r1,s1) and (r2,s2) control the shape of the transformation function. – If r1= s1 and r2= s2 the transformation is a linear function and produces no changes. – If r1=r2, s1=0 and s2=L-1, the transformation becomes a thresholding function that creates a binary image. – Intermediate values of (r1,s1) and (r2,s2) produce various degrees of spread in the gray levels of the output image, thus affecting its contrast. – Generally, r1≤r2 and s1≤s2 is assumed. Sunday, December 18, 2022 96
  • 97. Image Enhancement(Cont…) Sunday, December 18, 2022 97 Thresholding function
  • 108. Image Enhancement(Cont…) • Intensity-level slicing  Highlighting a specific range of gray levels in an image.  One way is to display a high value for all gray levels in the range of interest and a low value for all other gray levels (binary image).  The second approach is to brighten the desired range of gray levels but preserve the background and gray-level tonalities in the image Sunday, December 18, 2022 108
  • 109. Image Enhancement(Cont…) • Intensity Level Slicing Sunday, December 18, 2022 109
  • 110. Image Enhancement(Cont…) • Bit-Plane Slicing • To highlight the contribution made to the total image appearance by specific bits. – i.e. Assuming that each pixel is represented by 8 bits, the image is composed of 8 1-bit planes. – Plane 0 contains the least significant bit and plane 7 contains the most significant bit. – Only the higher order bits (top four) contain visually significant data. The other bit planes contribute the more subtle details. – Plane 7 corresponds exactly with an image thresholded at gray level 128. Sunday, December 18, 2022 110
  • 111. Image Enhancement(Cont…) • Bit-Plane Slicing Sunday, December 18, 2022 111
  • 112. Image Enhancement(Cont…) • Histogram Processing  Two Types : (a). Histogram Stretching (b). Histogram equalization  Histogram Stretching  Contrast is the difference between maximum and minimum pixel intensity.  Pictorial view to represent the distribution of pixel which tell frequency of pixel. Sunday, December 18, 2022 112
  • 113. Image Enhancement(Cont…) • The histogram of digital image with gray values is the discrete function Sunday, December 18, 2022 113 1 1 0 , , ,  L r r r  n n r p k k  ) ( nk: Number of pixels with gray value rk n: total Number of pixels in the image The function p(rk) represents the fraction of the total number of pixels with gray value rk. The shape of a histogram provides useful information for contrast enhancement.
  • 114. Image Enhancement(Cont…) • Histogram Processing Sunday, December 18, 2022 114 Dark image Bright image
  • 115. Image Enhancement(Cont…) • Histogram Processing Sunday, December 18, 2022 115 Low contrast image High contrast image
  • 116. Image Enhancement(Cont…) • Histogram Stretching Sunday, December 18, 2022 116
  • 117. Image Enhancement(Cont…) • Histogram Stretching (cont…) • In the above example (0,8) is smin and smax respectively and rmin = 0 , rmax = 4 is given. • S-0 = (8 – 0) / (4 – 0) * (r – 0) • s=(8/4) r • S= 2r • Now we have a relation between r and s. • So get different values of ‘s’ for given rmin to rmax . Sunday, December 18, 2022 117
  • 118. Image Enhancement(Cont…) • Histogram Stretching (cont…) Sunday, December 18, 2022 118
  • 119. Image Enhancement(Cont…) • Histogram Stretching Sunday, December 18, 2022 119
  • 120. Image Enhancement(Cont…) • Histogram Stretching Sunday, December 18, 2022 120
  • 121. Image Enhancement(Cont…) • Histogram Equalization – Recalculate the picture gray levels to make the distribution more equalized – Used widely in image editing tools and computer vision algorithms – Can also be applied to color images Sunday, December 18, 2022 121
  • 122. Objective of histogram equalization • We want to find T(r) so that Ps(s) is a flat line. Historgram, color v.4e 122 sk rk L-1 L-1 r T(r) 0 Objective: To find the Relation s=T(r) Pr(r) r Ps(s)=a constant s L-1 L-1 L-1 Equalized distribution Input random distribution The original image The probability of these levels are lower) The probability of these levels are higher The probability of all levels are the same In Ps(s) s=T(r)
  • 123. we want to prove ps(s)= constant ) 3 ( calculus of thorem l Fundementa • ) 2 ( ) ( ) ( ) ( ) ( by sides both ate differenti 1 ) ( ) ( Theory y probabilit Basic •                x a s r r s r s f(x) f(t)dt dx d dr ds s p r p ds dr r p s p ds dr r p ds s p constant 1 1 ) ( show (3) and (2) (1), formula and formula above with the continue : Exercise ... ) ( ) 1 ( ) ( ) 1 ( ) ( ) 1 ( ) ( : ) 1 ( , ) ( ) ( Since 0 0                        L s p dr dw w p L d dr r dT dr ds dw w p L r T s from dr r dT dr ds r T s s r r r r 123 •        r r dw w p L r T s 0 ) 1 ( ) ( ) 1 ( ) (
  • 124. Image Enhancement(Cont…) • Histogram Equalization Sunday, December 18, 2022 124 • Let rk, k[0..L-1] be intensity levels and let p(rk) be its normalized histogram function. • Histogram equalization is applying the transformation of ‘r’ to get ‘s’ where ‘r’ belongs to 0 to L-1. • As, T(r) is continuous & differentiable ʃPss ds=ʃprr dr =1 differentiating w.r.t ‘s’ we get :
  • 125. Image Enhancement(Cont…) • Histogram Equalization(cont…)  So, e.q. (1)  The transformation function T(r) for histogram equalization is :  Differentiate w.r.t ‘r’ :  As we know, , SO,  From eq.(1) we get, which is a constant. Sunday, December 18, 2022 125 s p r p dr ds s r      r r dw w p L r T S 0 ) ( ) 1 ( ) (     r r dw w p dr d L r T dr d dr ds 0 ) ( ) 1 ( ) (
  • 126. Histogram Equalization : Discrete form for practical use • From the continuous form (1) to discrete form 1 ,.., 2 , 1 , 0 , 1 make to need we , ) ( If : histogram normlzied a obtain that to Recall ) ( ) 1 ( ) ( ) 1 ( ) ( ) 1 ( ) ( 0 0 0                    L k n MN L s MN n r p r P L r T s dw w p L r T s k j j k k k k j j r k k r r 126
  • 127. Histogram Equalization - Example • Let f be an image with size 64x64 pixels and L=8 and let f has the intensity distribution as shown in the table p r(rk )=nk/MN nk rk 0.19 790 0 0.25 1023 2 0.21 850 1 0.16 656 3 0.08 329 4 0.06 245 5 0.03 122 6 0.02 81 7 . 00 . 7 , 86 . 6 , 65 . 6 , 23 . 6 , 67 . 5 , 55 . 4 08 . 3 )) ( ) ( ( 7 ) ( 7 ) ( 33 . 1 ) ( 7 ) ( 7 ) ( 7 6 5 4 3 2 1 0 1 0 1 1 0 0 0 0 0                    s s s s s s r p r p r p r T s r p r p r T s r r j j r r j j r round the values to the nearest integer
  • 128. Sunday, December 18, 2022 128
  • 129. Histogram Equalization - Example Sunday, December 18, 2022 129
  • 130. Histogram Equalization - Example Sunday, December 18, 2022 130
  • 131. Filtering • Image filtering is used to:  Remove noise  Sharpen contrast  Highlight contours  Detect edges  Image filters can be classified as linear or nonlinear.  Linear filters are also know as convolution filters as they can be represented using a matrix multiplication.  Thresholding and image equalisation are examples of nonlinear operations, as is the median filter. Sunday, December 18, 2022 131
  • 132. Filtering(cont…) • There are two types of processing: • Point Processing (eg. Histogram equalization) • Mask Processing  Two types of filtering methods: • Smoothing Linear (Average Filter) and Non-Linear (Median Filter) • Sharpening Laplacian Gradient Sunday, December 18, 2022 132
  • 133. Filtering(Cont…) Sunday, December 18, 2022 133 output image
  • 134. Filtering(Cont…) • Correlation [ 1-D & 2-D] • Convolution [ 1-D & 2-D] • In correlation we use weight to get output image and for applying convolution we just rotate the weight 180 degree. • Eg. Weight • After 180 degree rotation • After 180 degree rotation Sunday, December 18, 2022 134 1 2 3 3 2 1 1 2 3 4 5 6 7 8 9 9 8 7 6 5 4 3 2 1
  • 135. Filtering(Cont…) • 1-D Correlation • I = • W= • Output = • For convolution just rotate mask 180 degree. Sunday, December 18, 2022 135 1 2 3 4 1 2 3 [(2*1)+(3*2)] 8 [(1*1)+(2*2)+ (3*3)] 14 [(1*2)+(2*3)+ (3*4)] 20 [(1*3)+(4*2)] 11
  • 136. Filtering(Cont…) • A filtering method is linear when the output is a weighted sum of the input pixels. Eg. Average filter • Methods that do not satisfy the above property are called non-linear. Eg. Median filter • Average (or mean) filtering is a method of ‘smoothing’ images by reducing the amount of intensity variation between neighbouring pixels. • The average filter works by moving through the image pixel by pixel, replacing each value with the average value of neighbouring pixels, including itself. Sunday, December 18, 2022 136
  • 137. Filtering(Cont…) • Average filter mask (2-D): Sunday, December 18, 2022 137
  • 143. Filtering(Cont…) • When we apply average filter noise is removed but blurring is introduced and to remove blurring we use weighted filter. Sunday, December 18, 2022 143
  • 144. Filtering(Cont…) • Median Filter (non-linear filter) • Very effective in removing salt and pepper or impulsive noise while preserving image detail • Disadvantages: computational complexity, non linear filter • The median filter works by moving through the image pixel by pixel, replacing each value with the median value of neighbouring pixels. • The pattern of neighbours is called the "window", which slides, pixel by pixel over the entire image 2 pixel, over the entire image. • The median is calculated by first sorting all the pixel values from the window into numerical order, and then replacing the pixel being considered with the middle (median) pixel value. Sunday, December 18, 2022 144
  • 145. Filtering(Cont…) • Median Filter Example: Sunday, December 18, 2022 145
  • 150. Filtering(Cont…) Sunday, December 18, 2022 150 • From left to right: the results of a 3 x 3, 5 x 5 and 7 x 7 median filter
  • 151. Filtering(Cont…)  Sharpening(high pass filter) is performed by noting only the gray level changes in the image that is the differentiation. • Sharpening is used for edge detection ,line detection, point detection and it also highlight changes.  Operation of Image Differentiation • Enhance edges and discontinuities (magnitude of output gray level >>0) • De-emphasize areas with slowly varying gray-level values (output gray level: 0)  Mathematical Basis of Filtering for Image Sharpening • First-order and second-order derivatives • Approximation in discrete-space domain • Implementation by mask filtering Sunday, December 18, 2022 151
  • 152. Filtering(Cont…)  Common sharpening filters: • Gradient (1st order derivative) • Laplacian (2nd order derivative) • Taking the derivative of an image results in sharpening the image. • The derivative of an image (i.e., 2D function) can be computed using the gradient. Sunday, December 18, 2022 152
  • 153. Filtering(Cont…)  Gradient (rotation variant or non-isotropic) Sunday, December 18, 2022 153 or Sensitive to vertical edges Sensitive to horizontal edges
  • 154. Filtering(Cont…)  Gradient Sunday, December 18, 2022 154 Kernels used in prewitt edge detection
  • 155. Filtering(Cont…) • Laplacian Sunday, December 18, 2022 155 Original Mask , C = +1 or C= -1
  • 156. Filtering(Cont…) • Laplacian(rotation invariant or isotropic) Sunday, December 18, 2022 156 (b)Extended Laplacian mask to increase sharpness and it covers diagonal also, so , provide good results.
  • 157. Image Transforms • Many times, image processing tasks are best performed in a domain other than the spatial domain. • Key steps (1) Transform the image (2) Carry the task(s) in the transformed domain. (3) Apply inverse transform to return to the spatial domain.
  • 158. Math Review - Complex numbers • Real numbers: 1 -5.2  • Complex numbers 4.2 + 3.7i 9.4447 – 6.7i -5.2 (-5.2 + 0i) 1   i We often denote in EE i by j
  • 159. Math Review - Complex numbers • Complex numbers 4.2 + 3.7i 9.4447 – 6.7i -5.2 (-5.2 + 0i) • General Form Z = a + bi Re(Z) = a Im(Z) = b • Amplitude A = | Z | = √(a2 + b2) • Phase  =  Z = tan-1(b/a) Real and imaginary parts
  • 160. Math Review – Complex Numbers • Polar Coordinate Z = a + bi • Amplitude A = √(a2 + b2) • Phase  = tan-1(b/a) a b   A 
  • 161. Math Review – Complex Numbers and Cosine Waves • Cosine wave has three properties – Frequency – Amplitude – Phase • Complex number has two properties – Amplitude – Wave • Complex numbers to represent cosine waves at varying frequency – Frequency 1: Z1 = 5 +2i – Frequency 2: Z2 = -3 + 4i – Frequency 3: Z3 = 1.3 – 1.6i Simple but great idea !!
  • 162. Fourier Transforms & its Properties • Jean Baptiste Joseph Fourier (1768-1830) Sunday, December 18, 2022 162 • Had crazy idea (1807): • Any periodic function can be rewritten as a weighted sum of Sines and Cosines of different frequencies. • Don’t believe it? – Neither did Lagrange, Laplace, Poisson and other big wigs – Not translated into English until 1878! • But it’s true! – called Fourier Series – Possibly the greatest tool used in Engineering
  • 163. Fourier Transforms & its Properties • In image processing: – Instead of time domain: spatial domain (normal image space) – frequency domain: space in which each image value at image position F represents the amount that the intensity values in image I vary over a specific distance related to F Sunday, December 18, 2022 163
  • 164. Fourier Transforms & its Properties • Fourier Transforms & Inverse Fourier Transforms Sunday, December 18, 2022 164
  • 165. Fourier Transforms & its Properties Sunday, December 18, 2022 165
  • 166. Fourier Transforms & its Properties Sunday, December 18, 2022 166
  • 167. Fourier Transforms & its Properties Sunday, December 18, 2022 167
  • 168. Fourier Transforms & its Properties • As we deal with 2-d discrete images so we need to discuss 2-D discrete Fourier Transforms. Sunday, December 18, 2022 168
  • 169. Fourier Transforms & its Properties • Inverse F.T Sunday, December 18, 2022 169
  • 170. Fourier Transforms & its Properties • If the image is represented as square array i.e., M=N than F.T and I.F.T is given by equation: Sunday, December 18, 2022 170
  • 171. Fourier Transforms & its Properties Sunday, December 18, 2022 171
  • 172. Fourier Transforms & its Properties • Separability property Sunday, December 18, 2022 172
  • 173. Fourier Transforms & its Properties Sunday, December 18, 2022 173
  • 174. Fourier Transforms & its Properties • Periodicity: The DFT and its inverse are periodic wit period N. Sunday, December 18, 2022 174
  • 175. Fourier Transforms & its Properties Sunday, December 18, 2022 175 • Scaling: If a signal is multiply by a scalar quantity ‘a’ than its Fourier Transformation is also multiplied by same scalar quantity ‘a’.
  • 176. Fourier Transforms & its Properties • Distributivity: Sunday, December 18, 2022 176 but …
  • 177. Fourier Transforms & its Properties • Average: Sunday, December 18, 2022 177 Average: F(u,v) at u=0, v=0: So:
  • 178. Fourier Transforms & its Properties Sunday, December 18, 2022 178
  • 179.
  • 182. Frequency Domain Filters • Low pass filter: it allows low frequency range signal to pass as output.(Useful for noise suppression) • High pass filter: it allows high pass frequency range to pass as output. (Useful for edge detection) • D(u,v) is distance of (u , v) in frequency domain from the origin of the frequency rectangle. • Do implies that all signals lies in this range i.e., D(u,v)<= Do all low pass frequency to pass to the output and rest are not allowed to pass as output.
  • 185. Frequency Domain Filters • In the above example, for the same cut of frequency the blurring is more in Ideal low pass filter than in butterworth filter and as cut of frequency increases the number of undesired lines are increased in Ideal low pass filter than in butterworth filter.