Edge Detection Algorithm Based on FPGA

Research Article
Open access

Edge Detection Algorithm Based on FPGA

Yueer Meng 1*
  • 1 School of Electronic and Information Engineering, Anhui University, Anhui, China    
  • *corresponding author ranran@asu.edu.pl
Published on 3 January 2025 | https://doi.org/10.54254/2755-2721/2025.19487
ACE Vol.120
ISSN (Print): 2755-2721
ISSN (Online): 2755-273X
ISBN (Print): 978-1-83558-809-3
ISBN (Online): 978-1-83558-810-9

Abstract

With the rapid development of computer technology Image processing is playing an increasingly important role in various fields. However, traditional edge detection algorithms are difficult to meet the needs of massive data volumes and the demands in scenarios with high real-time requirements. Therefore, the research topic of this paper is edge detection algorithm based on FPGA. This paper summarizes the existing edge detection algorithms based on FPGA, which have been studied by scholars both at home and abroad, and then implements five edge detection operators using Opencv computer vision library and Python. The author observed through research and comparing the results of five edge detection operators on images that the edges detected by the Roberts operator and Laplace operator were missing more seriously, while the Prewitt operator and Canny operator did not fully handle noise. The Sobel operator, compared to these four operators, had more continuous edge detection results and better detection ability for image details, as well as faster processing speed.

Keywords:

Image Processing, Edge Detection, FPGA, Sobel

Meng,Y. (2025). Edge Detection Algorithm Based on FPGA. Applied and Computational Engineering,120,193-197.
Export citation

1. Introduction

In recent years, with the rapid development of computer technology, image processing has played an increasingly important role in various fields. Edge detection, as a frequently employed image processing approach, enjoys extensive application prospects in domains like target recognition, object tracking, and visual navigation. Image processing technology dates back to the early 1950s, when a research team led by L.G. Roberts pioneered a method that could convert image signals into digital information, which a computer could then process. This groundbreaking work laid the foundation for the field of digital image processing and spurred the development of image processing technology. Researchers have been working to solve the challenges of image edge detection, from classical methods to the use of deep learning technology, through continuous algorithm improvements. Many edge detection operators have been developed, such as the Sobel, Prewitt, Laplace, and Roberts operators. As scientific and technological progress continues, people's requirements for image processing technology are increasing. Although the continuous optimization of software algorithms can achieve certain requirements to some extent, software algorithm optimization has reached a bottleneck, and software implementations often cannot meet the requirements in scenarios with large data volumes and high real-time requirements. Therefore, hardware acceleration has become a highly concerned and effective solution. In terms of hardware acceleration, Field Programmable Gate Array have become one of the focal points of researchers due to their strong parallel computing ability and low power consumption. The research topic of this paper is edge detection algorithms based on FPGA. This paper summarizes the existing edge detection algorithms based on FPGA, which have been studied by scholars both at home and abroad, and then implements five edge detection operators using Opencv computer vision library and Python.

2. Method

2.1. Research progress

In response to the deficiencies of the traditional Sobel edge detection algorithm in noise sensitivity and positioning accuracy, Zheng Huanhuan et al proposed an improved Sobel algorithm[1]. This algorithm is based on mean calculation and differential processing, constructing a 5×5 gradient weight template, and refining the edges through an improved non-maximum suppression algorithm. To extract edge information, a locally adaptive dynamic thresholding method was selected. Experimental results indicate that this algorithm can not only extract edge information rapidly and effectively but also possesses strong anti-noise ability.

Li Di et al proposed a new improvement strategy to address the limitations of the traditional Sobel operator and the low efficiency of image processing at the PC end in serial[2]. By increasing the number of template directions of the Sobel operator from 2 to 8 and combining the high-speed hardware processing capability of FPGA and the characteristics of parallel pipeline processing, the pixel direction information of the image was fully utilized. By replacing the PC end with FPGA for image processing, the effect of image edge detection was optimized and the processing efficiency was enhanced.

