Mathematical Tools in DIP - 2
Mathematical Tools in DIP - 2
Mathematical Tools in DIP - 2
Operations
• Consider two 2 x 2 images
and
• = +
• To Test Linearity,
• LHS of eq(i): =
• RHS of eq(i): = -4
• LHS ≠ RHS
• So, max is non-linear operation.
Arithmetic Operations
• Arithmetic operations are array operations that are carried
out between corresponding pixel pairs.
• If a is not an element of A
• Single-pixel operations
s = T(z)
o z - intensity of a pixel in the original image
o s - (mapped) intensity of the corresponding pixel in the processed image.
• Neighborhood operations
• We can express the operation in equation form as
…..eq.(1)….eq.(1)
o f(x, y) - is the input image
o r(x, y, u, v) - is called the forward transformation kernel
o u – 0,1,2,…..,M-1
o v – 0,1,2,…..,N-1
• General approach for operating in the linear transform
domain.
o x, y - spatial variables
o u, v – transform variables
o M, N - row and column dimensions of f.
o T(u, v) - is called the forward transform of f(x, y).
• Given T(u, v) , we can recover f(x, y) using the inverse
transform of T(u, v),
….eq.(2)
o x – 0,1,2,…..,M-1
o y – 0,1,2,…..,N-1
o s(x, y, u, v) - is called the inverse transformation kernel.
• (a) Image corrupted by sinusoidal interference.
• (b) Magnitude of the Fourier transform.
(a) (b)
(c) (d)
• If B = A-1
It is purely subjective.
It is a cosmetic procedure.
Spatial domain
Frequency domain
Spatial Domain
where 0 – black ,
255 – white &
others - shades of gray
Spatial Domain
In an image with size 256 x 256, (x, y) can assume any value
from (0 , 0) to (255 , 255).
(0 , 0) Y
X (255, 255)
Spatial Domain
Applying transform modifies the image
f(x,y) = T g(x,y)
where,
g(x,y) is original image
T is transformation applied on g(x,y)
f(x,y) is new modified image
Digital Negative
Contrast Stretching
Thresholding
Gray level slicing
Bit plane slicing
Dynamic range compression
Point Processing
Identity Transformation:
255 T
Modified
Gray Level
125
s
10
0
10 125 255
Original Gray Level r
• In general, s = r
Point Processing
1) Digital Image Negative:
255
55
0 55 200 255
Input image intensity r
Point Processing
Digital Negative can be obtained by:
when, r = 0; s = 255
&if r = 255; s = 0
Generally, s = (L-1) –r
where, L – total number of gray levels (e.g. 256 for 8-bit image)
Point Processing
2) Contrast Stretching:
255
w (r2, s2) n
Output
Image
Intensity s m
level
(r1, s1)
v l
0 a b 255
r
Input Image Intensity level
Point Processing
Reasons:
Poor Illumination
Wrong setting of lens aperture
Idea behind Contrast Stretching is to make dark portion darker and bright
portion brighter.
In above figure, dotted line indicated Identity Transformation & solid line
indicates Contrast Stretching.
255
Output
Image
Intensity s
level
0 a 255
r
Input Image Intensity level
Point Processing
Extreme Contrast Stretching yields Thresholding.
In Contrast Stretching figure, if l & n slope are made ZERO & if m slope is
increased then we get Thresholding Transformation.
s = 0; if r ≤ a
s = L – 1 ; if r >a
where, L is number of Gray levels.
L-1 L-1
s s
0 a b L-1 0 a b L-1
r r
fig. (1) Slicing w/o background fig. (2) Slicing with background
Point Processing
Thresholding splits the image in 2 parts
1 0 0 0 1 0 0 0 0
0 1 0 0 1 1 1 0 0
1 1 0 1 0 1 1 1 0
r
At times, dynamic range of image exceeds the capability of display device.
Some pixel values are so large that the other low value pixel gets obscured.
E.g. stars in day time are not visible though present due to large intensity of
sun.
Formulation:
s = C.ln(1 + |r|)
where, C – normalization constant
r – input intensity
Point Processing
7) Power law Transform:
γ<1
s
γ=1
γ>1