SlideShare a Scribd company logo
1 of 54
Download to read offline
Digital Image
Processing
Mathematical tools used in DIP
By
Dr. K. M. Bhurchandi
Array versus Matrix
Operations
• Consider two 2 x 2 images
𝑎11 𝑎12
𝑎21 𝑎22
and
𝑏11 𝑏12
𝑏21 𝑏22
• Array Product is:
𝑎11𝑏11 𝑎12𝑏12
𝑎21𝑏21 𝑎22𝑏22
• Matrix Product is:
𝑎11𝑏11 + 𝑎12𝑏21 𝑎11𝑏12 + 𝑎12𝑏22
𝑎21𝑏11 + 𝑎22𝑏21 𝑎21𝑏12 + 𝑎22𝑏22
• Array operation involving one or more images is carried out
on a pixel-by-pixel basis.
• Ex. i) Raising an image to a power.
Individual pixel is raised to that power.
ii) Dividing an image by another:
Division is between corresponding pixel pairs.
Linear versus Nonlinear
Operations
• General operator, H, that produces an output image, g(x, y),
for a given input image, f (x, y):
H[f(x, y)] = g(x, y)
• H is said to be a linear operator if
H[aifi(x,y) + ajfj(x,y)] = aiH[fi(x,y)] + ajH[fj(x,y)]
= aigi(x,y) + ajgj(x,y)—Eq.(i)
where, ai, aj – arbitrary constants
fi(x,y), fj(x,y) – images of same size.
• Suppose H is the sum operator,
• [𝑎𝑖𝑓𝑖 𝑥, 𝑦 + 𝑎𝑗𝑓𝑗(𝑥, 𝑦)] = 𝑎𝑖𝑓𝑖(𝑥, 𝑦) + 𝑎𝑗𝑓𝑗(𝑥, 𝑦)
= 𝑎𝑖 𝑓𝑖 𝑥, 𝑦 + 𝑎𝑗 𝑓𝑗(𝑥, 𝑦)
= 𝑎𝑖𝑔𝑖 𝑥, 𝑦 + 𝑎𝑗𝑔𝑗(𝑥, 𝑦)
Thus, operator is linear.
• Consider max operation,
• Let f1 =
0 2
2 3
, f2 =
6 5
4 7
, a1 = 1, a2 = -1.
• To Test Linearity,
• LHS of eq(i): 𝑚𝑎𝑥 1
0 2
2 3
+ (−1)
6 5
4 7
= −2
• RHS of eq(i): 1 𝑚𝑎𝑥
0 2
2 3
+ −1 𝑚𝑎𝑥
6 5
4 7
= -4
• LHS ≠ RHS
• So, max is non-linear operation.
Arithmetic Operations
• Arithmetic operations are array operations that are carried
out between corresponding pixel pairs.
• Four arithmetic operations:
s(x, y) = f(x, y) + g(x, y)
d(x, y) = f(x, y) - g(x, y)
p(x, y) = f(x, y) * g(x, y)
v(x, y) = f(x, y) / g(x, y)
Where, x = 0,1,2,…,M-1, y = 0,1,2,….N-1.
All images are of size M (rows) x N (columns).
Set and Logical
Operations
• Basic Set operation
• Let A - set composed of ordered pairs of real numbers.
• If pixel a = (x,y), is an element of A
• If a is not an element of A
• Set with no elements is called the null or empty set
• If every element of a set A is also an element of a set B, then
A is said to be a subset of B
• Union of two sets A and B
• Intersection of two sets A and B
• Two sets A and B are disjoint or mutually exclusive if they have
no common elements
• The set universe, U, is the set of all elements in a given
application.
• complement of a set A is the set of elements that are not in A
• difference of two sets A and B,
Illustration of Set Concept
Set operations on gray-
scale images
• a) Original image b) Image Negative c) Union of (a) & constant image
Illustration of Logical
Operators
Spatial Operations
• Spatial operations are performed directly on the pixels of a
given image.
o (1) single-pixel operations,
o (2) neighborhood operations, &
o (3) geometric spatial transformations.
• 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
• where r and c are the row and column coordinates of the
pixels whose coordinates are members of the set Sxy.
• Geometric spatial transformations
• They modify the spatial relationship between pixels in an
image.
• a.k.a. rubber-sheet transformations.
• They consists of two basic operations:
o (1) spatial transformation of coordinates and
o (2) intensity interpolation that assigns intensity values to the spatially transformed
pixels.
• The transformation of coordinates may be expressed as
o (v, w) - pixel coordinates in the original input image
o (x, y) - the corresponding pixel coordinates in the transformed output image.
• One of the most commonly used spatial coordinate
transformations is the affine transform
• Its General Form
• This transformation can scale, rotate, translate, or sheer a set
of coordinate points, depending on the value chosen for the
elements of matrix T.
Examples
• Rotation
Vector and Matrix
Operations
• Color images are formed in RGB color space by using red,
green, and blue component images.
• Each pixel of an RGB image has 3 components, which can be
organized in the form of a column vector.
• forward mapping, consists of scanning the pixels of the input
image and, at each location, (v, w), computing the spatial
location, (x, y), of the corresponding pixel in the output image.
• inverse mapping, scans the output pixel locations and, at
each location, (x, y), computes the corresponding location in
the input image using
(v, w, 1) = T-1(x, y, 1)
• It then interpolates using either of nearest neighbor, bilinear,
and bicubic interpolation techniques.
• Euclidean distance, D, between a pixel vector z and an
arbitrary point a in n-dimensional space is defined as the
vector product
• This is a generalization of the 2-D Euclidean distance
• Sometimes is referred to as a vector norm, denoted by
𝑧 − 𝑎 .
• An image of size M X N can be represented as a vector of
dimension MN X 1.
• A broad range of linear processes can be applied to such
images by using notation
g = Hf + n
o f – MN X 1 vector representing Input image
o n - MN X 1 vector representing M X N noise pattern
o g - MN X 1 vector representing affected image
o H – MN X MN matrix representing linear process applied to input image
Image Registration
• Transform an image to
align its pixels with those
in another image of same
scene.
• Transformation is
unknown.
• Transformation can be
linear or nonlinear.
• Example : Align two images and combine them to produce a
larger one
Input 1 Input 2
Output
Image Transforms
• Approaches discussed till now work directly on spatial
domain.
• Some tasks are best formulated by transforming the input
images, carrying the specified task in a transform domain, and
applying the inverse transform to return to the spatial
domain.
• General form of 2-D linear transforms is given by:
…..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)
• (c) Mask (Filter) used to eliminate the energy bursts.
• (d) Result of computing the inverse of the modified Fourier transform.
• The forward transformation kernel is said to be separable if
• Also the kernel is said to be symmetric if r1(x, y) is functionally
equal to r2(x, y).
• Identical comments apply to the inverse kernel by replacing r
with s in the preceding equations.
• Thus, forward & inverse kernels are given by:
• Substituting these kernels into the general transform
formulations, we get the Discrete Fourier transform pair:
• Fourier (forward and inverse) kernels are
o separable and symmetric
o allow 2-D transforms to be computed using 1-D transforms
&
• f(x, y) is a square image of size M x M
• Then, eq.(1) & eq.(2) can be expressed in matrix form as
o F – M x M matrix with elements of input image f(x, y).
o A – M x M matrix with elements aij = r1(x, y)
o T – resulting M x M matrix with values T(u, v), u, v = 0,1,2….., M-1
• Fourier (forward and inverse) kernels are
o separable and symmetric
o allow 2-D transforms to be computed using 1-D transforms
&
• f(x, y) is a square image of size M x M
• Then, eq.(1) & eq.(2) can be expressed in matrix form as
o F – M x M matrix with elements of input image f(x, y).
o A – M x M matrix with elements aij = r1(x, y)
o T – resulting M x M matrix with values T(u, v), u, v = 0,1,2….., M-1
• To obtain the inverse transform, we pre- and post-multiply
above equation by an inverse transformation matrix B.
• If B = A-1
• F can be recovered completely from its forward transform.
• If B ≠ A-1
• Approximation is
Intensity Transformation
 Very first step in Digital Image Processing.
 It is purely subjective.
 It is a cosmetic procedure.
 It improves subjective qualities of images.
 It has two domains:
 Spatial domain
 Frequency domain
