Image-denoising-with-weighted
Image-denoising-with-weighted
Abstract—Real world signals commonly exhibit slow vari- II. R ELATED W ORKS
ations or oscillations, punctuated with rapid transients. For
example, images typically have smooth regions interrupted by There is substantial amount of work available on various
edges or abrupt changes in contrast. These abrupt changes are image denoising techniques. Denoising techniques can be
often the most interesting parts of the data perceptually, as well broadly categorized into two approaches: (A) spatial filtering
as in terms of the information that they provide. Some of the methods and (B) transform domain filtering methods.
high frequency content represents the important abrupt changes
in image intensity that are associated with real edges of objects
in the image. However, some of the high-frequency content also A. Spatial Filtering
comprises the noise that is present in the image. We wish to
retain this edge information, while removing the noise. In this Spatial filters are widely used till days before edge detec-
paper, we present a dynamic filtering process where the dynamic tion algorithms are applied. These methods have less compu-
mask is oriented to match the local gradients and its weights are tational complexity which is most suitable as a pre-processing
proportional to the magnitude of the local gradients. technique. These methods remove noise by convolving the
Keywords—Image denoising, Non-local filters, Spatial filtering, original image with a mask (sliding window). Spatial filters
Noise removal, Edge detection. can be further sub divided into two categories: (1) Linear filters
and (2) non-linear filters.
&
&
)
*
) *
&
&
*
)
)
)
*
#
$
Fig. 1: The figure contains an system overview (top diagram) and detail (lower diagram)
2) Non-linear Filters: Largely linear filters eliminate noise The principle idea behind wavelet transform is to break up
to a reasonable level but they achieve this at the expense of a signal into different frequency components. Next, each
blurring images. A variety of nonlinear median- type filters section is analysed with a resolution that matches its scale.
such as weighted median [8], rank conditioned rank selection The effectiveness of this method lies in its capability of
[9], and relaxed median [10] have been proposed to handle the representing the signal in few transform coefficient values.
limitations of linear filters. Wavelets provide some advantages over Fourier transforms.
For example, they do a good job in approximating signals
The median filter also engages the mask approach similar with sharp spikes or signals with discontinuities. The wavelet
to the mean filter. The center pixel under the mask is replaced equation produces different wavelet families like Daubechies,
with the median value of the pixel values that belong inside the Haar, Coiflets, etc. [12]. But these methods have high run
mask. As the median value is not significantly influenced by time complexity and also depend on the cut-off frequency and
an outlier in a neighbourhood, the median filter is more robust the filter function behaviour. Furthermore, they may produce
compared to the mean filter. For the same reason, the median artificial frequencies in the processed image.
filter also performs significantly better while preserving the
sharp edges.
III. I MAGE D ENOISING USING W EIGHTED
The spatial median filter is another variation of non- OR IENTATION -M ATCHED FILTERS (WORM)
linear filters. In this filter, the median value is computed by
computing the spatial depth between a point and a set of points Figure 1 describes the pyramidal system architecture of the
in a neighbourhood. The central pixel inside a mask is judged proposed image denoising technique. Given an image S, the
to be corrupted or not based on these spatial depth values. image is first filtered with a low-pass filter, which removes the
The central pixel will remain unchanged if the pixel is not high spatial frequencies whilst preserving the low-frequency
corrupted. components of the image. Concurrently, an edge mask W (see
Figure 1, Operation EM) is generated from the input image
There are various implementations of weighted median S. To create the edge mask, we apply a low pass filter and a
filters (WMF) available. The weighted median filters give more high pass filter to the rows of the image S. The low pass filter
weight to some values within the window. The centre weighted extracts the low-frequency components (Horizontal Approxi-
median filter is an extension of the weighted median filter mation) and the high pass filter extracts the high-frequency
where weight is given to the central value of a window and components (Horizontal Detail). We then apply a high pass
is thus easier to design and implement than other versions of filter to the columns of the Horizontal Approximation, which
weighted median filters. yields a horizontally smoothed Vertical Detail (VD) of the
original Horizontal Approximation. Similarly, by applying a
B. Transform Domain Filtering low pass filter to the columns of the Horizontal Detail, we
obtain a vertically smoothed Horizontal Detail (HD). In effect,
Amongst various methods denoising under transform do- this is a rapid way of low-and high-pass filtering the image
main filtering, the most popular is wavelet transform [11]. S in two dimensions that speeds up computation by taking
1023
2
2
2
WL−1 (2x + m, 2y + n) + WL−1 (2x − m, 2y − n)
PL (x, y) = LP F OL−1 (2x + m, 2y + n) (1)
m=−2 n=−2
2
2
WL−1 (2x + m) + WL−1 (2x − m)
PL (x) = LP F OL−1 (2x + m) (2)
m=−2
2
1024
3
alternate rows and columns) can create problems, such as
aliasing, and loss of useful information. Smoothing (low-
pass-filtering) the image prior to downsampling would solve
the aliasing problem. This smoothing process is illustrated in
Figure 3 for one dimension. The intensity value at pixel 2 in
the level L+1 is obtained by calculating a weighted sum of
(a) (b)
the intensity values at pixels 2,3,4,5 and 6 from the low pass
filtered output (LPFO) in level L, as shown in Figure 5. (This
process obviously discards the border pixels in the level L+1). Fig. 7: a) Original image b) Salt & pepper noise added version
Fig. 8: High pass filter output shows that the noise reduces as
the level increases
above, for processing at the next level. Additionally, a high
pass filter output is also shown at each level in Figure 8 .
Fig. 6: Dynamic weights assignment This high pass filter is required for two reasons. Firstly, the
noise reduces significantly as the level increases - as can be
seen from the high pass filter outputs (figure 8). Going too far
To illustrate the entire process described above, we take an down the pyramid level will eventually get rid of some true
image (Figure 7a) and add some salt and pepper noise using the edges. For this reason, visual examination of the high pass
imnoise function from Matlab. The parameter noise density(d) filter output - allows us to determine the coarsest level of the
of imnoise was set to 0.10. This affected approximately 10% pyramid that we need to construct. For the particular example
pixels of the original image of dimension 256x128 as shown shown in Figure 8, level 3 is visually chosen to be the coarsest
in figure 7b. The noisy image is now passed through a low level, as some of the true edges have already disappeared at
pass filter and the edge mask (W) is generated from the level 4 and the input image (unfiltered) at level 3 is nominated
image as shown in Figure 8. The symbol represents the as the denoised version of the original noisy image. Secondly,
dynamic convolution and down sampling process described we can apply a threshold on the final high pass filtered output
above, which produces an edge-enhanced and down-sampled to further reduce the noise and then by combining outputs of
1025
4
the thresholded high pass and low pass filters (at the highest Original Signal
level of the pyramid), we produce a denoised version of the 300
200
original noisy image.
100
0
20 40 60 80 100 120
Our Method SNR: 16.85 dB
300
IV. E XPERIMENTAL R ESULTS
200
100
To test our smoothing technique, we take one row of an 0
image as shown in Figure 9a and 9c. We add salt and pepper 20 40 60 80 100 120
noise by using the imnoise function of Matlab to the image 300
Wavelet SNR: 16.85 dB
as shown in figure 9b with the parameter noise density(d) 200
set to 0.10 and pick the same row shown in Figure 9d. 100
We compare our method of smoothing and denoising with 0
other popular image smoothing and denoising methods, as 20 40 60 80 100 120
Median SNR: 15.03 dB
shown in Figure 10. The signal to noise ratio is computed 300
by SN RDB = −20∗log10 norm(abs(original−new))
norm(original) . 200
100
0
20 40 60 80 100 120
Gaussian SNR: 13.24 dB
300
200
100
0
(a) (b) 20 40 60 80 100 120
300 Savitzky Golay SNR: 12.88 dB
300
200 200
Intensity
100
100
0
0 20 40 60 80 100 120
20 40 60 80 100 120
Row index Average SNR: 12.09 dB
300
(c) 200
300
100
200 0
Intensity
20 40 60 80 100 120
100
Moving Average SNR: 10.04 dB
300
0
20 40 60 80 100 120 200
Row index
100
(d) 0
20 40 60 80 100 120
1026
5
TABLE I: Detection accuracy with various types and densities of noise added to the images
Noise density (m/d) 0.1 0.2 0.3 0.4 0.5
Noise type SPN GWN SPN GWN SPN GWN SPN GWN SPN GWN
Without Denoising 90% 92% 85% 86% 73% 69% 54% 48% 35% 32%
With Denoising 93% 94% 91% 89% 79% 75% 65% 62% 44% 37%
Fig. 11: (a) Logic map for k=20 on raw frames 79 & 78 (b) Logic map for k=20 on denoised frames 79 & 78 (c) Centroids of
different logic maps on raw frames 79 & 78 (d) Centroids of different logic maps on denoised frames 79 & 78
1027
6