Remotely Sensed Image
Enhancement
Prof. H.J. Chauhan
Civil Engineering Department
BVM
Filtering
Operations
Pixel and Neighborhood
A B C
D X E
F G H
• Let location of the pixel under consideration be
X
• Neighbors of X are A, C, F,H, B,D,E,G
• Size of neighborhood = 3x3
• By convention we use neighborhoods of size
mxn where m and n are both odd numbers;
there will be a unique pixel at the centre of the
neighborhood
4- and 8-neighborhoods
A B C
D X E
F G H
• In case only B,D,E and G are considered
as neighbors of X, then it is called the 4-
neighborhood of X
• 4-neighbors are physically closest to X,
at one-unit distance
4- and 8-neighborhood
A B C
D X E
F G H
• If A,C,F and H are ALSO included with
B,D,E,G as neighbors, then the 8-pixel
set is known as the 8-neighborhood of
X
• A,C,F and H are the diagonal neighbors,
sqrt(2) times farther from X than the
vertical and horizontal neighbors
Larger Neighborhoods
o o o o o
o o o o o
o o X o o 5x5
neighborhood
o o o o o
o o o o o
• Larger neighborhoods are used in special
cases, and computational load varies
exponentially with change in size of
neighborhood
• 3x3 9 neighbors; 5x5 25 neighbors …
Neighborhood Effect
• 15 17 16 16 17 19
• 18 17 15 18 30 15
• 17 14 16 16 20 17
• Natural Noise?
• Abnormalities like the above can only be
discerned by comparing a pixel value with
the values at neighboring pixels
Neighborhood Effect
• 15 17 16 16 17 30
• 18 17 15 18 30 29
• 17 14 16 29 30 28
Normal region Boundary
• Sharp transitions from one region to
another are marked by large difference in
pixel values at neighboring positions
Neighborhood Operations:
Results of operations performed on the neighborhood
are posted at the location of the central pixel.
• Simple averaging
A B C
D X E
F G H
• g(X) = (1/9)[f(A) + f(B) + f(C) + f(D) + f(X)
+
f(E) + f(F) + f(G) + f(H)]
• The output gray level is is the average of
the gray levels of all the pixels in the 3x3
neighborhood
Example
15 17 16 15 17 16
18 17 15 18 37 15
17 14 16 17 14 16
Case 1 Case 2
• In case 1, after averaging, the central element
17 is replaced by the local average 16 –
negligible change
• In case 2, after averaging, the central element
37 is replaced by 18 – significant change
• Averaging is a powerful tool to deal with
random noise
Neighborhood Operations -
Procedure
• The procedure involves applying the
computational step at every pixel,
considering its value and the values at
the neighboring pixels
• Then the neighborhood is shifted by one
pixel to the right and the centre pixel of
the new neighborhood is in focus
• This process continues from left to right,
top to bottom
Processing step
Image
Mathematical form for averaging
• In general, we can write
K
g(X) =
f (A )
i 1
i
| N(X ) |
where K is the number of neighbors Ai. A5
refers to X, the central pixel for a 3x3
neighborhood.
• It is obvious that all neighbors are given equal
weightage during the averaging process
General form for averaging
• In case different weights are preferred for
different neighbors, then we can write
K
• g(X) = w f (A )
i 1
i i
w
i 1
i
• For simple averaging over a 3x3
neighborhood, wi = (1/9), i=1,2,…,9
• We can alter, for example, the weights for 4-
neighbors and 8-neighbors. In such a case, wi
is not a constant for all values of i.
Filter Mask
• The filter can be compactly represented
using the weights or multiplying
coefficients:
• e.g., 3x3 averaging filter _ _
• 0.111 0.111 0.111 | 1 1 1 |
• 0.111 0.111 0.111 or (1/9)| 1 1 1 |
• 0.111 0.111 0.111 |_ 1 1 1_|
• This implies that the pixels in the image
are multiplied with corresponding filter
coefficients and the products are added
Filter Mask with reduced
neighborhood influence
0.05 0.15 0.05
0.15 0.20 0.15
0.05 0.15 0.05
• In this case, the central pixel is given 20%
weight, while the 4-neighbors are given
15% weight. The remaining four diagonal
neighbors are given 5% weight.
• Note that the weights are all positive,
and sum to unity
Filter
Image
Smoothing
• In image processing literature, the weighting
averaging operation is referred to as image
smoothing
• By smoothing, it is implied that local
differences between pixels are reduced
• For simplicity, images are often filtered using
the same operator throughout, implying shift-
invariance
• Most image display adaptors, have hardware
convolvers built in to perform 3x3 convolutions
in real-time.
• Shift-variant filtering is chosen when local
information is to be preserved.
Original Image
3x3 averaging
K-Nearest Neighbor algorithm
• K-nearest neighbor average: compute
equally weighted average of k-nearest
neighbors – k neighbors whose gray levels
are closest to the central pixel in the
neighborhood
• Sort the neighbors on the basis of
similarity of gray level to the central pixel
• Compute the average of K neighbors
whose gray levels are closest
Example
Consider the neighborhood
33 41 37
32 46 39
30 29 28
K=4
Closest 4 gray levels to 46 are 41, 39, 37, 33
Including the central pixel, the average is
(1/5)(46 + 41 + 39 + 37 + 33) = 39.20 ~ 39
Low Pass Filter: Smoothing
High Pass Filter
- Edge enhancement
- Horizontal
- Vertical
- Diagonal