Spatial Domain
 Spatial means working in space i.e. (given image).
 It means working with pixel values or raw data.
 Let g( x, y) be original image where g is gray level values & ( x,
y) is co-ordinates
 For 8-bit image, g can take values from 0 – 255
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
 In spatial domain techniques simply T changes.
 Spatial domain enhancement is carried out in two ways:
Point processing
Neighborhood processing
Point Processing
 Here, we work on singe pixel i.e. T is 1 x 1 operator.
New image depends on transform T and original image.
 Some important examples of point processing are:
 Digital Negative
 Contrast Stretching
 Thresholding
 Gray level slicing
 Bit plane slicing
 Dynamic range compression
Point Processing
Modified
Gray Level
 Identity Transformation:
255 T
125
s
10
0
10 125 255
Original Gray Level r
• It does not modify the input image at all.
• In general, s = r
Point Processing
1) Digital Image Negative:
 Useful in large applications e.g. X-ray images.
Negative means inverting gray levels.
255
Output Gray level 200
s
55
0 55 200 255
Input image intensity r
Point Processing
Digital Negative can be obtained by:
s = 255 – r (where, rmax = 255)
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
s m
(r1, s1)
v l
0 a b 255
r
Output
Image
Intensity
level
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.
 Dark portion is being made darker by assigning slope of < 1.
 Bright portion is being made brighter by assigning slope of > 1.
 Any set of slopes cant be generalized for all kind of images.