Wang Xiangchao and his team developed an image edge detection system based on FPGA in a simulated low-light environment to overcome the computational burden and high requirements for lighting conditions faced by traditional embedded platforms[3]. Wang Zishuo et al. proposed an optimized Canny edge detection algorithm. This algorithm combines bilateral filtering with Canny edge detection to reduce noise while retaining the gradient information of image edges, optimizing the problems of the lack of adaptability and poor real-time performance of traditional edge detection algorithms when implemented on FPGA, providing a feasible solution for the application of the Canny algorithm in embedded machine vision.

Wang Zishuo et al proposed an optimized Canny edge detection algorithm [4]. This algorithm integrates bilateral filtering and Canny edge detection.It mitigates noise while preserving the gradient information of image edges.It optimizes the issues of insufficient adaptability and poor real-time performance of traditional edge detection algorithms when implemented on FPGA. It offers a feasible solution for the application of the Canny algorithm in embedded machine vision.

Zha Zhixun et al designed and implemented a real-time image edge detection system based on PFGA [5]. This system was proposed to address the potential loss of image edges in hazy environments. The image module adopts an improved Canny algorithm combined with grayscale transformation, effectively enhancing the effect of image edge extraction.

Wang Siqi et al proposed a multi-directional Sobel edge detection algorithm with FFT adaptive threshold [6]. This algorithm can solve problems such as the inability of the traditional Sobel algorithm to capture edge information in different gradient directions, indistinct edge detection in complex environments, and inflexible threshold selection. By expanding the directions of the Sobel algorithm, the edge detection accuracy is improved; through the selection of an adaptive threshold, the need for manual intervention is reduced, and the degree of automation and real-time response ability of the system are enhanced; by integrating FFT with the expanded Sobel algorithm, the influence of noise on image edge detection is reduced, and the speed of image edge detection is increased.

Zhou Yuhao et al from Huazhong University of Science and Technology utilized the parallel processing feature of FPGA to design a real-time image acquisition and preprocessing system based on FPGA[7].It can serve as the front end of an automotive anti-collision system and can determine the surrounding dangerous situations based on the vehicle edge information.

Menaka et al proposed a Sobel filter-based edge detection design for FPGA[8].It utilizs the parallel processing capability of FPGA to achieve high-speed and low-power image edge detection, which reduces power consumption, delay, and spatial complexity compared to the existing three architectures. Li Tao proposed a modular hardware design based on FPGA for efficient edge detection with improved Canny algorithm[9]. The algorithm can solve the limitations of the Canny algorithm in image edge detection, including poor adaptability, easy loss of edge information, and excessive processing time.Li Jiying proposed an improved Canny edge detection algorithm[10].This algorithm improves upon traditional algorithms' lack of adaptability in threshold selection and the slow processing speed of common microprocessors.

2.2. Comparison of edge detection algorithms

2.2.1. Reproduction of five edge detection operators using the opencv computer vision library and python

Firstly, the researcher selected an image with abundant edge details. Figure 1 could highlight the parts of the edge details, thereby facilitating the judgment of the superiority and inferiority of the methods. Then, the researcher employed software programming to achieve grayscale conversion of the color image. Finally, the researcher successively applied the five edge detection operators to perform edge detection on the grayscale-processed image. Since the Opencv library contains the functions for edge detection of the Canny and Sobel operators, the functions were directly invoked to conduct edge detection. The Prewitt, Laplace, and Roberts operators were implemented using Python.

2.2.2. Picture results

/word/media/image1.png

Figure 1: Comparative images of five edge detection operators.

As depicted in Figure 1, the image edges detected by the Roberts operator are severely lacking, followed by those detected by the Laplace edge detection operator. The edges detected by the Sobel operator are more continuous compared to the detection results of the Roberts and Laplace operators, and it has a better detection capability for the detailed parts of the image. Both the Prewitt operator and the Canny operator maintain sensitivity to the critical edges of the image, yet fail to completely filter out the noisy pixel points. Particularly, the Canny operator misjudges some high-frequency noisy pixel points as edge pixel points.

