You are on page 1of 4

2010 Second International Conference on Information Technology and Computer Science

A Median Filter Method for Image Noise


Variance Estimation
Zhijun Pei, Qingqiao Tong, Lina Wang, Jun Zhang
School of Electronic Engineering
Tianjin University of Technology and Education
Tianjin, China
peizj@tute.edu.cn

Abstract—Image noise estimation is of crucial importance for the noisy image is first filtered by a low-pass filter to suppress the
computer vision algorithm, for the algorithm parameter is always image structures. Then the noise variance is computed from the
adjusted to account for the variations in noise level over the difference between the noisy image and the filtered image. The
captured images. A median filter method is provided for the main difficulty of filter-based methods is that the difference
image noise variance estimation in the paper. The image was first image is assumed to be the noise but this assumption is not true
processed with a group of high pass digital filters constructed by for images with structures or details. In blocked-based methods,
several finite difference operators with different orders. For each images are tessellated into a number of blocks. The noise
filtered image data, a variance was estimated. And the noise variance is then computed from a set of homogeneous blocks.
variance is approximated by the median of those estimated
The main issue of block-based methods is how to identify the
variances. In order to avoid outlier issues when there are left
image details in the residue, variances are estimated from each
homogeneous blocks.
filtered image data for several different inter-quartile ranges, There were other different approaches proposed for noise
then a median is taken. The supposed median filter approach to estimation [7]. Basically they are still filter-based, block-based,
image noise estimation is simple and effective, which has been or the combination of both. Filter based methods are found to
verified by the experiments. perform well for high noise levels but they usually require a
high computational load. Block based methods are in general
Keywords- median filter; noise estimation; difference operator;
less complex, but they tend to overestimate when noise levels
inter-quartile range; computer vision
are low.
I. INTRODUCTION In this paper, based on finite difference operators,
combined with inter-quartile ranges, a median filter method is
The computer vision has found a wide set of applications. applied into the image noise variance estimation, which is
However, many computer vision algorithms can work well simple and robust for computer applications.
only if the parameters of the algorithm are hand-tweaked to
account for characteristics of the particular captured images.
One of the most common needs for algorithm parameter II. IMAGE NOISE
adjustment is to account for variations in noise level over the In general, images acquired by digital imaging systems are
input captured images. So in order to work well, many corrupted by a number of noise sources such as photon shot
computer vision algorithms assume that the noise level is noise, dark current noise, readout noise, and quantization noise.
known a priori, and the algorithm are adjusted according to the While some noise sources can be effectively suppressed such
noise level of the captured image instead of using fixed as dark current noise by chip cooling and quantization noise by
parameters. To make the assumption come true, noise using an analogue to digital converter with more bits, other
estimation becomes an important research topic [1]-[3]. And an noise sources are not. The signal dependent photon noise, for
essential step toward achieving reliable, automatic computer example, is unavoidable due to the quantum nature of light.
vision algorithms is the ability to accurately estimate the noise Read out noise increases proportionally with readout rate,
level of images. Examples of computer vision algorithms which cannot be lowered in high-speed systems. Although all
requiring noise level estimates include motion estimation, noise sources possess different characteristics, the total effect
denoising, super-resolution, shape-from-shading and feature of them under normal lighting conditions , i.e. not low light as
extraction [4]. in computer vision applications, is usually modelled by a zero-
mean additive Gaussian noise distribution. It is the variance of
Noise can be estimated from multiple images or a single
this additive Gaussian noise that characterizes the effect.
image. Estimation from multiple images is an over-constrained
problem [5]. Estimation from a single image, however, is an The only true measurement of image noise is to acquire the
under-constrained problem and further assumptions have to be same image twice and subtract the two images from each other.
made for the noise. Olsen gave a complete description and The remaining signal, average value or standard deviation, is
comparison of six earlier estimation algorithms [6]. They are the actual image noise. However, it is not always possible to
classified into two different approaches: filter-based (or acquire the same measurement twice, for the time sensitive
smoothing-based) and block-based. In filter-based methods, the

This work is supported by the Natural Science Foundation of Tianjin


under Grant No.09JCYBJC27300.

978-0-7695-4074-0/10 $26.00 © 2010 IEEE 13


