fpga_implementation of cht

4
 978-1-4673-5292-5/12/$31.00 ©2012 IEEE Modified Circular Hough Transform using FPGA F.Ferhat-taleb Alim, K.Messaoudi, S.Seddiki and O.Kerdjidj Centre de développement des technologies avancées CDTA Baba Hassen, Algiers [email protected] Abstract   The main objective of our paper is to implement on FPGA (Field Programmable Gate Array) an architecture of a method used to detect circles from edge images based on Hough transform algorithm. At first, an algorithm has b een developed and tested using Matlab software. The modified algorithm that we have followed to realize our architecture simplifies trigonometric calculations to just simple additions by using Cordic algorithm. Then architecture has been elaborated and implemented under Xilinx ISE 9.2i Foundation tool and tested on real-time. We will discuss the performance and parallelism of the algorithm and we will show its efficiency. Keywords-HoughTtransform; iris detection; cordic algorithm; FPGA; V2MB1000. I. INTRODUCTION One of the major challenges in computer vision is determining the location, orientation of a particular object in an image. Usually objects may come in different sizes and shapes not pre-defined in an arbitrary object detection program. A solution to this problem is to provide an algorithm that can be used to find any shape within an image, and then classify the objects according to parameters needed to describe the shapes. A commonly used technique to achieve this; is the Hough Transform (HT). The Hough transform [1] is one of the most common methods used for detecting parametric curves in a binary image. A parametric curve here means a curve or surface which can be described by an equation with number of free parameter, e.g. a line, a circle, an ellipse, etc. The general principle of Hough transform is to establish a projection between the image space and the parameter space representing the desired curve. The Hough transform (HT) has a broad application today, e.g. it is used in robotics, biometry, and image processing. Although, the HT is a robust technique for finding curves in image, the hardware complexity increases with the number of parameter. So, the computational complexity and requirement of excessive memory are the main obstacles for the hardware implementation of HT. Recently, the superiority of the Hough transform is challenged by the detection of complex curves like circles [2, 3], ellipse, or arbiter curves and the optimization of the treatment delay and memory space on the implementation of the Hough transform on programmable circuit. Therefore, different architectures and algorithms [4, 5, 6,7 and 9] of HT have been proposed. Most of these architectures have met the problem of implicit evaluation of trigonometric functions that makes the implementation difficult. To overcome this problem, we propose in this paper architecture based on cordic algorithm. The architecture of modified circular Hough transform (CHT) of has been first simulated in Matlab and obtained good results. Then, it has been implemented on FPGA circuit. In this paper, we present how we detect circle on image with Hough transform. Section III explains the modified CHT using the basic idea of Cordic algorithm. Results of software implementation of modified CHT are given in section IV. The Architecture which has been developed for this algorithm is describes in section V. Section VI discusses the implementation results and section VII presents some conclusions. II. CIRCULAR HOUGH TRANSFORM The CHT has been recognized as robust techniques for curve detection. This method can detect object even polluted by noise. The CHT was sketched by Duda et al. [8]. The CHT is one of the modified versions of the HT. The CHT aims to find circular patterns within an image. The CHT is used to transform a set of feature points in the image space into a set of accumulated votes in a parameter space. Then, for each feature point, votes are accumulated in an accumulator array for all parameter combinations. The array elements that contain the highest number of votes indicate the presence of the shape. A circle pattern is described by (1). = (x-a) ² + (y-b) ² (1) Where a and b are the coordinates of the center and r is the radius of the circle. In contrast to the linear HT [8], the Circular Hough Transform (CHT) relies on 3 parameters, which requires a larger computation time and memory space, increasing the complexity of extracting information from our image. To simplify calculation we can fix the value of the radius r (r become known) then the circle will depend only on parameters of the center (a, b). For a given radius, each point of a circle in an image will itself be a circle of radius r centered on the given point in Hough space. The intersection of these circles is the center of the initial circle, and this is shown in Fig. 1. 2012 24th International Conference on Microelectronics (ICM)

Upload: loilevan

Post on 03-Nov-2015

