Image Enhancement - Spatial Filtering vs.
Image Enhancement - Spatial Filtering vs.
Abstract— Filtering in Special Domain and Frequency Domain ( ) ( ) ∑ ∑ ( ) ( )
has wide used in Digital Image Processing. Low-pass filters are
used to smoothing an image, and high-pass filters are used to To generate a 𝑚×𝑛, or n× linear spatial filter requires that we
sharping an image. Using the smoothing filters to take off the specify 𝑚𝑛 mask coefficients. These coefficients are selected
small details, so it thresholding the part of interest in the image. based on what the filter is supposed to do.
Using the sharping filters to edge the image and pass only the Smoothing filters are used for blurring and for noise
high frequencies. The high-pass filter is used widely in face reduction. Blurring is used in preprocessing tasks, such as
detections. This paper examines both the special domain (SD)
removal of small details from an image. Also, it used in
and the frequency domain (FD) filtering by using a low-pass filter
in special domain and frequency domain, and a high-pass filter in bridging of small gaps in lines or curves. Smoothing linear
special domain and frequency domain, then find the Histogram filters can be also used to Noise reduction. The output image
of the filtered images to differ the image intensities. of a smoothing, linear spatial filter is simply the average of the
pixels contained in the neighborhood of the filter mask. One of
the smoothing filters is Gaussian low-pass filter:
I. BACKGROUND AND OBJECTIVE
This project introduces spatial and frequency domain filters. Sharpening or edging is to highlight transitions in intensity.
Therefore, it involves creating masks, performing convolution, While image blurring can be accomplished by pixel averaging,
Fourier transforms and inverse Fourier transforms. Digital sharpening can be achieved by spatial differentiation. The
Image Processing helps in maximizing clarity, sharpness, second derivative would produce a double edge one pixel
smoothing, and details of features of interest. Image thick, separated by zeros. Thus, the second derivative
Enhancement transforms images to provide better enhances fine detail much better than the first derivative, a
representation of the small details. It is a basic tool for property that is ideally suited for sharpening images. The
researchers in a wide variety of fields including medical second derivative in 2D is The Laplacian:
imaging, art studies, forensics and atmospheric sciences. ( ) ( ) ( ) ( )
Histogram gives an estimate of the probability of occurrence ( ) ( )
of intensity. Histogram manipulation can be used for image Frequency domain techniques are based on the
enhancement. An intensity image is a data matrix whose
manipulation of the transform of the image rather than the
values have been scaled to represent intensities. When the
image itself. Frequency domain techniques are suited for
elements of an intensity image are of class unit 8, it has integer
processing the image according to the frequency content. The
values in the range [0, 255]. principle behind the frequency domain methods of image
A spatial filter consists of a neighborhood, typically a small enhancement consists of computing the 2-D DFT.
rectangle, and a predefined operation that is performed on the
manipulating the transform coefficients by an operator filter,
image pixels encompassed by the neighborhood. Filtering
and then performing the inverse transform. The transform of
creates a new pixel with coordinates equal to the coordinates
the image has two components magnitude and phase. The
of the center of the neighborhood, and whose value is the magnitude consists of the frequency content of the image. The
result of the filtering operation. A processed (filtered) image is phase is used to restore the image hack to the spatial domain.
generated as the center of the filter visits each pixel in the Filtering is easier to do in the frequency domain. Therefore,
input image. When performing linear spatial filtering, it is
enhancement of image f(x, y) can be done in the frequency
doing correlation, or convolution in 2D. The correlation:
domain based on DFT. The convolution in spatial domain is
nothing but multiplication in frequency domain.
( ) ( ) ∑ ∑ ( ) ( ) ( ) ( ) ( ) ( )
A Gaussian low-pass filter in frequency domain is used to
The mechanics of convolution are the same, but the filter is
smooth the image and noise reduction, and a Gaussian high-
first rotated by 180°:
pass filter in frequency domain is used to sharp and edge the
image. The Gaussian low-pass filter in Frequency domain:
Image Enhancement -Spatial Filtering vs. Frequency Domain Filtering. 2
III. RESULT AND DISCUSSIONS Figure 3: Smoothed image by Gaussian low-pass filter in
1- Convert the color image to gray scale image and crop spatial domain.
it. See figure 1 for the original image, and figure 2 for
the crop gray scale image.
8- Figure 18 shows the comparison between the Figure 21: Comparison between the high-pass filtered
low-pass filtered images, it is clear that they slightly images.
Figure 18: Comparison between the low-pass filtered images. Figure 22: Color mapping for the edged image by Gaussian
high-pass filter in spatial domain.
VI. CONCLUSION
Image enhancement techniques with using Matlab as it is
showed from the results, the both ways for filtering spatial and
frequency domain are more or less the same. When it is
desired to filter an image with a small mask, it would be easier
to use the spatial domain. However, in the frequency domain,
Fourier transformation is more accurate and easier to
Figure 20: Color mapping for the smoothed image by Gaussian manipulate. Spatial filters offer considerably more versatility
low-pass filter in frequency domain. because they can be used also for nonlinear filtering, which we
Image Enhancement -Spatial Filtering vs. Frequency Domain Filtering. 6
REFERENCES