Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Image Denoising Algorithm Based on PSO Optimizing

Structuring Element
Zhu youlian, Huang cheng
College of Electronic Information Engineering, Jiangsu Teachers University of Technology, Changzhou, China, 213001
E-mail: czzhuyoulian@126.com

Abstract: A new image denoising algorithm is proposed to deal with information loss in the conventional morphological
image denoising process. The algorithm uses median operation to improve morphological operations’ performance,
which called median closing operation. It gives a mathematical model of the structuring element unit (SEU) composed of
a zero square matrix. The particle swarm optimization (PSO) algorithm is employed for choosing the size of structuring
element. The value of peak signal to noise ratio (PSNR) is taken as a fitness function, and the transformed value of the
particle's position is taken as the size of the structuring element. Experimental results show that the denoising
performance of the proposed algorithm has obvious superiority than conventional morphological algorithm. It can
overcome the inherent deficiency of conventional morphological operations, adaptively obtain the size of the structuring
element, and effectively remove impulse noise from images, especially for the image whose signal to noise ratio value is
relatively low. So it has a good prospect in image processing.
Key Words: Image Denoising, Morphological Filter, Particle Swarm Optimization (PSO), Structuring Element (SE);
Peak Signal-to-noise Ratio (PSNR)

morphological filters can not overcome the inherent


1 INTRODUCTION deficiency of conventional morphological operations.
In an image capturing and processing system, noise will Erosion and dilation are core morphological operations in
appear which may be classified as Gaussian noise, which extremum operations are used. Erosion and dilation
equilibrium noise and impulse noise. Impulse noise makes can remove noise of images, but they would make images’
a image appear random black points alternating with white information lose at the same time. Therefore, the
points, which not only corrupts true information of the application of the morphology theory is restricted in the
image, but also seriously affects the visual effect of the image denoising field, especially for denoising of the image
image. Thus, impulse noise reduction has important whose signal to noise ratio is low and morphological filters
significant for image processing and computer vision can not obtain satisfactory denoising results [4, 6].
analysis [1].
Based on the prophase study of [1], [10] and [11], we
Linear or non-linear filter algorithms can be used in the introduce median operation to improve morphological
image denoising process. Details of an image are high operations and propose a new conception about median
frequency components in frequency domain and they are morphology, and its operation is called median
easy to confuse with high frequency noise. How to remove morphological operation. It includes four kinds of
noise and maintain details of the image has been a hot issue operations such as median opening, median closing,
in image denoising. The morphological filter is a median opening-closing and median closing-opening, and
representative non-linear filter based on mathematical their denoising properties are compared in the next Section.
morphology. At present, how to design a morphological Median-closing operation is adopted for image denoising in
filter, there is no system design method. the paper. We introduce the particle swarm optimization
Morphological filter researches mainly concentrated in algorithm (PSO) in the SE’s size selection process. The
two aspects: one is the morphological application research transformed value of particles’ position is taken as the SE’s
in which the mathematical morphology theory and method size. Taking the PSNR of the image as the fitness function,
are used in many areas [2-5]; another is the design of we propose an adaptive algorithm of the structuring
morphological algorithms [6, 7]. No matter which aspect element unit (SEU) which composed of a zero square
inevitably involves two key problems: morphological matrix and simulate it in MATLAB7.0. Experimental
operations and structuring elements (SE). The satisfaction results show that the proposed method can effectively
of the morphological processing result is closely related to remove impulse noise and maintain information of images,
morphological operations and the SE. Reported especially for denoising of the image whose signal to noise
ratio is low.
This work was supported by Jiangsu Teachers University of
Technology natural science funds # KYY09020 and # KYY10043.