DOI 10.1109/ITCS.2010.11
acquisitions cannot be repeated to derive the image noise. In such as the Gaussian distribution, and can be applied to the
these cases, image noise can be estimated with various methods. case of single frame and two-frame noise estimation. Similarly,
image noise is estimated from homogeneous regions in an
There is a large literature on image denoising. Although image or from difference of images after alignment. Different
very promising denoising results have been achieved using a from the above conventional methods, however, this estimate
variety of methods, such as wavelets, anisotropic diffusion and of the noise variance is not computed from the sum of squared
bilateral filtering, the noise level is often assumed known and differences, but from a Gaussian curve fit to the histogram of
constant for varying brightness values. And in the image the difference image. Although this curve fit allows robust
denoising literature, noise is often assumed to be additive white variance estimation under the presence of intensity or motion
Gaussian noise. In contrast, the literature on noise estimation is outliers, the method is computation complex.
very limited. Noise can be estimated within an image, intra-
image estimation, or between two or more successive images, In order to overcome the influence of the outliers on the
inter-image estimation. Inter-image estimation requires more noise estimation, based on difference operators, combined with
memory and is, in general, more computationally demanding. inter-quartile ranges, a median filter method is applied into the
Intra-image noise estimation methods can be classified as image noise variance estimation.
smoothing based, also called filter based, or block based. In
smoothing-based methods the image is first smoothed, for III. MEDIAN FILTER METHOD FOR NOISE ESTIMATION
example using an averaging filter, and then the difference
between the noisy and enhanced image is assumed to be the The median filter is the best known as order statistics filter.
noise; noise is then estimated at each pixel where the gradient For the image processing, the median filter, which, as its name
is smaller than a given threshold. In block-based methods, the implies, replaces the value of a pixel by the median of the gray
levels in the neighbourhood of that pixel.
variance over a set of blocks of the image is calculated and the 
average of the smallest variances is taken as an estimate. f ( x, y ) median{g ( s, t )}
( s , t )S x , y
Many noise estimation methods have difficulties estimating
noise in highly noisy images and in textured images. No The original value of the pixel is included in the
techniques were found to perform best for various noise levels computation of the median. Median filters are quite popular
and images. Some methods use thresholds, for example, to because, for certain types of random noise, they provided
decide whether an edge is given at a particular image position. excellent noise reduction capabilities, with considerably less
Smoothing-based methods were found to perform well with blurring than linear smooth filters of similar size. Median
high-noise levels but they require large computations and fine filters are particularly effective in the presence of both bipolar
tuning for various images. Smoothing based methods have and unipolar impulse noise, also called salt and pepper noise
difficulties in images with fine texture and they tend to because of its appearance as white and black dots
overestimate the noise variance. Block-based methods are, in superimposed on an image.
general, less complex than smoothing-based methods. They The outliers in the noise estimation can be considered as
tend, in general, to overestimate the noise in good quality impulse noise, so median filter method can be applied into the
images and underestimate it in highly noisy images. In some noise estimation. Here, the median filter is used to avoid the
cases, no estimate is even possible. influence of the outlier on the estimation, rather than to
Given that a variable X comes from a known distribution, it suppress the image noise.
is possible to estimate its variance directly from N observed In most computer vision applications, noise need to be
measurements x1, x2…xN. For example, the sample variance s2 estimated from a single image. Estimating the noise level from
of a normally distributed random variable X ~ N (u , V ) is
2 a single image seems like an impossible task. We need to
recognize whether local image variations are due to colour,
often estimated by the Mean Squared Error with respect to the
texture, or lighting variations from the image itself, or due to
sample mean x : the noise. It might seem that accurate estimation of the noise
1
s2
N 1
¦ ( xi  x ) level would require a very sophisticated prior model for images.
However, in this work we use a very simple median filter
method, based on a set of difference operator, to derive a bound
1
x ˜ ¦ xi on the image noise level. We first processed the image data
N with a group of finite difference operator respectively and
The Equation provides an optimal estimate of the expected estimate the noise using median filter method, combined with
value u and its variance in a least squares sense. However, a inter-quartile ranges, from the resulted different residuals.
least squares estimate is also notorious for being unreliable in In the conventional filter-based methods, the noisy image is
the presence of outliers. A single outlier sample could bias the first filtered by a low-pass filter to suppress the image
sample mean towards that value and significantly increase the structures. Then the noise variance is computed from the
sample variance. difference between the noisy image and the filtered image. The
To reduce the influence of outliers, the sample variance can main difficulty of filter-based methods is that the difference
be estimated by fitting a known distribution model to the image is assumed to be the noise but this assumption is not true
largest peak in the histogram of the available samples [8]. This for images with structures or details. The processing operation
histogram based method is not limited to a single distribution, of low pass filter and difference computation can be replaced