Formulation is given below:
s = l.r ; for 0 ≤ r ≤ a
= m(r-a) + v ; for a ≤ r ≤ b
= n(r-b) + w ; for b ≤ r ≤ L-1
Point Processing
3) Thresholding:
255
s
0 a 255
r
Output
Image
Intensity
level
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.
 If r1 = r2, s1 = 0 & s2 = L-1
Then we get Thresholding function.
 Expression goes as under:
s = 0; if r ≤ a
s = L – 1 ; if r >a
where, L is number of Gray levels.
Note: It is a subjective phenomenon.
Thresholded image has maximum contrast as it has only BLACK & WHITE
gray values.
Point Processing
4) Gray Level Slicing (Intensity Slicing):
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
At times, we need to highlight a specific range of gray levels.
eg. X-ray scan, CT scan
 It looks similar to thresholding except that we select a band of gray
levels.
Formulation of Gray level slicing w/o background (fig. 1):
s = L-1 ; for a ≤ r ≤ b
= 0 ; otherwise
 No background at all.
Sometimes we may need to retain the background.
 Formulation of Gray level slicing with background (fig. 2):
s = L-1 ; for a ≤ r ≤ b
= r ; otherwise
Point Processing
5) Bit Plane Slicing:
 Here, we find the contribution made by each bit to the final image.
 Consider a 256 x 256 image with 256 gray levels i.e. 8-bit representation
for each pixel. E.g. BLACK is represented as 0000_0000 & WHITE by
1111_1111.
 Consider LSB value of each pixel & plot image. Continue till MSB is
reached.
All 8 images will be binary.
 Observing the images we conclude that
Higher order images contain visually sufficient data.
Lower order bits contain suitable details of image.
 Hence, BPS can be used in Image Compression.
We can transmit only higher order bits & remove lower order bits.
E.g. Steganography
Point Processing
Ex. Plot bit planes of the given 3 x 3 image.
1 2 0 1 - 00000001 001 010 000
2 - 00000010
4 3 2 0 - 00000000 100 011 010
4 - 00000100
7 5 2 3 - 00000011 111 101 010
2 - 00000010
7 - 00000111
Max. Intensity is 7 thus 3 – bits 5 - 00000101
2 - 00000010
0 0 0 0 1 0 1 0 0
1 0 0 0 1 1 0 1 0
1 1 0 1 0 1 1 1 0
MSB plane Middle Plane LSB Plane
Point Processing
6) Dynamic Range Compression (Log transformation):
s
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.
 Thus dynamic range needs to be compressed.
Point Processing
 Log operator is an excellent compression function.
 Thus, Dynamic range compression is achieved using log operator.
Formulation:
s = C*logn(1 + |r|)
where, C – normalization constant
r – input intensity
Point Processing
7) Power law Transform:
γ < 1
s
γ = 1
γ > 1
r
f(x, y) = C *g(x, y)γ
s = C. rγ where, C & γ are positive constants
Point Processing
The Transformation is shown for different values of ‘γ’ which is also the
gamma correction factor.
 By changing γ, we obtain the family of transformation curves.
Nonlinearity encountered during image capturing, storing & displaying can
be corrected using gamma correction.
 Power Law Transform can be used to increase dynamic range of image.

More Related Content

What's hot

Region based segmentation
Region based segmentationRegion based segmentation
Region based segmentationramya marichamy
 
Chapter 3 image enhancement (spatial domain)
Chapter 3 image enhancement (spatial domain)Chapter 3 image enhancement (spatial domain)
Chapter 3 image enhancement (spatial domain)asodariyabhavesh
 
Chapter 9 morphological image processing
Chapter 9   morphological image processingChapter 9   morphological image processing
Chapter 9 morphological image processingAhmed Daoud
 
Edge Detection and Segmentation
Edge Detection and SegmentationEdge Detection and Segmentation
Edge Detection and SegmentationA B Shinde
 
Color Image Processing
Color Image ProcessingColor Image Processing
Color Image Processingkiruthiammu
 
Introduction to Image Compression
Introduction to Image CompressionIntroduction to Image Compression
Introduction to Image CompressionKalyan Acharjya
 
Color Image Processing: Basics
Color Image Processing: BasicsColor Image Processing: Basics
Color Image Processing: BasicsA B Shinde
 
Image Enhancement using Frequency Domain Filters
Image Enhancement using Frequency Domain FiltersImage Enhancement using Frequency Domain Filters
Image Enhancement using Frequency Domain FiltersKarthika Ramachandran
 
Image Enhancement in Spatial Domain
Image Enhancement in Spatial DomainImage Enhancement in Spatial Domain
Image Enhancement in Spatial DomainDEEPASHRI HK
 