978-1-4577-2074-1/12/$26.00 2012
c IEEE 2404
2 MEDIAN MORPHOLOGICAL 2.3 Denoising Properties of Different Median
OPERATIONS AND THEIR PROPERTIES Morphological Operations
Median morphological operations include median
2.1 Median Morphological Operations opening, median closing, median opening-closing, and
Suppose f is an image composed of a W × H set of median closing-opening. According to EQ. (5) and EQ. (6),
median opening f by SE is median erosion f by SE, followed
pixels, SE is referred to as structuring element (SE) in by median dilation of the result by SE; median closing f by
morphological operations, and it is composed of a m × n set SE is median dilation f by SE, followed by median erosion
of pixels. Then, two conventional morphological operations of the result by SE. Conventional erosion shrinks objects on
of f by SE can define as images, and conventional dilation expands them. So
{ }
Erosion: f ΘSE = min f − i , − j − SE (i, j ) , (1) median opening may expand objects on images, and
median closing shrink them. Impulse noise is suddenly
Dilation: f ⊕ SE = max{ f + SE (i, j )}.
i, j
(2) appeared discrete pulses with large amplitude and short
duration time, which should be better restrained by median
In erosion, the minimum value is selectedˈit can remove closing operation. Suppose we take Lena image and apply
image noise points that enlarged by noise, but can not different density noise to it. We respectively use four kinds
remove image noise points that reduced by noise. In of median morphological operations to remove noise from
dilation, the maximum value is selected and the visual Lena image. Some experimental results are shown in table
effect inverses to the eroded image. Details of the image are 1 and fig.1. According to fig.1, median closing operation
lost in erosion and dilation. Applications of conventional has obvious superiority than the others. Thus, the paper
morphology are restricted by extremum operations. Thus, adopts median closing operation to remove noise.
we define a new conception about median morphology in
which extremum operations of conventional morphology Table 1. Denoising properties of median morphological
are changed into median operation. Median erosion of f operations
by SE, denoted f ΘSE , median dilation of f by SE, Median Median
Median Median
SE’s
Noise Opening- Closing-
denoted f ⊕ SE , median operation denoted Median , they density
Closing Opening
Closing Opening
Size
PSNR(dB) PSNR(dB) n
are defined as PSNR(dB) PSNR(dB)
Median erosion: f ΘSE = Median{f −i ,− j − SE (i, j )}, (3) 30% 26.2661 25.7630 25.6455 25.6769 3
35% 25.1503 24.1089 23.6201 23.9110 4
Median dilation: f ⊕ SE = Median{f i, j + SE (i, j )} , (4)
50% 23.4201 22.8693 22.4391 22.3471 5
where i ∈ {1, 2 , " , m } , j ∈ {1, 2 , " , n } . Other median 60% 22.4661 21.3145 21.1131 20.9992 8
morphological operations are defined as
Median opening: f D SE = ( fΘSE ) ⊕ SE , (5)
Median closing: f • SE = ( f ⊕ SE )ΘSE , (6)
Median opening-closing: OC ( f , SE䯵 = f D SE • SE , (7)
Median closing-opening: CO( f , SE䯵 = f • SE D SE . (8)

2.2 Properties of Median Morphological Operations


Median morphological operations inherit properties of
conventional morphological operations. Thus, they have
properties such as translation invariance and cascading
decomposition. The translation invariance of median
erosion and median dilation can be defined as below.
Translation invariance:
( f x + y )Θg = ( f Θg ) x + y , (9)
( f x + y) ⊕ g = ( f ⊕ g ) x + y . (10)
Fig.1 Denoising performances of median morphological
Define cascading decomposition of median opening and
operations
median closing as
ΑΘnΒ = ( ΑΘΒ)ΘΒ "
,
ΘΒ (11) 3 RELATIONSHIPS BETWEEN SE AND
n −1 PSNR
Α ⊕ nΒ = ( Α ⊕ Β)⊕
 Β"
Β .

(12)
n −1 3.1 Proposed the SEU Composed of a Zero Square
The cascading decomposition can be used in image Matrix
processing. Noise of images can be removed by cascading
median erosion and median dilation repeatedly. The role of the SE is similar to a filtering mask in signal
processing; the SE’s shape and size will directly affect the

2012 24th Chinese Control and Decision Conference (CCDC) 2405


morphological filtering output. Once a corresponding 4 THE SE’S SIZE DETERMINED BY THE
morphological operation has been selected, the SE will be PSO ALGORITHM
the key to denoising effect. In general, the selection of the
SE needs to consider the following two principles: To get the SE’s size on different noise density situations,
(1) Similarity: the SE’s shape should be as far as we use the particle swarm optimization (PSO) algorithm to
possible similar to the noise’s shape. adaptively determine the SE’s size. For an image with the
fixed noise, there is a suitable SE’s size to keep details of
(2) Coverage: the SE’s size should be greater than the
the image while the noise is removed.
noise’s size, but should be less than the size of non noisy
objects on images. The paper proposed the SEU composed 4.1 The PSO Algorithm
of a zero square matrix to remove impulse noise.
The PSO algorithm is a kind of heuristic global
3.1.1 Definition of the SEU optimization technology [8, 9], originated in birds and fish
group movement behavior research. Different with the
A set is composed of many structuring elements, their
genetic algorithm, the PSO algorithm searches for the
shapes are the same but their sizes are different, which is
optimal solution through collaboration between the
called a SE set. In the SE set, there is a structuring element
individuals. It takes for the particle as an individual, and
SEi; any structuring element can be obtained through
sets the simple behavior rule for each particle, so that the
morphological operations of SEi and itself. This kind of
entire particle swarm show complex features. It can be used
structuring element is called structuring element unit (SEU).
to solve complex optimization problems. The idea of the
∀ SEi ∈{SE0 , SE1,", SEn ,"}, for any structuring element PSO algorithm is demonstrated as below.
SEj, take SEi as the structuring element, then SE j = Ψ ( SEi ) , Suppose in a target searching D-dimension space, there
SEi is SEU, n is a nonnegative integer, SEn is the SE which is a swarm composed of particles, we use a D-dimension
size is n. It can be proved the SEU is unique [10]. vector Xi=(xi1,xi2,…, xid) indicate the position of the i-th
particle, use Pi=(pi1, pi2, …,pid) indicate the optimal position
3.1.2 SEU Composed of Zero Square Matrix of the i-th particle, use Pg=(pg1,pg2, …, pgd)indicate the best
According to the definition of the SE, it will influence the optimal position of the whole swarm, and use Vi=(vi1, vi2,
image characteristic value when it contains in operations. …, vid) indicate the i-th particle velocity which resolve the
To avoid the negative influence of the SE, we adopt the particle’s displacement of unit iteration times in the
SEU composed of zero square matrix which values are all searching space.
zero. Moreover, the SE has the cascading decomposition in Formula (15) and formula (16) are used to adjust the
operations. To a n × n SE, it can be resolved n-th times particle’s velocity and position [11].
cascading operations of the SEU, that is ( ) (
vidn +1 = ωvidn + c1r1 Pid − xidn + c 2 r2 Pgd − xidn )
f ΘSEn = ( f ΘSEU ) Θ SEU
" ΘSEU

(13)
n −1 ­vid = v max , vid > v max (15)
f ⊕ SEn = ( f ⊕ SEU )⊕ ⊕ (14) ®
SEU
"
SEU

¯vid = −v max , vid < −v max
n −1
n+1 n n+1
Where n is the size of the SE. For a noisy image, cascading xid = xid + vid , i = 1,2,..., m, d = 1,2,..., D (16)
operations of the SEU are used to complete morphological where c1 and c2 are acceleration constant and their values
operation by a big-size SE. so we can find the optimal SE are not negative number, r1 and r2 are random functions and
according to cascading operations of the SEU. their values range from 0 to 1, vmax is the maximum velocity
§0 0· and it is a constant. When vmax is bigger, the particle flies
It can be proved that SEU = SE1 = ¨ is the
¨ 0 0 ¸¸ fast. This is helpful for global search, but the particle maybe
© ¹ flies over the best optimal position. When vmax is little, the
mathematical model of the SEU composed of a zero square particle may search in a specific area carefully. To
matrix. accelerating convergence of the particle swarm, reference
[9] introduces the constriction factor in the PSO and
3.2 Relationships between the SE’s Size and PSNR
formula (15) is transformed to
Quality estimation indexes of the image mainly include
the peak signal to noise ratio (PSNR) and the signal to noise
( ( ) (
v idn +1 = x v idn + c1 r1 Pid − x idn + c 2 r2 Pgd − x idn ))
ratio (SNR). If the size of an image is very large, we can ­v id = v max , v id > v max (17)
sample and analyze the local PSNR. Generally, the image ®
visual effect is better when the PSNR is bigger. ¯v id = − v max , v id < − v max
After chosen the SE, the denoising effect is determined where x=2/|2- φ - φ 2 − 4φ | is the constriction factor,
by the SE’s size. If the SE’s size is too big, the image’s φ = c1 + c 2 > 4 . In general, x=0.729, c1=c2=2.05.
noise can be removed, but the image’s details will be
seriously lose. Inversely, if the SE’s size is too small, the 4.2 Relations between the PSO and the SE
image’s noise can not be removed efficiently.
Parameters of the PSO mainly include the particle
position, velocity, fitness and the size of a swarm.

2406 2012 24th Chinese Control and Decision Conference (CCDC)


Random number in the interval [0, 1] is used to initialize proposed algorithm, respectively. (n) is the relationships
the particle position. The value of the particle position is between the PSNR and the noise density.
multiply by 10 and the result is rounded a number to the
nearest integer which is taken as the SE’ size. In general,
the SE’s size is an integer from 2 to 10. Thus, the value of
the particle position is limited to the interval [0.15, 1.04].
Fitness function is used to weigh the matching between
the solved solution and the function to be solved. In this
paper, the PSNR is used as fitness function and the SE’s
size is determined by the PSO algorithm. (a)Original image
4.3 Algorithm Implementation Steps
Algorithm implementation steps of the self-adaptive
SE’s size are shown in the below.
(1) Input an original image and generate an image
contaminated by impulse noise.
(2) Initialization parameters and make x=0.729, c1= (b) 15% noise density (c) 30% noise density (d) 55% noise density
c2=2.05.
(3) Set the particle number n, random generate n initial
solutions, set the initial velocity equal to 0.1; set current
iterations t=1, set maximum iterations tmax; take the
converted current solution as the SE’s size, take the PSNR
of the computed image as the individual extreme value Pid,
(e) (f) (g)
take the biggest PSNR in n particles as the global extreme
value gid.
(4) According to particles’ current position and velocity,
use formula (16) to update the particles’ position, use
formula (17) to update particles’ velocity and limit the
velocity less than vmax.
(5) Compute fitness value of each particle’s new (h) (i) (j)
position, which is the PSNR of the image after median
closing operation.
(6) Compare each particle’s current PSNR with its own
maximum PSNR, if the former is greater than the latter, use
the current PSNR to update the individual best optimal
solution.
(7) Compare each particle’s current PSNR with global (k) (l) (m)
maximum PSNR, if the former is greater than the latter, use
the current PSNR to update the global best optimal solution.
(8) Judge whether particles convergence: if
convergence, then end search optimizing; if not, then
t=t+1and turn to step (4).
(9) If search optimizing end, convert the best optimal
solution to the value of the SE’s size, remove the image
noise and output the restored image.

5 SIMULATION EXPERIMENTS
The proposed algorithm is simulated in MATLAB7.0
and some experimental results are given in the below.
Experiment 1: comparison between conventional
morphological filter algorithm and the proposed algorithm. (n)
Fig. 2 Experimental results of the conventional morphological
Fig. 2 (a) is an original image of peppers. (b), (c) and (d)
filter and the proposed filter
are contaminated images with 15%, 30% and 55% density
impulse noise, respectively. (e), (f) and (g) are experimental Experiment 2: license plate number extraction.
results of the conventional morphological filtering
Fig. 3 (a) is a noisy image of 80% noise density. The
algorithm, respectively. (h), (i) and (j) are experimental
proposed algorithm is used to processing the noisy image
results of the proposed algorithm, respectively. (k), (l) and
and experimental result is shown in fig. 3 (b), its PSNR is
(m) are relations between the PSNR and iterations of the
equal to 19.6777.

2012 24th Chinese Control and Decision Conference (CCDC) 2407


flexible. The proposed algorithm takes the PSNR as a
fitness function, so that it can self-adaptively get the SE’s
size according to noise density. These help to improve
morphological noise reduction performance.
(3) The proposed algorithm has good adaptability and
has obvious superiority in low SNR image noise reduction.
(a)
REFERENCES
[1] Zhu Youlian, Huang Cheng. An Improved Fast Median Filtering
Algorithm Combined with Average Filtering, International
Conference on Measuring Technology and Mechatronics
Automation, 420-423, 2011.
[2] Jesús Angulo, Jean Serra, Automatic analysis of DNA micro-array
(b) images using mathematical morphology, Oxford:
Fig. 3 License plate number extraction using the proposed BIOINFORMATICS, Vol.19, No.5, 553-562, 2003.
algorithm [3] Shen Zhengyan, Sang Enfang, Gao Yunchao, Ge Guangtao,
Research of edge detection based on morphological wavelets for
From fig.2 and fig.3, the proposed algorithm can sonar image, Journal of Information and Computational Science,
adaptively get the SE’s size according to noise density and Vol.5, No.4, 1791-1798, 2008.
effectively remove impulse noise on images. When noise [4] Sang Enfang, Shen Zhengyan,Bian Hongyu,Ge Guangtao, Sonar
density increases, the algorithm proposed in the paper has Image Denoising Algorithm in Morphological Wavelet Domain.
Journal of Data Acquisition & Processing, Vol.25, No.3, 324-328,
obvious superiority than conventional morphological 2010. (in Chinese)
algorithm. [5] Hamid M S, Harvey N R, Marshall S, Genetic Algorithm
Optimization of Multidimensional Grayscale Soft Morphological
6 CONCLUSIONS Filters with Application in Film Archive Restoration, IEEE Trans. on
Circuits and System for Video Technology, Vol.13, No.5, 406-416,
According to median operation and morphological 2003.
operations, the paper proposed an image denoising [6] Xie Kefu, Luo An, Research on quantum-inspired mathematical
algorithm based on particle swarm optimizing structuring morphology, Acta Electronica Sinica, Vol.33, No.2, 284-287, 2005.
element and used it to remove noise from the image whose (in Chinese)
noise density is greater than 30%. Innovations of the [7] Jian Liu, Research on morphological filter algorithms based on
mathematical morphology, Harbin Institute of Technology, Harbin,
proposed algorithm are in the below. 2006. (in Chinese)
(1) Median operation is introduced into the design of the [8] Kennedy J, Eberhart R C, Particle Swarm Optimization, IEEE
morphological filter. A new conception about median Intermational conference on Neural Networks, 1943-1948, 1995.
morphology is proposed and there are four kinds of median [9] Mendes R, Kennedy J, Neves J, The fully Information Particle
operations which inherit properties of conventional Swarm: Simpler, Maybe be Better, IEEE Transaction on
Evolutionary Computation, Vol.8, No.3, 204-210, 2004.
morphological operations. The proposed algorithm
[10] Zhu Youlian, Huang Cheng, Xu Zhihuo, Image denoising algorithm
overcomes the inherent deficiency of conventional based on the median morphological filter, the World Congress on
morphological operations, and enhances filters’ denoising Intelligent Control and Automation, 3979-3984, 2008.
ability. [11] Zhu Youlian, Huang Cheng, Tao Weige. Frequency domain
(2) The SEU composed of zero square matrix is Optimization Design of Linear Phase, International Conference on
Measuring Technology and Mechatronics Automation, 313-316,
proposed, and the PSO algorithm is introduced to optimize 2010.
the SE’s size. These make the SE’s description more

2408 2012 24th Chinese Control and Decision Conference (CCDC)

You might also like