14
by the finite difference operation, such as Laplacian operator. difference operator fdi, there exists outliers in the filtered image
To exclude structures or details from contributing to the noise gi, which have a significantly influence on the estimated result.
variance estimation, a simple edge detection algorithm using To overcome the influence of the outliers on the estimation
first order gradients can be applied, however which needs result, combined with inter-quartile ranges, the median method
appropriate threshold to decide whether an edge is given at a can be used to the estimation of noise variance.
particular image position. The finite difference operator is a
high pass filer essentially in frequency domain sense. So for a
given input image, there possibly exists an appropriate finite
difference operator to estimate correctly the noise variance in
the image. But the difference operator is unknown and not easy
to choose. If the chosen difference operator is not appropriate
for the image noise variance estimation, the estimated result
may deviate from the reality value randomly, higher or lower,
because of the influence of the outliers, or the residual image
structures. In the other hand, if a set of finite difference
operators with different frequency characteristics is used
separately for the pre-processing, for some finite difference
operators, the estimate noise variance may larger than the Figure 1 Frequency domain characteristics of finite difference operators
expected value, and for other finite difference operators, the
estimated noise variance may less than the expected value. In statistics, an outlier is an observation that is numerically
Because the resulted deviation from the expected noise distant from the rest of the data. Deletion of outlier data is a
variance is randomly, just like impulse noise, median can controversial practice frowned on by many scientists and
considered as the final estimation of the noise variance science instructors. While mathematical criteria provide an
according to the median filter method. objective and quantitative method for data rejection, they do
not make the practice more scientifically or methodologically
We assume that the image is corrupted by additive, zero sound, especially in small sets or where a normal distribution
mean white Gaussian noise with unknown deviation, and the cannot be assumed. Rejection of outliers is more acceptable in
model is given by areas of practice where the underlying model of the process
I n (x, y) = I (x, y) + n(x, y) being measured and the usual distribution of measurement
Where, x and y are the vertical and horizontal coordinates error are confidently known.
of a pixel, In(x, y), I(x, y) and n(x, y) are the noisy image, the
original image and the additive Gaussian noise respectively. Estimators capable of coping with outliers are said to be
Our goal is to estimate the standard deviation of the noise from robust. And the median is a robust statistic. Like the median,
the noisy image. To exclude the image structures, the image is the inter-quartile range, IQR, is insensitive to outliers. In
first processed with different order of finite difference statistics, the inter-quartile range (IQR), also called the mid-
operators, fdi. spread or middle fifty, is a measure of statistical dispersion,
g i ( x, y ) I n ( x, y ) fd i being equal to the difference between the third and first
quartiles.Unlike the total range, the inter-quartile range is a
Here, these finite difference operators with different order robust statistic, having a breakdown point of 25%, and is thus
can construct a group of high pass filters with different often preferred to the total range. We can try to back out the
frequency characteristic. For example, one order difference noise variance. To compute an inter-quartile range, like the
along the row and column can expressed as distance between the 25% and 75% points. This trims off the
I x (m, n) I (m, n  1)  I (m, n) trash at each end, potentially corrupted if there are image
I y (m, n) I (m  1, n)  I (m, n) structures in the image gi. For a normal distribution, where
IQR | 1.349V
So one order difference operator can be expressed as fd1 =
[1 -1]. Similarly, more high order of finite difference operators To avoid outlier issues when there are left image details in
can be expressed: fd2 = [1 -2 1]; fd3 = [1 -3 3 -1]; fd4 = [1 -4 6 the residue, actually do this for several different inter-quartile
-4 1]; fd5 = [1 -5 10 -10 5 -1]; fd6 = [1 -6 15 -20 15 -6 1]. ranges, and then take a median.

The frequency characteristics of the set of finite operators IV. EXPERIMENT AND DISCUSSION
are shown in Fig.1. Apparently, these finite difference
operators have high pass feature in frequency domain but with To illustrate that the provided median filter method for
different cut-off frequency. From the processed image gi, the image noise estimation, we apply our noise inference to several
different applications images. The resulting method, properly
noise variance V i can be estimated, and the estimated image
2
accounting for image noise, show robust behavior over a wide
noise variance is approximated by the median filter method: range of noise conditions.
Vˆ 2 median{V i2 } In experiments, different application fields of images are
considered as the ideal object images. And Gaussian noise with
Here, how to estimate the noise variance V i from the
2
zero mean and different variance were added to these object
image gi should be pay more attention. For given finite images, as shown in Fig. 2. where (a) is cameraman image, 8

15
bit, the size of 256 × 256 pixels; (b) is lily image, 8 bit, TABLE 1 IMAGE NOISE VARIANCE ESTIMATION
186×230 pixels; (c) is westcordorthophoto image, 8 bit,
366×364. Added V21 0.1 0.05 0.01 0.005 0.001 0.