Color fundamentals and color models - Digital Image Processing
Color fundamentals and color models - Digital Image ProcessingColor fundamentals and color models - Digital Image Processing
Color fundamentals and color models - Digital Image ProcessingAmna
 
Digital Image restoration
Digital Image restorationDigital Image restoration
Digital Image restorationMd Shabir Alam
 
5. gray level transformation
5. gray level transformation5. gray level transformation
5. gray level transformationMdFazleRabbi18
 
Chapter 6 color image processing
Chapter 6 color image processingChapter 6 color image processing
Chapter 6 color image processingasodariyabhavesh
 
Histogram Processing
Histogram ProcessingHistogram Processing
Histogram ProcessingAmnaakhaan
 
HSI MODEL IN COLOR IMAGE PROCESSING
HSI MODEL IN COLOR IMAGE PROCESSING HSI MODEL IN COLOR IMAGE PROCESSING
HSI MODEL IN COLOR IMAGE PROCESSING anam singla
 

What's hot (20)

Region based segmentation
Region based segmentationRegion based segmentation
Region based segmentation
 
Chapter 3 image enhancement (spatial domain)
Chapter 3 image enhancement (spatial domain)Chapter 3 image enhancement (spatial domain)
Chapter 3 image enhancement (spatial domain)
 
Chapter 9 morphological image processing
Chapter 9   morphological image processingChapter 9   morphological image processing
Chapter 9 morphological image processing
 
Edge Detection and Segmentation
Edge Detection and SegmentationEdge Detection and Segmentation
Edge Detection and Segmentation
 
Color Image Processing
Color Image ProcessingColor Image Processing
Color Image Processing
 
Introduction to Image Compression
Introduction to Image CompressionIntroduction to Image Compression
Introduction to Image Compression
 
Image compression models
Image compression modelsImage compression models
Image compression models
 
Sharpening spatial filters
Sharpening spatial filtersSharpening spatial filters
Sharpening spatial filters
 
Color Image Processing: Basics
Color Image Processing: BasicsColor Image Processing: Basics
Color Image Processing: Basics
 
Image Enhancement using Frequency Domain Filters
Image Enhancement using Frequency Domain FiltersImage Enhancement using Frequency Domain Filters
Image Enhancement using Frequency Domain Filters
 
Image Enhancement in Spatial Domain
Image Enhancement in Spatial DomainImage Enhancement in Spatial Domain
Image Enhancement in Spatial Domain
 
Color fundamentals and color models - Digital Image Processing
Color fundamentals and color models - Digital Image ProcessingColor fundamentals and color models - Digital Image Processing
Color fundamentals and color models - Digital Image Processing
 
Digital Image restoration
Digital Image restorationDigital Image restoration
Digital Image restoration
 
5. gray level transformation
5. gray level transformation5. gray level transformation
5. gray level transformation
 
JPEG Image Compression
JPEG Image CompressionJPEG Image Compression
JPEG Image Compression
 
Chapter 6 color image processing
Chapter 6 color image processingChapter 6 color image processing
Chapter 6 color image processing
 
Histogram Processing
Histogram ProcessingHistogram Processing
Histogram Processing
 
Data Redundacy
Data RedundacyData Redundacy
Data Redundacy
 
image enhancement
 image enhancement image enhancement
image enhancement
 
HSI MODEL IN COLOR IMAGE PROCESSING
HSI MODEL IN COLOR IMAGE PROCESSING HSI MODEL IN COLOR IMAGE PROCESSING
HSI MODEL IN COLOR IMAGE PROCESSING
 

Similar to Mathematical tools in dip

chapter-2 SPACIAL DOMAIN.pptx
chapter-2 SPACIAL DOMAIN.pptxchapter-2 SPACIAL DOMAIN.pptx
chapter-2 SPACIAL DOMAIN.pptxAyeleFeyissa1
 
3 intensity transformations and spatial filtering slides
3 intensity transformations and spatial filtering slides3 intensity transformations and spatial filtering slides
3 intensity transformations and spatial filtering slidesBHAGYAPRASADBUGGE
 
lec07_transformations.pptx
lec07_transformations.pptxlec07_transformations.pptx
lec07_transformations.pptxAneesAbbasi14
 
Computer Vision transformations
Computer Vision  transformationsComputer Vision  transformations
Computer Vision transformationsWael Badawy
 
Digital image processing fundamental explanation
Digital image processing fundamental explanationDigital image processing fundamental explanation
Digital image processing fundamental explanationTirusew1
 
4.intensity transformations
4.intensity transformations4.intensity transformations
4.intensity transformationsYahya Alkhaldi
 
Digital Image Procesing
Digital Image ProcesingDigital Image Procesing
Digital Image Procesingvepiga5005
 
Image enhancement
Image enhancementImage enhancement
Image enhancementKuppusamy P
 
07 cie552 image_mosaicing
07 cie552 image_mosaicing07 cie552 image_mosaicing
07 cie552 image_mosaicingElsayed Hemayed
 
