Sharpening Spatial Filters
Sharpening Spatial Filters
It
performs reverse operation of smoothing special filters.
Spatial Differentiation:
Mask coefficients
Note: in
sharpening
filter sum
of mask
coefficient
= 0 always
Generalized expression of Laplacian Mask:
c = -1 c = -1 c=1 c=1
UNSHARP MASKING AND HIGHBOOST FILTERING:
(2)
Where, k = weight (k ≥ 0)
If, k = 1; Unsharp masking
k > 1; Hight boost filtering
k < 1; emphasizes construction of unsharp masking
(a) Original image of size 600 x 259 pixels.
(b) Image blurred using a 31 x 31 Gaussian lowpass filter with s = 5.
(c) Unsharp Mask.
(d) Result of unsharp masking using Eq. (3-56) with k = 1.
(e) Result of highboost filtering with k = 4.5
USING FIRST-ORDER DERIVATIVES (Non-Linear) FOR IMAGE SHARPENING—
THE GRADIENT
First derivatives in image processing are implemented using the magnitude of the
gradient.
(1)
(2)
Using gradient of f (eq. 1) and magnitude of f (eq. 2) we can construct the
mask for sharpening the image:
Image Mask
We know that, Z5 = f(x,y), Using first order derivative
𝜕𝑓
Gradient gx = = f(x+1,y) - f(x,y) => Z8 - Z5
𝜕𝑥
𝜕𝑓
gy = = f(x,y+1) - f(x,y) => Z6 - Z5
𝜕𝑦
Magnitude
Now, we can construct two mask using gradient and magnitude equations:
-1 0
1 0
-1 1
0 0
Roberts [1965] proposes cross differences operators (Cross Gradient Mask):
gx = Z9 – Z5; gy = Z8 – Z6
-1 0 Note: There is no
central symmetry
0 1
To achieve this we
have to consider odd
Robert cross gradient mask gy = Z8 – Z6 mask i.e. Sobel Mask
3X 3 mask
0 -1
1 0
Sobel proposes a smallest 3 X 3 odd mask which can have a center of
symmetry:
Sobel Operators
-1 -2 -1
0 0 0
1 2 1
Sobel Mask for gy
-1 0 1
-2 0 2
-1 0 1
Sobel Magnitude
=| |+
| |
Note: Sum of mask coefficient is always equal to zero for any case.
Image Enhancement in Frequency Domain:
In Frequency Domain operations are performed on the Fourier transform of an
image rather than on the image itself, then it is converted back to the results in its
spatial domain using inverse Fourier transform.
Spatial FT Spatial
IFT Domain
Domain Domain Domain
(1)
(2)
Properties of 2-D discrete Fourier transform
(1) z
(2)
In polar coordinates,
the 2-D Fourier transform and its inverse are infinitely periodic in the u and v
directions; that is,
Period-1 Period-2
Now, in order to obtain one complete period we have to shift this signal, it is possible
by multiplying
(2a)
(2b)
(3)
We know that, the even component are symmetry and odd components are
antisymmetric. Therefore,
(4a)
(4b)
The product of even and odd components are
Conversely,
STEPS FOR FILTERING IN THE FREQUENCY DOMAIN:
Real Symmetric Filter
Real Symmetric Filter: Remove all the imaginary components which is parasitic
Types of Filters in Frequency domain:
Frequency Domain
Smoothing Filters (Low Pass Filter) Sharpening Filters (High Pass Filter)
Low Pass Filter: Passes the low frequency components and attenuate or
block the high frequency components.
(1)
(2)
If the frequency lies inside the circle of radius D0 it will pass
Otherwise the frequency lies outside the circle it will block.
(a) Perspective plot of an ILPF transfer function. (b) Radial cross section. (c) frequency
response
To decide the standard cut off frequency D0:
We need to consider the specified power which is enclosed within this circle.
We need to compute the power spectrum, that can be done with the help of padded
image and the power spectrum of each and every point in the padded image is to be
calculated in order to identify the power spectrum.
2. BUTTERWORTH LOWPASS FILTERS:
Ideal HPF
Butterworth HPF
Gaussian HPF
1. Ideal highpass filter (IHPF) transfer function is given by
or, with respect to the center of the frequency rectangle, using the transfer function
Using this transfer function, the Laplacian for an image can be represented as
Processed
image
(a) Original blurry image. (b) Image enhanced using the Laplacian in the
frequency domain.
HOMOMORPHIC FILTERING:
(1)
or
The filtered image in the spatial domain is then
we can express
Finally, because z(x, y) was formed by taking the natural logarithm of the input
image, we reverse the process by taking the exponential of the filtered result to
form the output image:
where
Noted: Here, filter H(u,v) selection is a big challenge. Filter should perform both
operation like, intensity range compression and contrast enhancement.
Restoration attempts to recover an image that has been degraded by using a priori
knowledge of the degradation phenomenon.
Thus, restoration techniques are oriented toward modeling the degradation and
applying the inverse process in order to recover the original image.
1. Gaussian Noise
Where
3. Erlang (Gamma) Noise
The PDF of Erlang noise is
4. Exponential Noise
Gives better smoothing than arithmetic filter, but fine can not be retained here.
3. Harmonic Mean Filter: Usually used it to remove salt noise and gaussian noise
This filter is useful for finding the brightest points in an image and reduce pepper
noise.
3. Min Filters:
The 0th percentile filter is the min filter:
This filter is useful for finding the darkest points in an image and reduce salt
noise.
5. Midpoint Filter: The midpoint filter computes the midpoint between the
maximum and minimum values in the area encompassed by the filter:
It works best for randomly distributed noise, like Gaussian or uniform noise
Encoder Decoder
Original
Visual Information
Information
Three types of Redundancy:
2. Coding Redundancy
Computer generated 256 x 256 x 8 bit images with (a) coding redundancy, (b)
spatial redundancy, and (c) irrelevant information.
Example: Variable length Coding/ Huffman Coding
Coding Redundancy
Coding Redundancy
A mapping is said to be reversible if the pixels of the original 2-D intensity
array can be reconstructed without error from the transformed data set;
0.809: 0.818
0.818: 0.824
0.824: 0.827
= 0.809: 0.8117
= 0.8117: 0.8144
= 0.8144: 0.8162
= 0.8162: 0.8171
Arithmetic
code word
0.81494
Q2.
Q3.
Q4.