A Circle Detection Method Based on Optimal Parameter Statistics in Embedded Vision Xiaofeng Lu,, Xiangwei Li, Sumin Shen, Kang He, and Songu Yu Shanghai Ke Laborator of Digital Media Processing and Transmissions Shanghai Jiao Tong Universit, Shanghai, China School of Communication and Information Engineering Shanghai Universit, Shanghai, China Abstract. In this paper, we propose a circle detection method based on the optimal parameter statistics OPSCD. Our method emplos fast median filtering based Cann edge detection algorithm FMFCann to obtain edge information. In addition, real-time three points determination circle detection is implemented in FPGA circuit which takes use of the optimal parameters statistics. In this algorithm, the pipeline processing of FIFO and parallelize operation of registers in FPGA detects single circle in videos. Eperimental results show that the proposed method is more accurate and robust than the previous algorithm. Kewords: embedded vision, circle detection, fast median filtering, FPGA. Introduction Geometr image detection has man applications in embedded vision. The circle detection has been widel used in the areas of product testing, biological information recognition, and integrated circuit boards online qualit testing. As circle detection algorithm inevitabl needs to get the edge information, edge detection results pla a ke role in the follow-up algorithm. Currentl, Edge detection algorithm mainl includes the following four categories: classical differential operator, such as Sobel operator and Prewitt operator; optimal operator, such as LOG operator and Cann operator []; methods based on local image function; 4methods based on overall situation. Cann operator is considered as the best edge detection operator as it can obtain single piel edge. But for the image composed of comple edges, false edges or missing edge information will appear. Hough transform is a traditional circle detection method introduced b Paul Hough in 96 []. However, it has several shortcomings [], such as large amount of calculation, high requirement for memor, and quantization interval constraints in parameter space. Since embedded vision sstem has strict requirement for real-time process, it is difficult to resolve the contradiction between algorithm compleit and detection performance. Additionall, the center of gravit method CGM [4] gets a circle s information through calculating mean value of all edge points coordinates. W. Zhang et al. Eds.: IFTC 0, CCIS, pp. 440 447, 0. Springer-Verlag Berlin Heidelberg 0
A Circle Detection Method Based on Optimal Parameter Statistics in Embedded Vision 44 This method will introduce some errors, for the reason that CGM needs to traverse all edge points and some of them ma not be on one circle. Chen et al. proposed a fast circle detection method [5], using three non collinear edge points algebraic relations to determine a circle, on the basis of [6]. However, Chen s approach requires precise coordinates of the three reference points and this condition is hard to be satisfied. The remainder of this paper is organized as follows. Section introduces the principle of the algorithm and gives a detailed description for their implementation in steps. Eperiments are compared in Section. Section 4 presents the conclusion. The Proposed Algorithm. Principle of the Proposed Algorithm Proposed algorithm consists of two parts in FPGA circuits as shown in Fig.. The input signal is LVDS serial video signal. First, circle edge image is obtained via FMFCann module. Then, circle optimal parameters of horizontal coordinate a, vertical coordinate b and circle s radius square r are calculated through OPSCD module based on the input video and circle edge image. Fig.. The algorithm s implementation FPGA architecture. FMFCann and Its Implementation in FPGA Cann edge detection is not good enough especiall when the image has comple edges. We improve it in two aspects: Use median filtering instead of Gaussian filtering to suppress grain noise in the image, while edge information is well preserved [7]. In addition, median filtering doesn t need to set a parameter and it is more fleible [8]. In non-maimum suppression, onl when the reference point s gradient value is greater than four neighboring points in the gradient direction, it can be viewed as edge point. The algorithm flow chart is shown in Fig.. Fig.. Flow chart of FMFCann Fast median filtering Bubbling method or dichotom is widel used in sorting elements, while these methods are not conducive to the real-time implementation in FPGA and cannot reflect the parallel processing capabilities of FPGA. Thus, template of is used to achieve fast parallel median filtering in this paper. Implementation of median filtering
44 X. Lu et al. process in FPGA needs to cache three lines of the image within three FIFOs to get median value of 9 piels. In order to save resources in FPGA, we use onl two FIFOs and one register to get the piel arra as Fig. shown. Fig.. Schematic diagram of fast median filtering Enhanced non-maimum suppression Since it is time consuming and causes a waste of resources to computes inverse trigonometric functions in FPGA, we divide the gradient direction into eight regions in 60 o. Take gradient direction at 0 to 45 and 80 to 5 for eample. In order to suppress the false edge more effectivel, the conditions to judge gradient s maimum value need to be enhanced. The piel will be treated as an edge point, when its G, is greater than G, -, G, -, G, and G-,.. OPSCD and Its Implementation in FPGA Three points on a circle can determine the circle. Assume that the coordinates of the three points are,,, and,, the center s horizontal and vertical coordinates of a, b and radius r, can be calculated b formula [5]. 4 a = 4 b =
A Circle Detection Method Based on Optimal Parameter Statistics in Embedded Vision 44 r = i a i b i =,, Statistical accumulation is presented to choose the largest number of calculated values as the optimal parameters instead of the average value. Fig.4 shows that circle detection algorithm based on optimal parameter statistics consists of three modules. Fig. 4. Circle detection algorithm based on optimal parameter statistics r i Fig. 5. Ke operation of optimal parameter statistics The optimal parameter statistices is the ke module of our method. And we set up 048 RAMs, whose addresses represent the circle parameters. RAM address is initialized to 0, and accumulate when the same parameter detected. While negative pulse of horizontal snc signal appears, RAMs which have maimum accumulated values will output their addresses as horizontal coordinate a, vertical coordinate b, and radius r as the optimal parameters. The radius can be calculated b square root IP core to parameter r. Eperimental Results. FPGA Based Embedded Vision Platform and Its Performance Parameters This hardware platform is an FPGA based embedded vision sstem as shown in Fig.6. The camera has resolution of 0004 at 4MHz piel frequenc and captures
444 X. Lu et al. real-time black and white video. VGA monitor displas in a frame frequenc of 60Hz. HD LVDS video signal is captured b Altera DE FPGA platfrom through epansion board CLR_HSMC and Camera Link interface protocol. FPGA platform takes advantages of chip internal resources and greatl improves the overall sstem efficienc. It takes onl 0.4 ns to calculate edge information and 7 ms to compute circle optimal parameters, which ensure the real-time processing. Fig. 6. FPGA based embedded visual platform. Eperimental Results of FMFCann In order to have visual comparison between the two edge detection methods, we get simple circle images to do edge detection through method of [] and proposed FMFCann respectivel, as shown in Fig.7. a b c Fig. 7. a original image, b result of method [], c result of FMFCann
A Circle Detection Method Based on Optimal Parameter Statistics in Embedded Vision 445 In Fig.7 b, there is edge loss in vertical and horizontal directions. In comparison, the edge curve is more continuous and clear without edge loss in Fig.7 c. According to the results, FMFCann obtains more continuous and sharp edges, and the false edge is significantl reduced. Eperiment results prove the accurac of our method.. Eperimental Results of OPSCD Due to optimal parameter statistics, the algorithm gets good results in a simple background, without error caused b circle parameter accumulation and average operations. In order to have visual comparison between CGM [4] and proposed OPSCD, we provide eperimental results of black/white circle detection under the white/black background, as shown in Fig.8. a b c d e f Fig. 8. ad original images, be results of CGM, cf results of proposed OPSCD Eperimental results shows OPSCD obtains more stable curves and fits the edge of the reference circle compared with CGM. In addition, Signal Tap II is used to record real-time circle parameters and verifies the robustness of the method. There are 0 times computation records as Fig. 9 shown. According to the analsis of circle parameters, the error ranges of the three circle parameters a, b, r in CGM are [0 0.59%], [0 0.95%], [0.4%], while in our proposed method the corresponding error ranges are [0 0.45%], [0 0.48%], [0 0.96%]. In Fig.9, Eperimental results show that, the curves of our method have relative small fluctuation and distributed in the vicinit of the ground truth.
446 X. Lu et al. a b c Fig. 9. Comparison between the two circle detection algorithm with actual values in 0 times computation record: acircle center s horizontal coordinate, bcircle center s vertical coordinate, ccircle s radius square. Where a g, b g, r g represents circle center s horizontal coordinate, vertical coordinate and radius square in CGM, and a o, b o, r o represents circle center s horizontal coordinate, vertical coordinate and radius square in OPSCD.
A Circle Detection Method Based on Optimal Parameter Statistics in Embedded Vision 447 4 Conclusion This article puts forward a FPGA based embedded vision platform, and proposes a circle detection algorithm based on optimal parameter statistics. The algorithm takes advantages of pipeline processing and parallel operations in FPGA, and implements real-time single circle detection algorithm. With the module of optimal parameter statistics, it reduces the computational compleit and ensures the accurac and robustness of the circle detection. Acknowledgments. This research was supported in part b STCSM DZ7600 and Innovation Foundation of SHU A0-007-09-90. References. Cann, J.A.: Computational Approach to Edge Detection. IEEE Trans. on PAMI 86, 679 698 986. Hough, P.V.C.: Methods and Means for Recognizing Comple Patterns: US, 069654 December 8, 96. Zhang, X., Su, Q.: Fast Algorithm for Circle Detection Using Randomized Hough Transform. Computer Engineering and Applications 008 4. Kong, B., Wang, Z., Tan, Y.: Algorithm of Laser Spot Detection Based on Circle Fitting. Infrared and Laser Engineering 00 5. Chen, A.-J., Li, J.-Z., Li, D.-D.: Improved Randomized Algorithm for Circle Detection. Opto-Electronic Engineering 006 6. Chen, T.C., Chung, K.L.: An Efficient Randomized Algorithm for Detecting Circles. Computer Vision and Image Understanding 8, 7 9 00 7. Zeng, J.: An Improved Cann Edge Detector Against Impulsive Noise Based on CIELAB Space. Intelligence Information Processing and Trusted Computing 0 00 8. Peng, F., Lu, X., Lu, H., Shen, S.: An Improved High-speed Cann Edge Detection Algorithm and Its Implementation on FPGA. In: ICMV 0. Proc. SPIE, vol. 850, p. 850 0, doi:0.7/.90950, Online Publication Date: Januar, 0