Comprehensively considering factors such as noise resistance, edge positioning accuracy, edge detection speed, and the ease of algorithm implementation, the Sobel edge detection operator is superior.

2.2.3. Comparison Table

Table 1: Comparative summary of five edge detection operators.

Operator name

Characteristics

Computation speed

Usage scenarios

Sobel

Two 3*3 convolutional kernel templates with weight coefficients.

Faster

Low noise and high real-time requirements.

Roberts

Two 2x2 operator templates

Fast

Low noise, with distinct edge features.

Prewitt

Two 3x3 convolutional kernel templates with uniform distribution of weight values.

Faster

Low noise, linear edge is clearly visible.

Laplacian

Four 3*3 filter templates can directly locate the zero crossing points as edge positions.

Slower

It has sharp edges and lower noise, especially useful for scenes where you are looking for isolated points or closed contours.

Canny

2x2 operator template, high accuracy, noise suppression, multi-stage operation, adjustable parameters.

Slower

The edge features are not distinct.

From Table 1, it is evident that both the Roberts operator and the Canny operator possess 2*2 operator templates. However, in comparison, the Canny operator demonstrates higher accuracy, stronger noise suppression performance, and adjustable parameters. The Sobel operator, the Prewitt operator, and the Laplacian operator all feature 3*3 operator templates. Among them, the Sobel operator's convolution kernel incorporates weighting coefficients, the Prewitt operator's convolution kernel has uniformly distributed weights, and the Laplacian operator can directly identify zero-crossing points as edge positions. Regarding computational speed, the Sobel operator and the Prewitt operator operate more rapidly. In the application context, the real-time requirement of the Sobel operator is higher.

In conclusion, in the real-time edge detection scenario, the first-order Sobel edge detection operator employs a 3*3 neighborhood convolution kernel and introduces weighting coefficients, resulting in a moderate convolution operation complexity and relatively fast speed. Additionally, the Sobel edge detection operator contains only two convolution kernels, providing extensive potential for expansion and improvement. By extending the convolution kernel direction in space, the Sobel operator can exhibit greater sensitivity to more edge detection directions, thereby achieving a more comprehensive detection of edge features. Hence, the Sobel edge detection operator is the most optimal among the five edge detection operators.

3. Conclusion

This research discovers that among the five edge detection operators tested, the Roberts operator and the Laplace operator exhibit more severe edge losses in the detected images. The Prewitt operator and the Canny operator do not handle noise completely. Compared with these four operators, the Sobel operator yields more continuous edge detection results and demonstrates better detection ability for image details and higher speed. Thus, when conducting image processing, by comprehensively considering factors such as noise resistance, edge positioning accuracy, edge detection speed, and algorithm implementation ease, the Sobel edge detection operator is the most optimal. When implementing image processing via hardware FPGA, more complex algorithms need to be embedded in the hardware platform, which can save processing time, and enhance real-time performance, and the embedded hardware-based image processing system is amenable to multiple developments with shorter development cycles, thereby reducing development costs. Future studies can continue to explore the improvement of each edge detection operator to facilitate in-depth research on this topic.


References

[1]. Zheng, H., Bai, Y., & Zhang, Y. (2020). An edge detection algorithm based on Sobel operator. Microcomputer Applications, 36(10), 4-6.

[2]. Li, D., Wu, Q., & Yang, H. (2022). Design and implementation of edge detection system based on improved Sobel operator. Information Technology and Network Security, 41(3), 13-17.

[3]. Wang, X., Chen, L., & Yan, B. (2023). Design and realization of image edge detection system based on FPGA in simulated low-light environment. Electronic Making, 31(11), 12-15.

[4]. Wang, Z., Shan, Y., Chu, C., et al. (2024). Improved edge detection algorithm and its FPGA implementation. Laser Journal, 45(3), 74-80.

