MOD $ CHAPT 2
MOD $ CHAPT 2
Processing
2nd Edition
S.
Sridhar
Chapter – 3
Digital Image Processing Operations
BASIC RELATIONSHIPS AND DISTANCE METRICS
Image Coordinate
System
Image Coordinate system
Image Topology
A pixel p at (x,y) has 4-horizontal/vertical neighbours at (x+1,y),
(x-1,y), (x,y+1) and (x,y-1). These are called the 4-neighbours of p :
N4(p).
Diagonal Elements
• Find 4-adjacency, 8-adjacency and m adjacency for the above image for
V= {1}
Connectivity
Two pixels are said to be connected:
• if they are adjacent in some sense
(neighbour pixels, 4/8/m-adjacency)
• if their gray levels satisfy a specified
criterion of similarity(equal intensity level)
Connectivity
8-connectivity Vs m-connectivity
• Consider the following image with marked pixels p and q. If V = {1,2},
find the shortest m-path between pixels p and q
3 3 2 1 (q)
2 2 0 2
0 2 1 1
1 (p) 0 1 2
V = {1,2}
3 3 2 1 (q)
2 2 0 2
0 2 1 1
1 (p) 0 1 2
Shortest distance =4
Relations
Distance Measures
Distance Measures
• Let V= {0,1}. Compute De, D4, D8 and Dm distances between 2 pixels p
and q. Let the pixel coordinates of p and q be (3,0) and (2,3)
respectively
0 1 2 3
0 0 1 1 1
1 1 0 0 1
2 1 1 0 1 (q)
3 1 (p) 1 1 1
•
0 1 1 1 0 1 1 1
1 0 0 1 1 0 0 1
1 1 0 1 1 1 0 1
1 1 1 1 1 1 1 1
D4 D8
0 1 1 1
1 0 0 1
1 1 0 1
X
1 1 1 1
Dm
Important Image Characteristics
• Let S be subset of pixels in an image
• Two pixels p and q are said to be connected in S if there exist
a path between them consisting entirely of pixels in S.
• For any pixel p in S the set of pixels that are connected to it
in S is called connected component of S.
• If S has only one connected component, then it is called
connected set/Region.
• 2 regions R1 and R2 are called adjacent if the union of
the sets also forms a connected component
• If the regions are not adjacent, it is called disjoint set.
• The boundary of a region R is the set of pixels in the
region, that have one or more neighbours not in R
Classification of Image Operations
1 3 7
5 15 75
200 50 150
50 150 125
45 55 155
200 50 75
Logical Operations
XOR
NOT Operation
Geometrical Operation
Scaling Operations
Reflection
Reflection along X
Shearing
Rotation
Affine Transform
Inverse Transform
Image Interpolation
• Downsampling
Image Interpolation techniques
NEED FOR INTERPOLATION TECHNIQUES
• Forward Sampling:
An input pixel's value is copied to its corresponding output pixel
location after a transformation. This method is used to create a new
image from an existing one by spatially transforming the pixels
• Backward mapping:
This technique starts with a pixel location in the output (corrected or
interpolated) image and works backward to determine the corresponding
pixel location and value in the original (input) image.
Image Interpolation techniques
• In both the techniques, all the pixels may not be fitted into the new
coordinates.
• Example: consider the rotation of a point (10,5) by 45⁰.
x’ = x cos θ – y sin θ =
y’ = x sin θ +y cos θ =
• The new coordinate positions are not integers and the process may
leave a gap in the new coordinate position and creates a poor quality
output.
• Therefore interpolation techniques fit the output to the new
coordinate poistion
Some popular inaterpolation techniques are:
• Nearest neighbour technique/ zero order interpolation technique
• Bilinear Technique
• Bicubic Technique
• Nearest neighbor interpolation is a simple method to estimate the value
of a data point at an unknown location by using the value of the nearest
known data point.
• It's a fast and computationally inexpensive approach, particularly
useful when speed is prioritized over accuracy.
• Can lead to a blocky or pixelated appearance, especially in images
• Doesn't create smooth transitions between data points.
• Bilinear interpolation is an image interpolation technique
that estimates pixel values in a new image by using a weighted
average of the four nearest pixel values in the original image. It's a
common method for resizing or transforming images, providing a
balance between computational efficiency and visual quality
• Bicubic interpolation is an image resampling technique
that estimates pixel values by considering a 4x4 neighborhood of
surrounding pixels, resulting in a smoother and more detailed
image compared to simpler methods like nearest neighbor or
bilinear interpolation.
• In contrast to bilinear interpolation, which only takes 4 pixels
(2×2) into account, bicubic interpolation considers 16 pixels (4×4)