222 views

Category:

Documents


0 download

DESCRIPTION

FPGA_Implementation of CHT

TRANSCRIPT

  • 978-1-4673-5292-5/12/$31.00 2012 IEEE

    Modified Circular Hough Transform using FPGA

    F.Ferhat-taleb Alim, K.Messaoudi, S.Seddiki and O.Kerdjidj Centre de dveloppement des technologies avances

    CDTA Baba Hassen, Algiers [email protected]

    AbstractThe main objective of our paper is to implement on FPGA (Field Programmable Gate Array) an architecture of a method used to detect circles from edge images based on Hough transform algorithm. At first, an algorithm has been developed and tested using Matlab software. The modified algorithm that we have followed to realize our architecture simplifies trigonometric calculations to just simple additions by using Cordic algorithm. Then architecture has been elaborated and implemented under Xilinx ISE 9.2i Foundation tool and tested on real-time. We will discuss the performance and parallelism of the algorithm and we will show its efficiency.

    Keywords-HoughTtransform; iris detection; cordic algorithm; FPGA; V2MB1000.

    I. INTRODUCTION One of the major challenges in computer vision is

    determining the location, orientation of a particular object in an image. Usually objects may come in different sizes and shapes not pre-defined in an arbitrary object detection program. A solution to this problem is to provide an algorithm that can be used to find any shape within an image, and then classify the objects according to parameters needed to describe the shapes. A commonly used technique to achieve this; is the Hough Transform (HT).

    The Hough transform [1] is one of the most common methods used for detecting parametric curves in a binary image. A parametric curve here means a curve or surface which can be described by an equation with number of free parameter, e.g. a line, a circle, an ellipse, etc. The general principle of Hough transform is to establish a projection between the image space and the parameter space representing the desired curve.

    The Hough transform (HT) has a broad application today, e.g. it is used in robotics, biometry, and image processing. Although, the HT is a robust technique for finding curves in image, the hardware complexity increases with the number of parameter. So, the computational complexity and requirement of excessive memory are the main obstacles for the hardware implementation of HT. Recently, the superiority of the Hough transform is challenged by the detection of complex curves like circles [2, 3], ellipse, or arbiter curves and the optimization of the treatment delay and memory space on the implementation of the Hough transform on programmable circuit.

    Therefore, different architectures and algorithms [4, 5, 6,7 and 9] of HT have been proposed. Most of these architectures

    have met the problem of implicit evaluation of trigonometric functions that makes the implementation difficult. To overcome this problem, we propose in this paper architecture based on cordic algorithm. The architecture of modified circular Hough transform (CHT) of has been first simulated in Matlab and obtained good results. Then, it has been implemented on FPGA circuit.

    In this paper, we present how we detect circle on image with Hough transform. Section III explains the modified CHT using the basic idea of Cordic algorithm. Results of software implementation of modified CHT are given in section IV. The Architecture which has been developed for this algorithm is describes in section V. Section VI discusses the implementation results and section VII presents some conclusions.

    II. CIRCULAR HOUGH TRANSFORM

    The CHT has been recognized as robust techniques for curve detection. This method can detect object even polluted by noise. The CHT was sketched by Duda et al. [8]. The CHT is one of the modified versions of the HT. The CHT aims to find circular patterns within an image. The CHT is used to transform a set of feature points in the image space into a set of accumulated votes in a parameter space.

    Then, for each feature point, votes are accumulated in an accumulator array for all parameter combinations. The array elements that contain the highest number of votes indicate the presence of the shape. A circle pattern is described by (1).

    r = (x-a) + (y-b) (1) Where a and b are the coordinates of the center and r is the

    radius of the circle. In contrast to the linear HT [8], the Circular Hough

    Transform (CHT) relies on 3 parameters, which requires a larger computation time and memory space, increasing the complexity of extracting information from our image. To simplify calculation we can fix the value of the radius r (r become known) then the circle will depend only on parameters of the center (a, b).

    For a given radius, each point of a circle in an image will itself be a circle of radius r centered on the given point in Hough space. The intersection of these circles is the center of the initial circle, and this is shown in Fig. 1.

    2012 24th International Conference on Microelectronics (ICM)

  • If we vary the radius r (r is unknown), each edge point in image space will have a volume of cone in the Hough space, and this is shown in Fig. 2.

    Figure 1. Detection of a circle with a fixed radius using HT

    Figure 2. Detection of a circle with a fixed radius using HT

    The intersection of all these cones gives us the coordinates of the center and the radius of the circle researched.

    A. Circular Hough transform algorithm Let Ic be the binary image, the circular Hough transform

    algorithm is: Initialize accumulator H to zero. For each edge point (x,y) in the image I For each radius r. - Draw a circle by taking this point as a center. - Increment the value of all points on the accumulator where the circle passes through. Search peak value in the accumulator. III. MODIFIED CIRCULAR HOUGH TRANSFORM

    The modified circular Hough transform is based on Cordic algorithm. This one is used to calculate trigonometric functions.

    A. Cordic algorithm In 1957 Jack E. Volder [10] described the Coordinate Rotation Digital Computer or CORDIC for calculation of trigonometric functions, multiplication, division and conversion between binary and mixed radix number system. The CORDIC- algorithm provides an iterative method of performing vector rotations by arbitrary angles using only shift and adds. To explain CORDIC principal, we choose two points (x,y) and (x,y) belonging to a circle, and this is shown in Fig. 3.

    Figure 3. Rotation of vector by the angle x = R sin y = R cos (2)

    and

    x = R sin (+) y = R cos (+) (3)

    Combining equations (2) and (3) we get: x = x cos y sin = (x - y tan ) cos y = y cos + x sin = (y + x tan ) cos (4) We have 0 = atan2-j 2-j , j > 3. If we choose j = 4 so

  • in a virtual space where the center of the circle is coincident with the origin of this space (0.0). Then we just made shifts for each edge point in order to fill the accumulator tables, instead of sweeping the entire circle. It was sufficient to sweep the quarter of the circle, and then get the rest from it. We have repeated those steps for different radius varying from 4 to 16.

    C. Modified Circular Hough transform algorithm The modified circular hough transform algorithm is: Initialize the accumulator to zero. For each radius R. For each micro-rotation ( xGi , yGi ). For each edge counter point (xi , yi).

    A1i = xi + xGi, B1i = yi + yGi A2i = xi - yGi,B2i = yi + xGi

    A3i = xi - xGi,B3i = yi - yGi A4i = xi + yGi,B4i = yi - xGi Increment the accumulators that have the address (A1i,

    B1i), (A2i, B2i), (A3i, B3i), (A4i, B4i) in the RAM. Look for peaks in all accumulators. RESET the RAM IV. SIMULATION RESULT USING MATLAB

    Since Hough Transform is applied only on a binary image, we have to convert our color image to binary edge image before applying the Hough transform.

    Introducing our image it passes through different applications that we have programmed using Matlab. Steps of circular Hough with Matlab are shown below in Fig. 4:

    (a) (b) (c)

    (d) (e)

    Figure 4. a) initial Image, (b) Image after Canny-Deriche filter., (c) Hough Plan of 2D image, (d) 3D Hough plan , (e) Detection of circle on the iris.

    V. HARDWARE IMPLEMENTATION In this part, we will describe on VHDL language, our

    architecture of modified Circular Hough Transform. This architecture is composed of different blocs. The global architecture is shown in Fig. 5:

    Figure 5. Global architecture

    A. Total bloc This blocs architecture is shown in Fig. 6. It is composed of:

    Generator: Generate addresses of the virtual circle where its center is coincident with the space origin. Shift: Used for the changes of reference in order to give us the right address that will be accumulated

    Figure 6. Total bloc architecture

    Accumulator: Two accumulators that work in parallel, the first is used for finding results and the second for filling up. Multiplexer: Used to switch between the two accumulators. DMUX: Used to switch between the two accumulators, with inverse select line as the Multiplexer. Results: find the final result (R: radius, X, Y: the coordinate of the circle center).The word data is plural, not singular.

    B. Simulation of Global architecture The result of the functional simulation of our global

    architecture that gives the final result is represented on Fig. 7.

  • Figure 7. Simulation result of the global architecture.

    The table I show the resources used for the implementation of our architecture on XC2V1000_4fg 456 circuit.

    TABLE I. IMPLEMENTATION RESULT

    Number of Slices 578 out of 5120

    11%

    Number of External IOBs

    19 out of 324

    5%

    Number of GCLKs

    3 out of 16 18 %

    Number of BRAMs

    8 out of 40 20%

    Delay execution time

    10, 028 ns

    C. Real time execution This is the final step of implementation, so we have

    generated a file [.bit], which will be sent through the JTAG, and this is used to program the FPGA circuit and be able to test and verify the credibility and the performance of our architecture on the board V2MB1000 in real time.

    In order to display the result (R: radius, X, Y: the coordinate of the circle center), we use 7 segments display, we use also dip switch to select which value will be displayed (Fig. 8). If dip switch 11100000 : display R If dip switch 10100000 : display X If dip switch 11000000: display Y

    Figure 8. Real time results

    VI. CONCLUSION The purpose of the work presented in this paper is the

    implementation on FPGA of the Hough Transform method

    used to detect circles from images. The algorithm performed is not applied directly on real image but on binary edge image. In order to obtain a binary edge image, the image passed through several steps of pretreatment that have been performed using Matlab, then we have developed and tested the algorithm of our architecture using Matlab and obtained accuracy results.

    The architecture that we have proposed has been described in VHDL language and through synthesis which allows a time reduction design. The simulation results show the good functioning of our architecture. For the synthesis, the results indicate that the proposed architecture occupies 11% of XC2V1000-4fg456C circuit of the Virtex-II with a frequency of 66.914 MHz.

    As a perspective, it could be interesting that this work can be used in a biometric system via an implementation on a map-based FPGA. For the realization of such a system it should be taken into consideration the stages of acquisition and preprocessing of the iris.

    REFERENCES

    [1] P.V.C. Hough, Method and means for recognizing complex patterns, 1962.

    [2] M.Nosrati , R.Karimi, H.Nosrati, A. Nosrati, A method for detection and extraction of circular shapes from noisy images using median filter and CHT, Journal of American Science, pp: 84-88, 2011

    [3] H. Ruppertshofen , C.Lorenz Sarah Schmidt , P.Beyerlein, Z.Salah, R.Georg, H.SchrammL Discriminative Generalized Hough transform for localization of joints in the lower extremities , journal of computer science, vol.26, pp: 97-105, 2010

    [4] T.Moravk, An Approach to Iris and Pupil Detection in Eye Image, XII International PhD Workshop OWD, pp : 239-242, 2326 Oct. 2010

    [5] T.Duan, D.Duc, T.Hong Du, Combining Hough Transform and Contour Algorithm for detecting Vehicles License-Plates, Proceedings International Symposium on Intelligent Multimedia, Video and Speech Processing , pp:747-750, Oct. 20-22, 2004

    [6] O.Djekoune, K. Achour, Incremental Hough Transform: An Improvement Algorithm for Digital Devices Implementation, Journal real-time imaging, vol. 10, N 6, pp: 351-363, Dec.2004.

    [7] S. Tagzout, K. Achour, O. Djekoune, Hough transform for FPGA implementation, IEEE Workshop on Signal Processing Systems, pp. 384-393, oct.2000.

    [8] R.O. Duda , P.E. Hart, Use of the Hough transform to detect lines and curves in pictures, ACM Communications magazine, vol. 15, pp:1115, 1972

    [9] K. Maharatna et Swapna Banerjee A VLSI array architecture for Hough transform, Pattern Recognition, vol.34, pp: 1503-1512. 2001

    [10] J.E. Volder. "The CORDIC Trigonometric Computing Technique". IRE Transactions on.Electronic Computers, vol. EC-8, N 3, pp: 330-334, 1959