(a) V̂ 0.1935 0.0674


2
0.0394 0.0097 0.0052 0.0014 9.59e-5

(b) V̂ 0.1919 0.0648


2
0.0384 0.0103 0.0056 0.0016 2.7e-4

(c) V̂ 0.2011 0.0726


2
0.0432 0.0118 0.0069 0.0027 0.0015

V. CONCLUSIONS
We present a simple and robust algorithm for image noise
(a ) cameraman (b) lily (c) westcordorthophoto estimation. The input captured image is assumed to be
Figure 2 Noisy images
corrupted by additive zero mean Gaussian noise. To exclude
structures or details from contributing to the noise variance
First, consider the cameraman image as the test image. The estimation, a set of finite difference operator is applied first.
sample image is preprocessed by the finite different operator Then a median filter method provides very accurate noise
separately. For each finite difference operator, the image is variance estimation when the noise level is not high. There is
convolved along each rows of the test image, then along each no parameter needed to adaptive to the image contents.
column of the intermediate result. The resulted images are Simulation results show that the proposed algorithm performs
shown in Fig. 3. Apparently, for more high order finite well for different types of images over a large range of noise
difference operator, more less image details are left in the variances. The proposed noise estimation method is simple
resulted image, due to more high cutoff frequency. To and robust. It only required convolutions and median. The
overcome the influence of the outliers on the noise variance proposed method of image noise estimation can be used to the
estimation, median filter method combined with inter-quartile computer vision applications, and also can be extended to
ranges is used to the estimation, just as discussed above. other image processing applications. In the other hand, when
the noise level is high, the estimation of the supposed
approach is not accurate, which should be improved in the
future work.
ACKNOWLEDGMENT
This work is also partially supported by Research Start
Foundation of Tianjin University of Technology and Education
under Grant No. KYQD08015.
(1) fd1 (2) fd2 (3) fd3
REFERENCES
[1] Ce Liu, Richard Szeliski, Sing Bing Kang, C. Lawrence Zitnick, and
William T. Freeman, “Automatic Estimation and Removal of Noise
from a Single Image”, IEEE TRANSACTIONS ON PATTERN
ANALYSIS AND MACHINE INTELLIGENCE, VOL. 30, NO. 2,
FEBRUARY 2008, pp.299-314.
[2] C. Liu,W.T. Freeman, R. Szeliski, and S.B. Kang, “Noise Estimation
from a Single Image”, in IEEE Conf. on Computer Vision and Pattern
(4) fd4 (5) fd5 (6) fd6 Recognition, 2006.
[3] A. Amer and E. Dubois, “Fast and Reliable Structure-Oriented Video
Figure 3 Resulted images with finite difference operator
Noise Estimation,” IEEE Trans. On Circuits and Systems for Video
Technology, Vol. 15, No. 1, pp. 113-118, Jan. 2005.
For the tested images, the results of the noise variance [4] D. ROBINSON, P. MILANFAR, “Fundamental Performance Limits in
estimation are show in table 1. In the table the estimated result Image Registration”, IEEE Trans. Image Process. 2004, Vol.13,No.9
for the case when the added noise variance is zero is also given, pp.1185–1199.
because there may exists some noise in the ideal object images, [5] D. Lowe, “Object recognition from local scale-invariant features”, In
more or less, which should be subtracted from the estimated Proc. IEEE Int’l Conf. Computer Vision, pages 1150–1157, 1999.
results when consider the estimation error. The estimated [6] S. I. Olsen, “Estimation of noise in images: An evaluation”, Computer
results show that when the noise level is high the difference Vision Graphics Image Process. Graphic Models and Image Process,
between true variance and estimated value is large due to low Vol.55, No. 4, pp. 319-323, 1993.
ration of signal to noise. In contrast, when the added noise level [7] R. C. Bilcu and M. Vehvilainen, “A New Method for Noise Estimation
in Images,” Proc. IEEE EURASIP International Workshop on Nonlinear
is middle level or low level, the estimated is more accurate. In Signal and Image Processing, Sapporo, Japan, May 18-20, 2005.
practical computer vision applications, the noise level in the [8] J. Sijbers, D. Poot, A.J. den Dekker and W. Pintjenst, “Automatic
captured image is always less than the middle noise level case, estimation of the noise variance from the histogram of a magnetic
so the provide method can be used to the noise estimation for resonance image”, Phys Med Biol, 2007; pp. 1335-1 348; vol. 52.
the computer vision applications.

16

You might also like