FPGA Implementation of a Real-Time Edge Detection System Based on an Improved Canny Algorithm
Abstract
:1. Introduction
- Computation of the gradient magnitude and orientation using the approximate method.
- Using Otsu’s algorithm for adaptive threshold calculation.
- The design of a 32-bit logarithmic arithmetic unit to reduce the complexity of Otsu’s algorithm.
2. Proposed Design Strategy
2.1. Conventional Canny Edge Detection Algorithm
- (1)
- Calculate the horizontal gradient Gx and vertical gradient Gy at each pixel location by convolving with gradient masks.
- (2)
- Compute the gradient magnitude G and direction θG at each pixel location.
- (3)
- Non maximum suppression (NMS): Convert blurred edges of the image into sharp edges and suppress minima (preserving local maxima) in the gradient image.
- (4)
- Computation of threshold: Potential edges are determined by high and low thresholds and are calculated based on the gradient magnitude histogram of the whole image.
- (5)
- Hysteresis thresholding: Creates a continuous edge map by comparing the values of the gradient magnitude of each pixel with low and high threshold values. This removes edge pixels caused by noise and illumination variation.
2.2. Improved Canny Edge Detection Algorithm
2.2.1. Gradient Computation Based on the Sobel Operator
2.2.2. Low Complexity Gradient Magnitude and Direction Calculation
2.2.3. Non maximum Suppression
2.2.4. Adaptive Threshold Computation
- (1)
- Otsu’s Algorithm
- (2)
- Logarithm Approximation
- (3)
- Architecture of adaptive threshold computation
- (a)
- Architecture of histogram
- (1)
- Read out the current statistics, add 1 and write them back to RAM.
- (2)
- Repeat the above steps until the current image has been counted. If imhist_end is 1, as shown in Figure 11, the statistics are complete.
- (3)
- Next, start reading out the data in order.
- (b)
- Architecture of Otsu’s algorithm calculation
- (c)
- 32-bit Logarithmic Arithmetic Unit
- (d)
- Threshold calculation
2.2.5. Binarization
2.2.6. Hysteresis
3. Experimental Results and Analysis
3.1. Performance Analysis
3.2. Resource Utilization
3.3. Execution Time
4. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Roberts, L.G. Machine perception of 3D solids. In Optical and Electro-Optical Information Processing; MIT Press: Cambridge, MA, USA, 1965. [Google Scholar]
- Gonzalez, R.C.; Woods, R.E. Digital Image Processing; Pearson Education Inc.: London, UK; Prentice Hall: Hoboken, NJ, USA, 2008. [Google Scholar]
- Kanopoulos, N.; Vasanthavada, N.; Baker, R.L. Design of an image edge detection filter using the sobel operator. IEEE J. Solid-State Circuits 1988, 23, 358–367. [Google Scholar] [CrossRef]
- Davies, E.R. Constraints on the design of template masks for edge detection. Pattern Recognit. Lett. 1986, 4, 111–120. [Google Scholar] [CrossRef]
- Canny, J. A computation approach to edge detection. IEEE Trans. Pattern Anal. Mach. Intell. 1986, 8, 679–698. [Google Scholar] [CrossRef] [PubMed]
- Gentsos, C.; Sotiropoulou, C.L.; Nikolaidis, S. Real-Time Canny Edge Detection Parallel Implementation for FPGAs. In Proceedings of the 17th IEEE International Conference on Electronics, Circuits and Systems (ICECS), Athens, Greece, 12–15 December 2010; pp. 499–502. [Google Scholar]
- He, W.; Yuan, K. An Improved Canny Edge Detector and its Realization on FPGA. In Proceedings of the 7th World Congress on Intelligent Control and Automation (WCICA), Chongqing, China, 25–27 June 2008; pp. 6561–6564. [Google Scholar]
- Xu, Q.; Varadarajan, S.; Chakrabarti, C. A Distributed Canny Edge Detector: Algorithm and FPGA Implementation. IEEE Trans. Image Process. 2014, 23, 2944–2960. [Google Scholar] [CrossRef] [PubMed]
- Sangeetha, D.; Deepa, P. FPGA implementation of cost-effective robust Canny edge detection algorithm. J. Real-Time Image Proc. 2019, 16, 957–970. [Google Scholar] [CrossRef]
- Deriche, R. Using Canny Criteria to derive a recursively implemented optimal Edge detector. Int. J. Comput. Vis. 1987, 1, 167–187. [Google Scholar] [CrossRef]
- Torres, L.; Robert, M.; Bourennane, E.; Paindavoine, M. Implementation of a Recursive Real Time Edge Detector Using Retiming Technique. In Proceedings of the Asia and South Pacific IFIP International Conference on Very Large Scale Integration, Chiba, Japan, 29 August–1 September 1995; pp. 811–816. [Google Scholar]
- Lorea, F.G.; Kessal, L.; Demigny, D. Efficient ASIC and FPGA implementation of IIR filters for Real Time Edge Detection. In Proceedings of the IEEE International Conference on Image Processing (ICIP-97), Santa Barbara, CA, USA, 26–29 October 1997; Volume 2, pp. 406–409. [Google Scholar]
- Park, I.K.; Singhal, N.; Lee, M.H.; Cho, S.; Kim, C.W. Design and performance evaluation of image processing algorithms on GPUs. IEEE Trans. Parallel Distrib. Syst. 2011, 22, 91–104. [Google Scholar] [CrossRef] [Green Version]
- Owens, J.D.; Luebke, D.; Govindaraju, N.; Harris, M.; Kruger, J.; Lefohn, A.E.; Purcell, T.J. A survey of general-purpose computation on graphics hardware. Comput. Graph. Forum 2007, 26, 80–113. [Google Scholar] [CrossRef] [Green Version]
- Luo, Y.; Duraiswami, R. Canny edge detection on NVIDIA CUDA. In Proceedings of the 2008 IEEE Computer Society Conference on Computer Vision and Pattern Recognition Workshop (CVPRW), Anchorage, AK, USA, 23–28 June 2008; pp. 1–8. [Google Scholar]
- Palomar, R.; Palomares, J.M.; Castillo, J.M.; Olivares, J.; GomezLuna, J. Parallelizing and optimizing lip-Canny using NVIDIA CUDA. In IEA/AIE 2010: Trends in Applied Intelligent Systems, Proceedings of the 23rd International Conference on Industrial Engineering and Other Applications of Applied Intelligent Systems, Cordoba, Spain, 1–4 June 2010; Springer: Berlin/Heidelberg, Germany, 2011; pp. 389–398. [Google Scholar]
- Lourenco, L.H.A. Efficient implementation of Canny edge detection filter for ITK using CUDA. In Proceedings of the 13th Symposium on Computer Systems, Petropolis, Brazil, 17–19 October 2012; pp. 33–40. [Google Scholar]
- Otsu, N. A threshold selection method from gray-level histograms. IEEE Trans. Syst. Man. Cybern. 1979, 9, 62–66. [Google Scholar] [CrossRef] [Green Version]
- Pandey, J.G.; Karmakar, A.; Shekhar, C. A Novel Architecture for FPGA Implementation of Otsu’s Global Automatic Image Thresholding Algorithm. In Proceedings of the 27th International Conference on VLSI Design and 13th International Conference on Embedded Systems, Mumbai, India, 5–9 January 2014; pp. 300–305. [Google Scholar]
- Albert, F.; Monsalve, T.; Median, J.V. Hardware implementation of ISODATA and Otsu thresholding algorithms. In Proceedings of the XXI Symposium on Signal Processing, Images and Artificial Vision (STSIVA), Bucaramanga, Colombia, 31 August–2 September 2016; pp. 1–5. [Google Scholar]
- Zhang, H.; Wang, S.Z.; Zheng, Y.; Wang, W.; Li, W.Z.; Wang, P.; Ren, G.S.; Ma, J.L. FPGA implementation of image edge detection based on four algorithms of GAUSS-filter, Sobel, NMS and OTSU. Chin. J. Liq. Cryst. Disp. 2020, 35, 250–261. [Google Scholar] [CrossRef]
- Sun, J.C.; Wang, Z.Y.; Li, Z.G. Implementation of Sobel Edge Detection algorithm and VGA display based on FPGA. In Proceedings of the IEEE 4th Advanced Information Technology, Electronic and Automation Control Conference (IAEAC), Chengdu, China, 20–22 December 2019; pp. 2305–2310. [Google Scholar]
- Tippett, J.T.; Borkowitz, D.A.; Clapp, L.C.; Koester, C.J.; Vanderburgh, J.A. Optical and Electro-Optical Information Processing; MIT Press: Cambridge, MA, USA, 1965. [Google Scholar]
- Bruguera, J.D.; Gull, N.; Lang, T. CORDIC based parallel/pipelined architecture for the Hough transform. J. VLSI Signal Process. Syst. Signal Image Video Technol. 1996, 12, 207–221. [Google Scholar] [CrossRef] [Green Version]
- Ngo, H.T.; Asari, V.K. A Pipelined Architecture for Real-Time Correction of Barrel Distortion in Wide-Angle Camera Images. IEEE Trans. Circuits Syst. Video Technol. 2005, 15, 436–444. [Google Scholar] [CrossRef]
- Abed, K.H.; Siferd, R.E. CMOS VLSI Implementation of a Low-Power Logarithmic Converter. IEEE Trans. Comput. 2003, 52, 1421–1433. [Google Scholar] [CrossRef]
- Kim, H.; Nam, B.G.; Sohn, J.H.; Woo, J.H.; Yoo, H.J. A 231-MHz, 2.18-mW 32-bit Logarithmic Arithmetic Unit for Fixed-Point 3-D Graphics System. IEEE J. Solid-State Circuits 2006, 41, 2373–2381. [Google Scholar] [CrossRef]
- Abed, K.H.; Siferd, R.E. CMOS VLSI Implementation of 16-bit Logarithm and Anti-logarithm Converters. In Proceedings of the IEEE 43rd Midwest Symposium on Circuits and Systems, Lansing, MI, USA, 8–11 August 2000; pp. 776–779. [Google Scholar]
- Standard Test Image Database. Available online: http://www.imageprocessingplace.com/ (accessed on 24 May 2015).
Tangent | Approximate Value | Tangent | Approximate Value |
---|---|---|---|
tan 0° | 0 | tan 112.5° | −tan 67.5° |
tan 22.5° | tan 135° | −tan 45° | |
tan 45° | 1 | tan 157.5° | −tan 22.5° |
tan 67.5° | tan 180° | −tan 0° |
Edge Detection Methods | Image Size | FPGA Device | Used Slices | Memory Used (KB) | Max Freq. (MHz) | Time (ms) | Norm. Time (ms) |
---|---|---|---|---|---|---|---|
[6] | 512 × 512 | Xilinx Virtex-5 | 4553 | 192 | 292 | 0.57 | 3.338 |
[7] | 360 × 280 | Altera Cyclone | - | - | 27 | 2.5 | 1.44 |
[8] | 512 × 512 | Xilinx Virtex-5 | 23904 | 16184 | 250 | 0.15 | 0.774 |
[9] | 512 × 512 | Xilinx Virtex-5 | 17928 | 278 | 272 | 0.13 | 0.54 |
proposed | 512 × 512 | Altera Cyclone IV | 3303 | 261 | 56.7 | 1.231 | 1.231 |
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 MDPI and/or the editor(s). MDPI 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. |
© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Guo, L.; Wu, S. FPGA Implementation of a Real-Time Edge Detection System Based on an Improved Canny Algorithm. Appl. Sci. 2023, 13, 870. https://doi.org/10.3390/app13020870
Guo L, Wu S. FPGA Implementation of a Real-Time Edge Detection System Based on an Improved Canny Algorithm. Applied Sciences. 2023; 13(2):870. https://doi.org/10.3390/app13020870
Chicago/Turabian StyleGuo, Laigong, and Sitong Wu. 2023. "FPGA Implementation of a Real-Time Edge Detection System Based on an Improved Canny Algorithm" Applied Sciences 13, no. 2: 870. https://doi.org/10.3390/app13020870
APA StyleGuo, L., & Wu, S. (2023). FPGA Implementation of a Real-Time Edge Detection System Based on an Improved Canny Algorithm. Applied Sciences, 13(2), 870. https://doi.org/10.3390/app13020870