2005). The peer group associated with the central
pixel x(i, j), of a window of n x n size , is the set
comprised by the central pixel itself and its neighbors
whose distance to them is small. Several metrics can
be used for distance function. The size of the peer
group of a given pixel determines its classification as
corrupted or not. This is basically a voting criteria.
Pixels considered as corrupted are corrected by re-
placing them with a new value, determined by a given
filtering method.
This paper presents an analysis of quality and
speed, comparing three different metrics (two fuzzy
(Lopez, 2010) and one Euclidean (Camarena et al.,
2010)) used for the detection step, and two filters
(mean and median (Gonzalez and Woods, 1995)) used
in the correction step. The target is to achieve the best
balance between quality and speed.
The result shows that the output images had a sim-
ilar quality with regard to the metric used, but being
the Euclidean faster than the fuzzy ones. Which re-
spect to what filter yields the best quality/speed trade-
off, we found that it fundamentally depends on the
noise level in the original image.
This paper is organized as follows: Section 2
presents the metrics and filters used in this work, Sec-
tion 3 describes the parallel algorithm to eliminate im-
pulsive noise. The results of the experimental study
are shown in Section 4. Finally Section 5 concludes
the paper.
2 METRIC AND FILTERS
As explained in the introduction, the detection of a
wrong pixel depends on the size of its peer group
(Smolka, 2005): the set of neighboring pixels near to
them. There are several metrics to compute distance
between two pixels. We considered two fuzzy metrics
(Lopez, 2010) and one Euclidean metric (Camarena
et al., 2008). It is worth to mention that the functions
computing fuzzy metrics, two pixels are near when its
value is bigger. On the contrary and as usual, the Eu-
clidean metric outputs a small value when pixels are
closer.
In particular, the M and G fuzzy metrics between
pixels x(i, j) and y(i, j) are defined as follows:
M(x(i, j), y(i, j)) =
c
∏
l=1
min{x(i, j, l), y(i, j, l)} + k
max{x(i, j, l), y(i, j, l)} + k
,
(1)
G(x(i, j), y(i, j)) =
k
k+ kx(i, j) − y(i, j)k
2
, (2)
where the value of k is greater than zero. These
equations are the pattern of fuzzy metric when con-
sidering c color channels in the pixel. For example,
c=3 is the fuzzy metric for RGB (x(i, j, R), x(i, j, G),
x(i, j, B)). If we apply these metrics to the grayscale
images, then c = 1 and equations reduces to
M(x(i, j), y(i, j)) =
min{x(i, j), y(i, j)} + k
max{x(i, j), y(i, j)} + k
. (3)
G(x(i, j), y(i, j)) =
k
k+ |x(i, j) − y(i, j)|
. (4)
On the other hand, the Euclidean metrics, respec-
tively for c color channels and for one color are
L(x(i, j), y(i, j)) = kx(i, j) − y(i, j)k
2
, (5)
L(x(i, j), y(i, j)) = |x(i, j) − y(i, j)| , (6)
Now we can write down the definition of the peer
group of a pixel x(i, j) in a window W, depending on
the metric used ( 1),( 2), ( 3),( 4), ( 6) and( 5):
P (x(i, j), d) = {y(i, j) ∈ W : M(x(i, j), y(i, j)) ≥ d}
(7)
P (x(i, j), d) = {y(i, j) ∈ W : G(x(i, j), y(i, j)) ≥ d}
(8)
P (x(i, j), d) = {y(i, j) ∈ W : L(x(i, j), y(i, j)) ≤ d}
(9)
where 0 ≤ d ≤ 1 is the distance threshold for fuzzy
and d > 0 for Euclidean.
In order to correct a pixel early marked as cor-
rupted, we considered two filters: the arithmetic mean
and the median. Trivially, they replace a wrong pixel
x(i, j) by the average or by the median of the pixels in
the window centered at x(i, j), respectively.
3 PARALLEL DENOISING
ALGORITHM
The method for removing noise is divided into two
steps: detection and filtering. Algorithm 1 shows the
detection step using peer groups as explained above.
In this algorithm, for each pixel in the image is built a
window (W) of n x n size and obtains the pixel value
(in our case we used n = 3, because it removes more
noise and better preserves the edges and fine detail
of the image). Then, it calculates the cardinality of
the peer group according to the metric used (equa-
tion 3 and 5). If the size of the peer group is less than
m+ 1 the pixel is labeled as corrupted, where m is the
COMPARATIVE ANALYSIS ON METRICS AND FILTERS TO REDUCE IMPULSIVE NOISE IN MEDICAL
IMAGES USING GPU
535