Two dimensionaltransformations
Two dimensionaltransformationsTwo dimensionaltransformations
Two dimensionaltransformationsNareek
 
chapter 3 , foley.pptxhuujjjjjjjkjmmmm. Ibibhvucufucuvivihohi
chapter 3 , foley.pptxhuujjjjjjjkjmmmm.  Ibibhvucufucuvivihohichapter 3 , foley.pptxhuujjjjjjjkjmmmm.  Ibibhvucufucuvivihohi
chapter 3 , foley.pptxhuujjjjjjjkjmmmm. Ibibhvucufucuvivihohi54MahakBansal
 
Lec_2_Digital Image Fundamentals.pdf
Lec_2_Digital Image Fundamentals.pdfLec_2_Digital Image Fundamentals.pdf
Lec_2_Digital Image Fundamentals.pdfnagwaAboElenein
 
chAPTER1CV.pptx is abouter computer vision in artificial intelligence
chAPTER1CV.pptx is abouter computer vision in artificial intelligencechAPTER1CV.pptx is abouter computer vision in artificial intelligence
chAPTER1CV.pptx is abouter computer vision in artificial intelligenceshesnasuneer
 
computervision1.pptx its about computer vision
computervision1.pptx its about computer visioncomputervision1.pptx its about computer vision
computervision1.pptx its about computer visionshesnasuneer
 
Open GL T0074 56 sm4
Open GL T0074 56 sm4Open GL T0074 56 sm4
Open GL T0074 56 sm4Roziq Bahtiar
 
Image Acquisition and Representation
Image Acquisition and RepresentationImage Acquisition and Representation
Image Acquisition and RepresentationAmnaakhaan
 
Chapter 3 Output Primitives
Chapter 3 Output PrimitivesChapter 3 Output Primitives
Chapter 3 Output PrimitivesPrathimaBaliga
 

Similar to Mathematical tools in dip (20)

chapter-2 SPACIAL DOMAIN.pptx
chapter-2 SPACIAL DOMAIN.pptxchapter-2 SPACIAL DOMAIN.pptx
chapter-2 SPACIAL DOMAIN.pptx
 
3 intensity transformations and spatial filtering slides
3 intensity transformations and spatial filtering slides3 intensity transformations and spatial filtering slides
3 intensity transformations and spatial filtering slides
 
lec07_transformations.pptx
lec07_transformations.pptxlec07_transformations.pptx
lec07_transformations.pptx
 
Computer Vision transformations
Computer Vision  transformationsComputer Vision  transformations
Computer Vision transformations
 
Digital image processing fundamental explanation
Digital image processing fundamental explanationDigital image processing fundamental explanation
Digital image processing fundamental explanation
 
Digtial Image Processing Q@A
Digtial Image Processing Q@ADigtial Image Processing Q@A
Digtial Image Processing Q@A
 
4.intensity transformations
4.intensity transformations4.intensity transformations
4.intensity transformations
 
Digital Image Procesing
Digital Image ProcesingDigital Image Procesing
Digital Image Procesing
 
Image enhancement
Image enhancementImage enhancement
Image enhancement
 
07 cie552 image_mosaicing
07 cie552 image_mosaicing07 cie552 image_mosaicing
07 cie552 image_mosaicing
 
Two dimensionaltransformations
Two dimensionaltransformationsTwo dimensionaltransformations
Two dimensionaltransformations
 
chapter 3 , foley.pptxhuujjjjjjjkjmmmm. Ibibhvucufucuvivihohi
chapter 3 , foley.pptxhuujjjjjjjkjmmmm.  Ibibhvucufucuvivihohichapter 3 , foley.pptxhuujjjjjjjkjmmmm.  Ibibhvucufucuvivihohi
chapter 3 , foley.pptxhuujjjjjjjkjmmmm. Ibibhvucufucuvivihohi
 
Lec_2_Digital Image Fundamentals.pdf
Lec_2_Digital Image Fundamentals.pdfLec_2_Digital Image Fundamentals.pdf
Lec_2_Digital Image Fundamentals.pdf
 
Image restoration and reconstruction
Image restoration and reconstructionImage restoration and reconstruction
Image restoration and reconstruction
 
chAPTER1CV.pptx is abouter computer vision in artificial intelligence
chAPTER1CV.pptx is abouter computer vision in artificial intelligencechAPTER1CV.pptx is abouter computer vision in artificial intelligence
chAPTER1CV.pptx is abouter computer vision in artificial intelligence
 
computervision1.pptx its about computer vision
computervision1.pptx its about computer visioncomputervision1.pptx its about computer vision
computervision1.pptx its about computer vision
 
Wiener Filter
Wiener FilterWiener Filter
Wiener Filter
 
Open GL T0074 56 sm4
Open GL T0074 56 sm4Open GL T0074 56 sm4
Open GL T0074 56 sm4
 