[5]. Cha, J.-h. (2021). Research on real-time edge detection system based on FPGA (Master's thesis). Hefei University of Technology.

[6]. Wang, S. (2024). Improvement and realization of image processing edge detection algorithm based on FPGA (Master's thesis). Anhui Jianzhu University.

[7]. Zhou, Y. (2021). Design of real-time image acquisition and preprocessing system based on FPGA (Master's thesis). Huazhong University of Science and Technology.

[8]. Menaka, R., Janarthanan, R., & Deeba, K. (2020). FPGA implementation of low power and high speed image edge detection algorithm. Microprocessors and Microsystems, 75, 103053.

[9]. Li, T. (2024). An edge detection system based on FPGA improved Canny algorithm. Instrumentation Technology and Sensors, 8, 65-70.

[10]. Li, J., Liu, J., & Liu, Y. (2024). An improved Canny edge detection algorithm based on FPGA. Journal of Measurement Science and Instrumentation, 1-13.


Cite this article

Meng,Y. (2025). Edge Detection Algorithm Based on FPGA. Applied and Computational Engineering,120,193-197.

Data availability

The datasets used and/or analyzed during the current study will be available from the authors upon reasonable request.

Disclaimer/Publisher's Note

The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of EWA Publishing and/or the editor(s). EWA Publishing and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

About volume

Volume title: Proceedings of the 5th International Conference on Signal Processing and Machine Learning

ISBN:978-1-83558-809-3(Print) / 978-1-83558-810-9(Online)
Editor:Stavros Shiaeles
Conference website: https://2025.confspml.org/
Conference date: 12 January 2025
Series: Applied and Computational Engineering
Volume number: Vol.120
ISSN:2755-2721(Print) / 2755-273X(Online)

© 2024 by the author(s). Licensee EWA Publishing, Oxford, UK. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license. Authors who publish this series agree to the following terms:
1. Authors retain copyright and grant the series right of first publication with the work simultaneously licensed under a Creative Commons Attribution License that allows others to share the work with an acknowledgment of the work's authorship and initial publication in this series.
2. Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the series's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgment of its initial publication in this series.
3. Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (See Open access policy for details).

References

[1]. Zheng, H., Bai, Y., & Zhang, Y. (2020). An edge detection algorithm based on Sobel operator. Microcomputer Applications, 36(10), 4-6.

[2]. Li, D., Wu, Q., & Yang, H. (2022). Design and implementation of edge detection system based on improved Sobel operator. Information Technology and Network Security, 41(3), 13-17.

[3]. Wang, X., Chen, L., & Yan, B. (2023). Design and realization of image edge detection system based on FPGA in simulated low-light environment. Electronic Making, 31(11), 12-15.

[4]. Wang, Z., Shan, Y., Chu, C., et al. (2024). Improved edge detection algorithm and its FPGA implementation. Laser Journal, 45(3), 74-80.

[5]. Cha, J.-h. (2021). Research on real-time edge detection system based on FPGA (Master's thesis). Hefei University of Technology.

[6]. Wang, S. (2024). Improvement and realization of image processing edge detection algorithm based on FPGA (Master's thesis). Anhui Jianzhu University.

[7]. Zhou, Y. (2021). Design of real-time image acquisition and preprocessing system based on FPGA (Master's thesis). Huazhong University of Science and Technology.

[8]. Menaka, R., Janarthanan, R., & Deeba, K. (2020). FPGA implementation of low power and high speed image edge detection algorithm. Microprocessors and Microsystems, 75, 103053.

[9]. Li, T. (2024). An edge detection system based on FPGA improved Canny algorithm. Instrumentation Technology and Sensors, 8, 65-70.

[10]. Li, J., Liu, J., & Liu, Y. (2024). An improved Canny edge detection algorithm based on FPGA. Journal of Measurement Science and Instrumentation, 1-13.