Implementation of Image Edge Detection on FPGA Using XSG
Implementation of Image Edge Detection on FPGA Using XSG
Abstract—Image edge detection plays a vital role in image II. SYSTEM REQUIREMENTS FOR THE PROPOSED APPROACH
processing. Edges are the pre-dominant features of an image A compatible MATLAB and Xilinx ISE softwares are
which is mainly used to analyze the images and to process that required to design the proposed approach using XSG.
image. Hardware implementation of image edge detection is
Simulink is used as a developing tool for XSG. XSG provides
essential for real time applications to increase the speed of
operation. This paper proposes a method that uses a graphical a library of simulink blocks, memories and DSP functions. It
user interface that combines MATLAB, Simulink and Xilinx also includes code generator which generates VHDL/Verilog
System Generator(XSG) to generate a code which is hardware code automatically from the created model. The code
implemented onto Spartan-3E Field Programmable Gate Array generated in VHDL/Verilog can be synthesized and
(FPGA).This Paper also provides an image edge detection using implemented in FPGAs. The blocks used in Xilinx System
Robert, Prewitt, Sobel and Laplacian of Gaussian (LoG) Generator also called as Xilinx Blocks [5] operate with
operators and implemented on FPGA. Boolean values in fixed point, as they are used to design in
hardware whereas Simulink Blocks [8] can operate in
Keywords—Image Edge Detection, Robert, Prewitt, Sobel, LoG,
continuous time and floating point format. Gateway Blocks
Xilinx System Generator, Spartan-3E FPGA.
are used for connection between Simulink blocks and Xilinx
I. INTRODUCTION AND MOTIVATION blocks. In addition to generating a user constraint file (UCF),
An edge is a point of sharp change in an image, a region test bench and test vectors among other things.
where pixel locations have abrupt luminance change i.e. a III. SCHEMATIC OF IMAGE PROCESSING TECHNIQUE
discontinuity in gray level values. The edge detection in image
processing, particularly in the areas of feature extraction aims The image processing techniques using Simulink and
at identifying points at which the image brightness changes MATLAB entirely goes through three phases [3] as shown in
sharply [1]. To process the image in real time, leads to Fig.1.
implement them in hardware, which significantly reduces the
processing time by parallelism [4]. FPGAs are used in digital
image processing to meet the real time applications [2,3] Any image Image post
Image pre
because of their programmability, it means modifying the Processing
Processing Processing
device function in lab or the working site where device is technique using
Blocks Blocks
installed. Writing thousands of code lines using high level Xilinx blocks
language for image processing is impractical and time
consuming. So, a tool called Xilinx System Generator (XSG)
[5-7] with graphical interfacing MATLAB-Simulink [8]is Fig.1 Basic block diagram
used to produce software environment for hardware A. Image pre processing blocks:
description.
As an image is two dimensional (2D) array size with R*C
The rest of the paper is organized as follows. Section II
where R,C represent the row and column of an image
discusses the requirements for the proposed approach and the
respectievly. For image processing, image must be converted
different types of blocks used in the design. Section III
to one dimensional (1D) vector. Image pre processing blocks
discusses the basic block diagram of image processing
are used to convert 2D image data to 1D array which is shown
technique. Section IV discusses the design of the various
in Fig.2.block which converts this frame to scalar output
image edge detection techniques implemented in this paper
samples at a higher sampling rate.
using Xilinx blocks. Section V discusses the hardware
implementation of edge detection on FPGA. Section VI
discusses the results of all techniques and section VII
discusses the conclusion.
Fig.9 Thresholding
Authorized licensed use limited to: JNT University Kakinada. Downloaded on February 04,2025 at 16:16:27 UTC from IEEE Xplore. Restrictions apply.
2016 International Conference on Circuit, Power and Computing Technologies [ICCPCT]
different basic operators [9] which develops filter masks to -1 -1 -1
convolve with input image and is shown below.
-1 8 -1
A. Edge Detection based on Robert operator:
It is proposed by Lawrence Roberts in 1963 and used in image -1 -1 -1
processing and computer vision for edge detection. It is a
Gx
differential operator that approximates the gradient of an
image through discrete differentiation which is achieved by Fig.13 Laplacian of Gaussian operator
computing the sum of the squares of the differences between The above all kernels undergo maximally to edges running
diagonally adjacent pixels implemented by two 2x2 mask as vertically and horizontally relative to pixel grid. The gradient
shown in Fig.10. magnitude is given as eq.1:
0 0 0 -2 0 2
1 2 1 -1 0 1
GxGy
Fig.12 Sobel operator
Authorized licensed use limited to: JNT University Kakinada. Downloaded on February 04,2025 at 16:16:27 UTC from IEEE Xplore. Restrictions apply.
2016 International Conference on Circuit, Power and Computing Technologies [ICCPCT]
corresponding software output and the FPGA/Hardware
output are shown in Fig.18 (b), (c) respectively. The PSNR
value obtained is 22.05. Similarly different sized images of
424X749 and 300X420 are given as input and are observed
that as the size of image increases, PSNR values are
decreasing. The Verilog code generated for edge detection
consists of 38075 lines.
B. Results for edge detection based on Prewitt operator: Image Processing Technique Slices FFs LUTs IOBs
The image shown in Fig.17 (a) of size 512X512 is Robert operator edge detection 768 1237 1209 32
given as input to the design shown in Fig.6 and the
corresponding software output and the FPGA/Hardware
Prewitt operator edge detection 943 1357 1479 32
output are shown in Fig.17 (b), (c) respectively. The PSNR
value obtained is 21.23.Similarly different sized images of
424X749 and 300X420 are given as input and are observed Sobel operator edge detection 945 1357 1604 32
that as the size of image increases, PSNR values are
Laplacian of Gaussian operator
decreasing. The Verilog code generated for edge detection edge detection
991 1632 1625 36
consists of 19110 lines.
VII. CONCLUSION
In this paper, various image processing techniques based
on image edge detection like Robert, Prewitt, Sobel and
(a) (b) (c) Laplacian of Gaussian are designed and implemented on
Fig.17. (a) input (b) software output (c) FPGA output Spartan 3E FPGA using Xilinx System Generator. It is simpler
to generate a stream of bit files rather than writing thousands
C. Results for edge detection based on Sobel operator: of code lines for implementing of image processing techniques
The image shown in Fig.18 (a) of size 512X512 is on FPGA. The PSNR value decreases as the number of pixels
given as input to the design shown in Fig.6 and the of input image increases. Among all the edge detectors
Authorized licensed use limited to: JNT University Kakinada. Downloaded on February 04,2025 at 16:16:27 UTC from IEEE Xplore. Restrictions apply.
2016 International Conference on Circuit, Power and Computing Technologies [ICCPCT]
Laplacian of Gaussian operator achieves the best PSNR value
and also detects edges better than other operators. This work
can be further extended to implement for medical and video
processing applications on FPGA.
REFERENCES
[1] R. Gonzalez, R. Woods, “Digital Image Processing” Third edition:
Prentice-Hall 2008.
[2] Anthony Edward Nelson, “Implementation of image processing
algorithms on FPGA hardware”, M.S. thesis, Electrical
Engineering, Graduate School of Vanderbilt University, 2000.
[3] Mrs. S. Allinchriste, Mr. Vignesh, Dr. A. Kandaswamy, “An
efficient FPGA implementation of MRI image filtering and tumour
characterization using Xilinx System generator”, International
Journal of VLSI design & Communication Systems, vol. 2, no. 4,
2011.
[4] MaleehaKiran, Kan Mei War, Lim Mei Kuan, Liang Kim Meng&
Lai Weng Kin, “ Implementing image processing algorithms using
hardware in the loop approach for Xilinx FPGA”, International
Conference on Electronic Design, 978-1-4244-2315-6/08 ©2008
IEEE.
[5] Xilinx system generator user’s guide, www.xilinx.com.
[6] James Hwang, Brent Milne, NabeelShirazi, Jeffrey D. Stroomer, “
System level tool for DSp in FPGAs”, Field-Programmable Logic
and Applications,Lecture Notes in Computer Science, Springer,
Volume 2147, 2001, pp 534-543, 2001.
[7] Ana Toledo Moreo, Pedro Navarro Lorente, F. Soto Valles, Juan
SuardiazMuro, Carlos Fernandez Andres, Experiences on
developing computer vision hardware algorithms using Xilinx
system generator, Microprocessors and Microsystems 29 (2005),
Elsevier, page no: 411– 419.
[8] http://in.mathworks.com/products/simulink/
[9] B. Chanda, D.DuttaMajumder “Digital Image Processing and
Analysis”, Eastern Economy Edition.
[10] S. Liquin, S. Dinggang and Q. Fiehu, “Edge Detection on Real
time using LoG Filter”, IEEE Conference ISSIPNN, 1994.
Authorized licensed use limited to: JNT University Kakinada. Downloaded on February 04,2025 at 16:16:27 UTC from IEEE Xplore. Restrictions apply.