Image Smoothing Based On FPGA
Image Smoothing Based On FPGA
Image Smoothing Based On FPGA
net/publication/329170459
CITATIONS READS
0 606
2 authors, including:
SEE PROFILE
Some of the authors of this publication are also working on these related projects:
All content following this page was uploaded by Farah Saad Al-Mukhtar on 24 November 2018.
Received Accepted
04 / 06 / 2013 12 / 09 / 2013
اﻟﻣﻠﺧص
ﯾظﻬر اﻟﻣﻧطق اﻟﻘﺎﺑل ﻟﻠﺑرﻣﺟﺔ ﻛﺣل ﻓﻌﺎل ﻟﻠﻌدﯾد ﻣن ﺗطﺑﯾﻘﺎت ﻣﻌﺎﻟﺟﺔ اﻟﺻور ،وﻣﻊ اﻟ زﯾﺎدة
ﻓﻲ ﺣﺟم اﻟﺻور ﻓﺎن اﻟﺑرﻣﺟﯾﺎت ) (softwareأﺻﺑﺣت أﻗل ﻓﺎﺋدة ﻓﻲ ﻣﻌﺎﻟﺟﺔ اﻟﺻور ﻟذﻟك
اﺻﺑﺣت ﺗﻘﻧﯾﺔ ﻣﺻﻔوﻓﺔ اﻟﺑواﺑﺎت اﻟﺣﻘﻠﯾﺔ اﻟﻘﺎﺑﻠﺔ ﻟﻠﺑرﻣﺟﺔ FPGAاﻟﻬدف اﻟﻔﻌﺎل ﻟﺗطﺑﯾق
اﻟﺧوارزﻣﯾﺎت اﻟﺗﻲ ﺗﻧﺎﺳب ﺗطﺑﯾﻘﺎت ﻣﻌﺎﻟﺟﺔ اﻟﺻور واﺳﺗﺧدﻣت ﻫذﻩ اﻟﺗﻘﻧﯾﺔ ﻓﻲ اﻟﻌدﯾد ﻣن ﺗطﺑﯾﻘﺎت
ﻣﻌﺎﻟﺟﺔ اﻟﺻور.
ﺗﻧﻌﯾم اﻟﺻور ﻫﻲ واﺣدة ﻣن ﻫذﻩ اﻟﺗطﺑﯾﻘﺎت واﻟﺗﻲ ﺗﺳﺗﺧدم ﻟﺗﻘﻠﯾل ﺗﺄﺛﯾر ﺿوﺿﺎء ﻧﻘطﺔ ﻓﻲ
اﻟﺻورة.
ﺗم ﻓﻲ ﻫذا اﻟﺑﺣث اﺳﺗﺧدام ﻟﻐﺔ ﺗوﺻﯾف اﻟﻌﺗﺎد ﻟﻠدواﺋر اﻟﻣﺗﻛﺎﻣﻠﺔ ذات اﻟﺳرﻋﺎت اﻟﻣرﺗﻔﻌﺔ
ﺟدا VHDLوﻫﻲ اﻟﻠﻐﺔ اﻟﺗﻲ ﺗﺻف ﻫﯾﻛﻠﯾﺔ اﻟﺗﺻﻣﯾم ﻓﻲ FPGAﻟﺗﻣﺛﯾل اﺛﻧﯾن ﻣن اﻟﻣرﺷﺣﺎت
اﻟﻣﺳﺗﺧدﻣﺔ ﻓﻲ ﺗﻧﻌﯾم اﻟﺻور وﻫﻣﺎ )ﻣرﺷﺢ اﻟوﺳﯾط median filterوﻣرﺷﺢ اﻟﻣﻌدل average
أﯾﺿﺎ ﻓﻲ ﻫذا اﻟﺑﺣث ﺗطﺑﯾق ﻫذﻩ اﻟﻣرﺷﺣﺎت ﻋﻠﻰ FPGAوﻗد أﺛﺑﺗت اﻟﻧﺗﺎﺋﺞ
ً (filteringوﺗم
ﺳرﻋﺔ ﻋﺎﻟﯾﺔ ﻓﻲ اداء اﻟﺧوارزﻣﯾﺎت اﻟﺗﻲ ﺗﻌﺗﻣد ﻋﻠﻰ اﻻﺟﻬزة واﻟﺑرﻣﺟﯾﺎت ﻣﻘﺎرﻧﺔ ﺑﺎﻟﺑرﻣﺟﯾﺎت
ﻟوﺣدﻫﺎ اذ ظﻬر ﻓرق ﻛﺑﯾر ﺟدا ﻓﻲ ﺳرﻋﺔ اﻟﺗﻧﻔﯾذ ﺑﺎﻻﻋﺗﻣﺎد ﻋﻠﻰ اﻻﺟﻬزة اﻟﻣﺎدﯾﺔ اﻟﺗﻲ أظﻬرت
ﺳرﻋﺔ ﺗﻧﻔﯾذ ﺑﻣﻘﯾﺎس 10-9ﻣن اﻟﺛﺎﻧﯾﺔ ﺑﯾﻧﻣﺎ ﺑﺗطﺑﯾق اﻟﺧوارزﻣﯾﺎت ﺗﻘﺎس ﺑﺎﻟﺛواﻧﻲ .
ﺗم ﺗطﺑﯾق اﻟﺑرﻣﺟﯾﺎت ﻓﻲ ﻫذا اﻟﺑﺣث ﺑﺎﺳﺗﺧدام ﻟﻐﺔ MATLAB 2010اﻟﺑرﻣﺟﯾﺔ وﻛذﻟك
ﻟﻐﺔ VHDLﻟﻠﺗﻌﺎﻣل ﻣﻊ ﺟﻬﺎز FPGAاﻟﻣﺳﺗﺧدم واﻟذي ﻛﺎن ﻣن ﻧوع Xilinx XC3S500E
.Spartan-3E
Abstract
Programmable logic is emerging as an attractive solution for many
digital image processing applications. As image sizes and bit depths grow
38
Image Smoothing Based On FPGA.
larger, software has become less useful in the image processing, Field
Programmable Gate Array (FPGA) technology has become a viable target
for the implementation of algorithms suited to image processing
applications, the unique architecture of the FPGA has allowed the
technology to be used in many such applications encompassing all
aspects of image processing.
Image smoothing is one of image processing applications, it often
done to reduce the effect of pixel noise in images. This paper presents
VHDL architectures (that allow description of the structure design of
FPGA) to implement two of image smoothing filters:
a) averaging filters
b) median filters
This research is also applying the filters on FPGA. The results
proves high-speed performance of the algorithms that rely on hardware
and software compared to software alone, as it appeared very big
difference in the speed of execution, depending on the hardware devices
that showed the speed of the implementation of the scale of nanosecond,
while the software application of algorithms is measured in seconds.
The software was implemented in this research using MATLAB
2010 language code as well as the VHDL language to deal with use of
FPGA device, which was of a kind (Xilinx XC3S500E Spartan-3E).
1. Introduction
Image processing is considered to be one of the most rapidly
evolving areas of information technology, with growing applications in
all fields of knowledge. It constitutes a core area of research within the
computer science and engineering disciplines given the interest of
potential applications ranging from image enhancing, to automatic image
understanding, robotics and computer vision. The performance
requirements of image processing applications have continuously
increased the demands on computing power, especially when there are
real time constraints. Image processing applications may consist of
several low level algorithms applied in a processing chain to a stream of
input images. In order to accelerate image processing, there are different
alternatives ranging from parallel computers to specialized Application
Specific Integrated Circuits (ASIC) architectures. The computing
paradigm using reconfigurable architectures based on Field
Programmable Gate Arrays (FPGAs) promises an intermediate trade-off
between flexibility and performance [1].
Various techniques have been developed in Image Processing
during the last four to five decades. Most of the techniques are developed
for enhancing images obtained from unmanned spacecrafts, space probes
and military reconnaissance flights. Image Processing systems are
39
Dr. Maha A. R. Hasso & Farah Saad Al-Mukhtar
The work in this paper is based on the usage of gray scale image
smoothing using these pixel windows to calculate their output. Although
a pixel window may be of any size and shape, a square 3x3 size was
chosen for this application because it is large enough to work properly
and small enough to implement efficiently on hardware.
2. Related work
Image smoothing algorithms are particularly suitable for
implementation on FPGA, due to the parallelisms that may be exploited.
Due to use of microcontroller or microprocessor instruction level
parallelism is achieved. Research has been conducted to improve speed
by designing system block by block.
Suhaib A. Fahmy suggested An hardware implementation of a
median filter and use FIFO buffer to sort the samples for the window over
40
Image Smoothing Based On FPGA.
which the median must be found [7], Anthony Edward Nelson also use
FIFO buffer to sort the samples for the window over which the median
must be found [6].
In this work pointer is using to reach the positions in RAM instead
of using the first in first out implementation (FIFO) which is reduce the
complexity of the algorithms implementation, also it reduce the size of
the algorithms.
……(1)
41
Dr. Maha A. R. Hasso & Farah Saad Al-Mukhtar
RAM
or
Read data in VHDL
Array Image data
Data
a3 r31
a4
axx Adder
Shift divide
rxx register
Dout
42
Image Smoothing Based On FPGA.
Variable used as a
signal in the design
a b c
Figure 5; (a) original images, (b) images after average filtering in MATLAB, (c)
images after average filter in VHDL
Figure 6; (a) histogram for baby face image after average filtering in MATLAB,
(b)histogram for image after average filtering in VHDL, (c)the different between
two images.
43
Dr. Maha A. R. Hasso & Farah Saad Al-Mukhtar
44
Image Smoothing Based On FPGA.
RAM
or
Read data in VHDL
Array Image data
Data
r11
C 11 C 12 C 13 C14
C 21 C22 C 23 C 24 r21
Figure 9 shows the schematic design for the median filter (the
implementation of array, registers, adder and divider).
45
Dr. Maha A. R. Hasso & Farah Saad Al-Mukhtar
Variable used as a
signal in the design
a b c
Figure 11; (a) original image, (b) image after median filter in MATLAB,
(c) image after median filter in VHDL.
a b
c
Figure 12; (a) histogram for baby face image after median filter in MATLAB,
(b)histogram for image after median filter in VHDL, (c)the different between two images.
46
Image Smoothing Based On FPGA.
Figure 13 shows the image after applying the median filter for
removing salt and pepper noise in MATLAB and in VHDL, Figure 14
shows the histogram for image after median filter in MATLAB, VHDL
and the histogram difference between the two images.
a b c
Figure 13; (a) image with salt and pepper noise, (b) image after median filter in
MATLAB, (c) image after median filter in VHDL.
a b
(c)
Figure 14; (a) histogram for baby face image after median filter for removing
salt and pepper in MATLAB, (b)histogram for image after median filter in
VHDL, (c)the different between two images.
47
Dr. Maha A. R. Hasso & Farah Saad Al-Mukhtar
Table 1; The difference value between images that filtered using average filter by
MATLAB & VHDL
Image PSNR RMSE Correlation
Face image 68.4212 0.0967 0.9519
Face image1 68.7041 0.0936 0.8839
GIS image 67.2315 0.1109 0.9008
GIS image1 69.4856 0.0856 0.9411
Nature image 67.5590 0.1068 0.9516
Nature image1 69.7484 0.0830 0.9672
Medical image 71.0941 0.0711 0.9801
Medical image 73.5624 0.0535 0.9931
Table 2; The difference value between images that filtered using median filter by
MATLAB & VHDL
Filter Image PSNR RMSE Correlation
Median(smooth) Face image 67.2398 0.1108 0.9431
Median(smooth) Face image 67.8161 0.1037 0.8872
Median(salt and pepper noise) Face image 67.0149 0.1137 0.9400
Median(salt and pepper noise) Face image 67.8231 0.1036 0.8914
Median(smooth) GIS image 66.8718 0.1156 0.9157
Median(smooth) GIS image 68.2591 0.0985 0.9405
Median(salt and pepper noise) GIS image 69.2993 0.0874 0.9721
Median(salt and pepper noise) GIS image 68.2391 0.0988 0.9408
Median(smooth) Nature image 69.3592 0.0868 0.9725
Median(smooth) Nature image 69.7207 0.0833 0.9715
Median(salt and pepper noise) Nature image 69.2993 0.0874 0.9721
Median(salt and pepper noise) Nature image 69.3917 0.0865 0.9696
Median(smooth) Medical image 68.7867 0.0927 0.9681
Median(smooth) Medical image 70.1362 0.0794 0.9849
Median(salt and pepper noise) Medical image 69.2500 0.0879 0.9705
Median(salt and pepper noise) Medical image 70.1627 0.0791 0.9847
48
Image Smoothing Based On FPGA.
Table 3; The implementation results on FPGA using the two proposed filters
Average filtering Median filter
Number of slices 1515 out of 4656 32% 1093 out of 4656 23%
Number of slice flip flops 1054 out of 9312 11% 991 out of 9312 10%
Number of 4 input LUTS 7995 out of 9312 85% 4575 out of 9312 49%
No. Used as logic 1851 1455
No. Used as rams 6144 3120
Number of bonded IOBS 20 out of 232 8% 10 out of 232 4%
Number of Block RAM 1 out of 20 5% 1 out of 20 5%
Number of GCLKS 1 out of 24 4% 1 out of 24 4%
Many point could be concluded from the proposed work that is:
49
Dr. Maha A. R. Hasso & Farah Saad Al-Mukhtar
5. References
[1] Benkrid, K., (2001); "High Level Programming for FPGA based
Image and Video Processing using Hardware Skeletons".
Proceedings of the Symposium on Field Programmable Custom
Computing Machines, pp. 219-226, ISBN: 0-7695-2667-5, April
2001, IEEE Computer Society, Washington, DC.
[2] Mahdi Shaneh, Arash Golibagh Mahyari, (2011); "Image Enhancement
using α-Trimmed Mean ε-Filters". World Academy of Science,
Engineering and Technology 59 2011.
[3] Gajanand Gupta, (2011); "Algorithm for Image Processing Using
Improved Median Filter and Comparison of Mean, Median and
Improved Median Filter". International Journal of Soft Computing
and Engineering (IJSCE), ISSN: 2231-2307, Volume-1, Issue-5,
November 2011.
[4] Huiyu Zhou, Jiahua Wu and Jianguo Zhang, (2010); "Digital Image
Processing Part I", ISNB 978-87-7681-541-7.
[5] A. Erhardt – Ferron, (2000); "theory and applications of digital
image processing". university of applied sciences Offenburg,
copyright 2000 A. Erhardt-Ferron.
[6] Anthony Edward Nelson, (2000); "Implementation Of Image
Processing Algorithms On FPGA Hardware". M. Sc. Thesis in
Electrical Engineering, Vanderbilt University.
[7] Suhaib A. Fahmy, Peter Y. K. Cheung and Wayne Luk,(2005);
"Novel Fpga-Based Implementation Of Median And Weighted
Median Filters For Image Processing". 0-7803-9362-7 ©2005
IEEE.
[8] Li Xu, Cewu Lu, Yi Xu, Jiaya Jia, (2011); "Image Smoothing via
L0 Gradient Minimization". ACM Transactions on Graphics, Vol.
30, No. 6, Article 174, Publication date: December 2011.
[9] Subhojit Sarker, Shalini Chowdhury, Samanwita Laha, Debika Dey,
(2012); "use of non-local means filter to denoise image corrupted
by salt and pepper noise". Signal & Image Processing: An
International Journal (SIPIJ) Vol.3, No.2, April 2012.
[10] Ery Arias, Castro, David L. Donoho, (2009); "DOES MEDIAN
FILTERING TRULY PRESERVE EDGES BETTER THAN
LINEAR FILTERING?". The Annals of Statistics 2009, Vol. 37,
No. 3, 1172–1206 DOI: 10.1214/08-AOS604, © Institute of
Mathematical Statistics, 2009.
[11] ATMEL, (2008); "AVR223: Digital Filters with AVR". Rev.
2527B-AVR-07/08. © 2008 Atmel Corporation.
50