Image Acquisition and Representation
Image Acquisition and RepresentationImage Acquisition and Representation
Image Acquisition and Representation
 
Chapter 3 Output Primitives
Chapter 3 Output PrimitivesChapter 3 Output Primitives
Chapter 3 Output Primitives
 

More from Visvesvaraya National Institute of Technology, Nagpur, Maharashtra, India (9)

Wavelet transform
Wavelet transformWavelet transform
Wavelet transform
 
Spatial filtering
Spatial filteringSpatial filtering
Spatial filtering
 
Radon transform numerical & Fourier slice theorem
Radon transform numerical & Fourier slice theoremRadon transform numerical & Fourier slice theorem
Radon transform numerical & Fourier slice theorem
 
Pixel relationships
Pixel relationshipsPixel relationships
Pixel relationships
 
Morphological image processing
Morphological image processingMorphological image processing
Morphological image processing
 
Image transforms
Image transformsImage transforms
Image transforms
 
Image segmentation
Image segmentationImage segmentation
Image segmentation
 
Histogram processing
Histogram processingHistogram processing
Histogram processing
 
Image enhancement
Image enhancementImage enhancement
Image enhancement
 

Recently uploaded

the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxhumanexperienceaaa
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 

Recently uploaded (20)

the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 

Mathematical tools in dip

  • 1. Digital Image Processing Mathematical tools used in DIP By Dr. K. M. Bhurchandi
  • 2. Array versus Matrix Operations • Consider two 2 x 2 images 𝑎11 𝑎12 𝑎21 𝑎22 and 𝑏11 𝑏12 𝑏21 𝑏22 • Array Product is: 𝑎11𝑏11 𝑎12𝑏12 𝑎21𝑏21 𝑎22𝑏22 • Matrix Product is: 𝑎11𝑏11 + 𝑎12𝑏21 𝑎11𝑏12 + 𝑎12𝑏22 𝑎21𝑏11 + 𝑎22𝑏21 𝑎21𝑏12 + 𝑎22𝑏22
  • 3. • Array operation involving one or more images is carried out on a pixel-by-pixel basis. • Ex. i) Raising an image to a power. Individual pixel is raised to that power. ii) Dividing an image by another: Division is between corresponding pixel pairs.
  • 4. Linear versus Nonlinear Operations • General operator, H, that produces an output image, g(x, y), for a given input image, f (x, y): H[f(x, y)] = g(x, y) • H is said to be a linear operator if H[aifi(x,y) + ajfj(x,y)] = aiH[fi(x,y)] + ajH[fj(x,y)] = aigi(x,y) + ajgj(x,y)—Eq.(i) where, ai, aj – arbitrary constants fi(x,y), fj(x,y) – images of same size.
  • 5. • Suppose H is the sum operator, • [𝑎𝑖𝑓𝑖 𝑥, 𝑦 + 𝑎𝑗𝑓𝑗(𝑥, 𝑦)] = 𝑎𝑖𝑓𝑖(𝑥, 𝑦) + 𝑎𝑗𝑓𝑗(𝑥, 𝑦) = 𝑎𝑖 𝑓𝑖 𝑥, 𝑦 + 𝑎𝑗 𝑓𝑗(𝑥, 𝑦) = 𝑎𝑖𝑔𝑖 𝑥, 𝑦 + 𝑎𝑗𝑔𝑗(𝑥, 𝑦) Thus, operator is linear.
  • 6. • Consider max operation, • Let f1 = 0 2 2 3 , f2 = 6 5 4 7 , a1 = 1, a2 = -1. • To Test Linearity, • LHS of eq(i): 𝑚𝑎𝑥 1 0 2 2 3 + (−1) 6 5 4 7 = −2 • RHS of eq(i): 1 𝑚𝑎𝑥 0 2 2 3 + −1 𝑚𝑎𝑥 6 5 4 7 = -4 • LHS ≠ RHS • So, max is non-linear operation.
  • 7. Arithmetic Operations • Arithmetic operations are array operations that are carried out between corresponding pixel pairs. • Four arithmetic operations: s(x, y) = f(x, y) + g(x, y) d(x, y) = f(x, y) - g(x, y) p(x, y) = f(x, y) * g(x, y) v(x, y) = f(x, y) / g(x, y) Where, x = 0,1,2,…,M-1, y = 0,1,2,….N-1. All images are of size M (rows) x N (columns).
  • 8. Set and Logical Operations • Basic Set operation • Let A - set composed of ordered pairs of real numbers. • If pixel a = (x,y), is an element of A • If a is not an element of A • Set with no elements is called the null or empty set
  • 9. • If every element of a set A is also an element of a set B, then A is said to be a subset of B • Union of two sets A and B • Intersection of two sets A and B • Two sets A and B are disjoint or mutually exclusive if they have no common elements
  • 10. • The set universe, U, is the set of all elements in a given application. • complement of a set A is the set of elements that are not in A • difference of two sets A and B,
  • 12. Set operations on gray- scale images • a) Original image b) Image Negative c) Union of (a) & constant image
  • 14. Spatial Operations • Spatial operations are performed directly on the pixels of a given image. o (1) single-pixel operations, o (2) neighborhood operations, & o (3) geometric spatial transformations. • 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.
  • 16. • We can express the operation in equation form as • where r and c are the row and column coordinates of the pixels whose coordinates are members of the set Sxy.
  • 17. • Geometric spatial transformations • They modify the spatial relationship between pixels in an image. • a.k.a. rubber-sheet transformations. • They consists of two basic operations: o (1) spatial transformation of coordinates and o (2) intensity interpolation that assigns intensity values to the spatially transformed pixels. • The transformation of coordinates may be expressed as o (v, w) - pixel coordinates in the original input image o (x, y) - the corresponding pixel coordinates in the transformed output image.
  • 18. • One of the most commonly used spatial coordinate transformations is the affine transform • Its General Form • This transformation can scale, rotate, translate, or sheer a set of coordinate points, depending on the value chosen for the elements of matrix T.
  • 19.
  • 21. Vector and Matrix Operations • Color images are formed in RGB color space by using red, green, and blue component images. • Each pixel of an RGB image has 3 components, which can be organized in the form of a column vector.
  • 22. • forward mapping, consists of scanning the pixels of the input image and, at each location, (v, w), computing the spatial location, (x, y), of the corresponding pixel in the output image. • inverse mapping, scans the output pixel locations and, at each location, (x, y), computes the corresponding location in the input image using (v, w, 1) = T-1(x, y, 1) • It then interpolates using either of nearest neighbor, bilinear, and bicubic interpolation techniques.
  • 23. • Euclidean distance, D, between a pixel vector z and an arbitrary point a in n-dimensional space is defined as the vector product • This is a generalization of the 2-D Euclidean distance • Sometimes is referred to as a vector norm, denoted by 𝑧 − 𝑎 .
  • 24. • An image of size M X N can be represented as a vector of dimension MN X 1. • A broad range of linear processes can be applied to such images by using notation g = Hf + n o f – MN X 1 vector representing Input image o n - MN X 1 vector representing M X N noise pattern o g - MN X 1 vector representing affected image o H – MN X MN matrix representing linear process applied to input image
  • 25. Image Registration • Transform an image to align its pixels with those in another image of same scene. • Transformation is unknown. • Transformation can be linear or nonlinear.
  • 26. • Example : Align two images and combine them to produce a larger one Input 1 Input 2 Output
  • 27. Image Transforms • Approaches discussed till now work directly on spatial domain. • Some tasks are best formulated by transforming the input images, carrying the specified task in a transform domain, and applying the inverse transform to return to the spatial domain. • General form of 2-D linear transforms is given by: …..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
  • 28. • 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).
  • 29. • 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.
  • 30. • (a) Image corrupted by sinusoidal interference. • (b) Magnitude of the Fourier transform. (a) (b) (c) (d) • (c) Mask (Filter) used to eliminate the energy bursts. • (d) Result of computing the inverse of the modified Fourier transform.
  • 31. • The forward transformation kernel is said to be separable if • Also the kernel is said to be symmetric if r1(x, y) is functionally equal to r2(x, y). • Identical comments apply to the inverse kernel by replacing r with s in the preceding equations. • Thus, forward & inverse kernels are given by:
  • 32. • Substituting these kernels into the general transform formulations, we get the Discrete Fourier transform pair:
  • 33. • Fourier (forward and inverse) kernels are o separable and symmetric o allow 2-D transforms to be computed using 1-D transforms & • f(x, y) is a square image of size M x M • Then, eq.(1) & eq.(2) can be expressed in matrix form as o F – M x M matrix with elements of input image f(x, y). o A – M x M matrix with elements aij = r1(x, y) o T – resulting M x M matrix with values T(u, v), u, v = 0,1,2….., M-1 • Fourier (forward and inverse) kernels are o separable and symmetric o allow 2-D transforms to be computed using 1-D transforms & • f(x, y) is a square image of size M x M • Then, eq.(1) & eq.(2) can be expressed in matrix form as o F – M x M matrix with elements of input image f(x, y). o A – M x M matrix with elements aij = r1(x, y) o T – resulting M x M matrix with values T(u, v), u, v = 0,1,2….., M-1
  • 34. • To obtain the inverse transform, we pre- and post-multiply above equation by an inverse transformation matrix B. • If B = A-1 • F can be recovered completely from its forward transform. • If B ≠ A-1 • Approximation is
  • 35. Intensity Transformation  Very first step in Digital Image Processing.  It is purely subjective.  It is a cosmetic procedure.  It improves subjective qualities of images.  It has two domains:  Spatial domain  Frequency domain
  • 36. Spatial Domain  Spatial means working in space i.e. (given image).  It means working with pixel values or raw data.  Let g( x, y) be original image where g is gray level values & ( x, y) is co-ordinates  For 8-bit image, g can take values from 0 – 255 where 0 – black , 255 – white & others - shades of gray
  • 37. 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)
  • 38. 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  In spatial domain techniques simply T changes.  Spatial domain enhancement is carried out in two ways: Point processing Neighborhood processing
  • 39. Point Processing  Here, we work on singe pixel i.e. T is 1 x 1 operator. New image depends on transform T and original image.  Some important examples of point processing are:  Digital Negative  Contrast Stretching  Thresholding  Gray level slicing  Bit plane slicing  Dynamic range compression
  • 40. Point Processing Modified Gray Level  Identity Transformation: 255 T 125 s 10 0 10 125 255 Original Gray Level r • It does not modify the input image at all. • In general, s = r
  • 41. Point Processing 1) Digital Image Negative:  Useful in large applications e.g. X-ray images. Negative means inverting gray levels. 255 Output Gray level 200 s 55 0 55 200 255 Input image intensity r
  • 42. Point Processing Digital Negative can be obtained by: s = 255 – r (where, rmax = 255) 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)
  • 43. Point Processing 2) Contrast Stretching: 255 w (r2, s2) n s m (r1, s1) v l 0 a b 255 r Output Image Intensity level Input Image Intensity level
  • 44. 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.  Dark portion is being made darker by assigning slope of < 1.  Bright portion is being made brighter by assigning slope of > 1.  Any set of slopes cant be generalized for all kind of images. Formulation is given below: s = l.r ; for 0 ≤ r ≤ a = m(r-a) + v ; for a ≤ r ≤ b = n(r-b) + w ; for b ≤ r ≤ L-1
  • 45. Point Processing 3) Thresholding: 255 s 0 a 255 r Output Image Intensity level Input Image Intensity level
  • 46. 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.  If r1 = r2, s1 = 0 & s2 = L-1 Then we get Thresholding function.  Expression goes as under: s = 0; if r ≤ a s = L – 1 ; if r >a where, L is number of Gray levels. Note: It is a subjective phenomenon. Thresholded image has maximum contrast as it has only BLACK & WHITE gray values.
  • 47. Point Processing 4) Gray Level Slicing (Intensity Slicing): 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
  • 48. Point Processing  Thresholding splits the image in 2 parts At times, we need to highlight a specific range of gray levels. eg. X-ray scan, CT scan  It looks similar to thresholding except that we select a band of gray levels. Formulation of Gray level slicing w/o background (fig. 1): s = L-1 ; for a ≤ r ≤ b = 0 ; otherwise  No background at all. Sometimes we may need to retain the background.  Formulation of Gray level slicing with background (fig. 2): s = L-1 ; for a ≤ r ≤ b = r ; otherwise
  • 49. Point Processing 5) Bit Plane Slicing:  Here, we find the contribution made by each bit to the final image.  Consider a 256 x 256 image with 256 gray levels i.e. 8-bit representation for each pixel. E.g. BLACK is represented as 0000_0000 & WHITE by 1111_1111.  Consider LSB value of each pixel & plot image. Continue till MSB is reached. All 8 images will be binary.  Observing the images we conclude that Higher order images contain visually sufficient data. Lower order bits contain suitable details of image.  Hence, BPS can be used in Image Compression. We can transmit only higher order bits & remove lower order bits. E.g. Steganography
  • 50. Point Processing Ex. Plot bit planes of the given 3 x 3 image. 1 2 0 1 - 00000001 001 010 000 2 - 00000010 4 3 2 0 - 00000000 100 011 010 4 - 00000100 7 5 2 3 - 00000011 111 101 010 2 - 00000010 7 - 00000111 Max. Intensity is 7 thus 3 – bits 5 - 00000101 2 - 00000010 0 0 0 0 1 0 1 0 0 1 0 0 0 1 1 0 1 0 1 1 0 1 0 1 1 1 0 MSB plane Middle Plane LSB Plane
  • 51. Point Processing 6) Dynamic Range Compression (Log transformation): s 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.  Thus dynamic range needs to be compressed.
  • 52. Point Processing  Log operator is an excellent compression function.  Thus, Dynamic range compression is achieved using log operator. Formulation: s = C*logn(1 + |r|) where, C – normalization constant r – input intensity
  • 53. Point Processing 7) Power law Transform: γ < 1 s γ = 1 γ > 1 r f(x, y) = C *g(x, y)γ s = C. rγ where, C & γ are positive constants
  • 54. Point Processing The Transformation is shown for different values of ‘γ’ which is also the gamma correction factor.  By changing γ, we obtain the family of transformation curves. Nonlinearity encountered during image capturing, storing & displaying can be corrected using gamma correction.  Power Law Transform can be used to increase dynamic range of image.