Film Photography: Imaging
Film Photography: Imaging
IMAGING
Film photography
Time consuming
250
200
150
100
50
signal
Synthetic Aperture Radar (SAR)
Environmental monitoring, earth-
resource mapping, and military
systems
k-space
IFT
Fluorescence Microscopy Imaging
Operate in ultraviolet frequency
chest head
Positron Emission Tomography
Operate in gamma-ray frequency
Application of CCD::
• Any digital imaging device
• Night vision
Why image processing?
• Radar and sonar images are used for detection and recognition of
various types of targets or in guidance and maneuvering of aircraft
or missile system.
Through mobile
Diagnosis app for plants
Image processing techniques learnt in this
course can be used in several other places
e.g. signal processing (FFT), filtering etc.
L-2
Real
Complex
How to obtain a digital image?
Imaging
system
Object
Sample &
quantize
Display
Record
A simple image formation method
IMAGE is defined by a two dimensional function f(x,y)
the image.
So, 0 f ( x, y ) ∞
f(x,y) depends on
1. amount of illumination of the source on the object (i(x,y))
f ( x, y ) i ( x, y ) r ( x, y ) l
where 0 i( x, y)
and l = gray level of the monochrome image
0 r ( x, y) 1
So, Lmin 0
Lmax L 1 ( say )
The interval [0, L 1] is defined as GRAYSCALE
l 0 black
l L 1 white
x, y vary from 0,1….. and are not the actual value of the physical coordinate
f (0,0) ......... .........
..... ......... ............
Digital image
..... f ( M 1, N 1) MxN
L 2k
Discrete levels are equally spaced and they are integers in the level
b M N k
L = 28
b=MxNx8
Spatial and gray level resolution
Spatial resolution :
It depends on sampling.
w
A B A B A B A B
Sub-sampling
Sub-sampled image is scaled to the original one
• The spatial resolution goes down due to sub-sampling
Gray level resolution :
gray level.
6
2 25
24 2 3
22 21
L-3
N and k are independent in the previous examples
Huang’s experiment
Isopreferential lines
255
f
0
x
Zooming and Shrinking the digital images
Bilinear interpolation :
by an integer value.
• Enhancement is needed for better representation
Two categories
g( x, y ) T [ f ( x, y )]
where f ( x , y ) Original image
g( x , y ) Processed image
of (x,y)
Subimage
The subimages can be
Point Processing
g( x, y ) T [ f ( x, y )]
s T (r )
where s g( x , y )
r f ( x, y)
T is the gray level transformation function
Gray level transformation for contrast enhancement
Basic transformation functions for image enhancement
1. Linear (negative and identity transformation)
sr
Image negative
s L 1 r
For 8-bit image ; s 255 r
Log transformation
s c log(1 r )
Where c = constant; r0
Power law transformation
s cr
where
1
correction Dark levels have to be compressed
>1
Piecewise linear transformation function
Gray level slicing
• Compression
=
+
L-6
nH number of heads
nT number of tails
n total number of tossing
nH nT
1
n n
Important property: 0 P ( A) 1
F (a ) P ( x a )
1. F ( ) 0
2. F ( ) 1
3. 0 F ( x ) 1
4. F ( x1 ) F ( x 2 ) if x1 x 2
5. P ( x1 x x 2 ) F ( x 2 ) F ( x1 )
6. F ( x ) F ( x ) if x x , 0
Probability Density function (PDF) :
is defined as derivative of CDF
dF ( x )
p( x )
dx
Properties: 1. p( x ) 0 for all x
2. p( x )dx 1
x
3. F ( x ) p( )d
x2
4. P ( x1 x x 2 ) p( x )dx
x1
Histogram Processing
h( rk ) nk
h( rk ) nk
p( rk )
n n
p(r ) 1
k
k
p(rk) =h(rk)/n
rk = 255
p(r ) 1
k
k
Uniformly distributed
histogram yields
Hence, histogram
processing requires the
stretching of gray level
uniformly over the entire
gray level range.
p(r)
r =1
Histogram equalization
p(s)
s
0 1
1. Requires the distribution of histogram peaks
uniformly over the entire gray level range
• Continuous and
r 1 White
s T (r ) ; 0 r 1
Let us require that the transformation
function T(r) should satisfy
2. 0 ≤ T(r) ≤ 1 for 0 ≤ r ≤ 1
s
T(r) Single valued
and
monotonically increasing
r
s T(r) Not single valued
T(r)
s
r
Transformation Transformation
from black white from white black
Original negative 1st half identity
2nd half negative
Hence the requirements:
1. T(r) should be single valued which ensures the
output image
ps ( s ) ds pr ( r ) dr
To make the histogram uniform:
Put, ps ( s ) 1
ds pr ( r ) dr
s r
ds p ( ) d
0 0
r
r
s p ( ) d T (r )
0
r
r
s T (r )
0
pr ( ) d
nk
pr ( rk ) , k 0, 1, ..... L 1
n
k
sk T ( rk ) p (r )
j0
r j
k nj
sk T ( rk ) n
j 0
, for k 0, 1, ...., L 1
This will do the histogram equalization
AUTOMATICALLY
Problems:
L-7, 29/1/2014
Histogram equalization is not full proof method
to achieve auto contrast
Giving a transformation to the input image
predefined
Original histogram
A predefined histogram
pr(r)
pz(z)
z
r
How to transform???
r gray levels of the input image Random
z
G( z )
0
pz ( ) d s
Discrete form::
k
G( zk ) p (z ) s
i 0
z i k
Therefore,
G( z ) T ( r )
Hence,
1 1
z G ( s ) G [T ( r )]
STEPS for histogram matching
pr(r)
r
2. According to the definition of s, calculate
r
s T (r ) p ( ) d
0
r
pz(z)
z
z
s G( z ) p ( ) d
0
z
4. MAPPING of the variable r to z via s
transformation.
The last step:: s
sk
s
sk
z zk z
r
r
s
Image averaging
g( x , y ) f ( x , y ) ( x , y )
where
f ( x, y) Original image
( x, y) Noise
K
1
g( x , y )
K
g ( x, y)
i 1
i
1 K K
K i 1
fi
i 1
i
Take expectation either side
1 K K
E( g)
K i 1
E( fi )
i 1
E ( i )
E{ f i } f i
&
E{i } 0
E{ g( x, y)} f ( x, y)
K=8 K=16
K=64 K=128
How to remove people from the image????
How to remove vehicles from the image????
Scaling of the gray levels during mathematical
operation
+ =
unscaled scaled
-
unscaled
=
scaled