K. Chen and J. Wu

Vol. 31, No. 12 / December 2014 / J. Opt. Soc. Am. A

2593

One-dimensional voting scheme for circle and arc detection Ke Chen1,2,3,† and Jianping Wu1,2,4,† 1

Jiangsu Province Support Software Engineering R&D Center for Modern Information Technology Application in Enterprise, Suzhou 215104, China 2 School of Computer Engineering, Suzhou Vocational University, Suzhou Jiangsu 215100, China 3 e-mail: [email protected] 4 e-mail: [email protected] Received April 9, 2014; revised September 18, 2014; accepted October 12, 2014; posted October 14, 2014 (Doc. ID 209659); published November 6, 2014

Circle detection is an important issue that has not been perfectly solved in automated image analysis to date. It is traditionally carried out via pixel-based 3D voting algorithms, involving tremendous computation and requiring huge storage space with questionable accuracy. In this report, a novel edge-section-based 1D voting algorithm is developed in circle detection to improve the detection rate and precision. Based on experiments with simulated image data and a ground-tested standard dataset, the novel scheme significantly outperformed all previous state-of-the-art schemes in detection rate and precision, and was comparable to the state of the art in processing speed. © 2014 Optical Society of America OCIS codes: (100.2960) Image analysis; (100.5010) Pattern recognition; (100.5760) Rotation-invariant pattern recognition. http://dx.doi.org/10.1364/JOSAA.31.002593

1. INTRODUCTION The circle is one of the most common forms and circle detection is an important issue in automated image analysis. Circle detection is essential in automatic inspection of manufactured products and components, automatic detection and tracking of targets, and aided vectorization of drawings. Because of its wide application, circle detection has attracted much attention, and a variety of approaches have been developed to address this issue. Thus far, none of the published methods could adequately solve the circle detection problem due to the shortcomings of low processing speed, inaccuracy, and/or limitation in applications. Since Hough developed the Hough transform (HT) for line detection [1], a variety of methods have been proposed for circle detection using the HT method [2–4]. Circular Hough transform (CHT) takes advantage of edge information created by an edge detector to evaluate the center positions and radii of expected circles. The peaks are detected through averaging, filtering, and histogramming the transform space. Since it is carried out in a 3D voting space that involves complicated analysis of a large amount of data, CHT usually requires prohibitively large data storage and incurs huge computational cost with extremely low processing speed [5]. Improvements have since been made on CHT through modifying the algorithm detection rate or scaling down the computational complexity. These refinements on CHT include taking the edge orientation into consideration [6], introducing phase information into radius coding [7], employing convolution operators to filter the HT [8], 1084-7529/14/122593-10$15.00/0

and using probabilistic pairwise voting [9]. Overall, these refinements have had a limited effect. To deal with the high computational complexity of CHT, more efficient circle detection methods have been proposed. One of them is the randomized circle Hough transform (RCHT) [10–12]. RCHT randomly selects a number of pixels from an image and then fits them to a parameterized curve for circle detection. Since only a small portion of pixels are initially selected for processing, RCHT requires much less storage space and thus can process data much faster than CHT. Although RCHT is effective when edge pixels are sparse, its detection reliability and processing speed deteriorate with growing scene complexity. Ceccarelli et al. [13] presented another circle detection method by correlating the magnitudes and directions of image gradients. More recently and similar to CHT, Rad et al. [14] developed a fast circle detection (FCD) method based on pixel gradient pair vectors to accurately and quickly detect circles. Furthermore, some iterative mathematical tools have been proposed to address the circle detection. Dave [15,16] introduced fuzzy shell-clustering (FSC), which performed slightly better than CHT in terms of memory requirement and processing speed. Bezdek and Hathaway [17] made an improvement on FSC. Krishnapuram et al. [18] refined FSC further based on Bezdek’s method by removing the nonlinear equations to decrease the processing complexity. Schuster and Katsaggalos [19] presented a circle detection algorithm based on the weighted minimum mean square error estimator, which also runs faster than CHT. The genetic algorithm (GA) was another © 2014 Optical Society of America

2594

J. Opt. Soc. Am. A / Vol. 31, No. 12 / December 2014

circle detection scheme [20,21]. Similar to FSC, the processing speed, convergence, and accuracy of the GA are affected by the number of generations (or more precisely iterations) GA takes before a preset threshold is reached. Another interesting iterative method reported is the bacterial foraging optimization algorithm (BFOA) developed by Dasgupta et al. [22]. The speed of the BFOA is comparable to that of GA, but is slower than CHT-based algorithms. Overall, iterative schemes are generally not as efficient as noniterative ones, and their processing speeds depend heavily on the computation cost involved in each iteration and the number of iterations required before a satisfactory result is achieved. Another drawback for an iterative algorithm is that it occasionally converges to local minima, which not only lowers the detection precision, but also affects the overall processing speed. Recently, Lamiroy and Guebbas [23] used the random sample consensus minimization (RANSAC) scheme to detect circles and arcs. The method performed so well with linedrawing images that it won the Arc Segmentation Contest on GREC in 2011 [24]. Most recently we developed a fast and accurate circle detection algorithm (FACILE [25]) using gradient-direction-based segmentation and direct least-square fitting (DLSF). FACILE outperformed CHT [2], RCHT [10], and Rad [14] in both processing speed and detection precision. FACILE [25] also outperformed RANSAC [23] in arc detection precision and speed. In this paper, we describe a novel circle/arc detection algorithm, speedy and precise arc detection (SPREAD). SPREAD simplifies circle detection to a 1D voting process that expeditiously carries out highly reliable circle/arc detection with significantly enhanced precision. In SPREAD, circle detection is carried out via specially built arc pairs. The circle edges are first segmented into subsections based on their gradient directions. Each subsection consists of a group of connected pixels whose gradient angles span no more than a predefined threshold. Then all subsections are tested against each other to search arc pairs likely belonging to the same circles. Afterward, a radius voting function is built based on the collected arc pair information. Finally, the DLSF method is exerted on the arcs that contribute to the peak of the voting function that estimates the proximate radius of a circle to extract the precise center and radius information for each circle.

2. PROPOSED ALGORITHM A. Preprocessing Thanks to its resistance to noise interference and its ability to generate single-pixel-width edges, which are preferable in pinpointing circle center and radius information, the Canny edge operator [26] is employed as the edge detector. Since some images such as the raw high-resolution scans usually show undesirable raggedness along the contours, which may have a serious negative effect on the detection reliability if not handled properly, a Gaussian smoothing filter is used to remove the high-frequency noise before performing Canny edge detection. We found that a 3  3 Gaussian kernel would be sufficient in practice to remove most of the raggedness. In a preprocessing step, every extracted edge pixel is marked with its gradient direction, with nonedge pixels marked as zeros and valid edge pixels marked with

K. Chen and J. Wu

Fig. 1. Preprocessing and arc segmentation.

integers between 1 and 360 based on their corresponding gradient angles. To distinguish it from a nonedge pixel, a valid edge pixel with gradient angle of 0° is marked with 360 instead. The result is an M × N matrix Matrixedge in which initial element values are integer angles between 0° and 360°. Figure 1(a) shows an original line drawing that contains a single circle. As shown in Fig. 1(b), a circle turns two sets of Canny edges (outside and inside) after preprocessing. B. Arc Segmentation and Extraction In cluttered scenes, the edges of a specific circle are almost always entwined with edges from other objects. For the proposed 1D voting scheme to work properly, two conditions should be met. First, a sufficient portion of the edge sections of a specific circle is separated from edge sections of other objects so that the precise circle information can be retrieved via executing the voting process on these edge sections. Second, most of the edge sections generated after segmentation contain a significant number of pixels to avoid affecting the processing speed. Since an edge pixel’s gradient direction is nearly perpendicular to the edge’s tangent direction at the position, gradient direction angles are conveniently used as criteria to segment edges into sections covering only a limited range of gradient angles, each of which is an arc spanning a significant section of a circle or arc, or simply a section of straight line. Assuming edges are to be segmented into arc sections covering no more than an angle of α, the simplest and fastest way is to segment edges into edge clusters, each of which spans a gradient angle no more than α. With Canny edges being single-pixel-width edges, the Canny edge matrix can be readily converted into a graph-like structure, with each valid element being regarded as a vertex carrying a value between 1 and 360 (according to the actual gradient direction at the position) if not already visited, or greater than 360 after visitation, and invalid elements are simply ignored. In the graph, two valid vertices are defined as adjacent if their coordinates x1 ; y1  and x2 ; y2  meet the condition maxjx2 − x1 j; jy2 − y1 j  1. The depth-first search (DFS) of the graph (G) is carried out as follows:

K. Chen and J. Wu

Vol. 31, No. 12 / December 2014 / J. Opt. Soc. Am. A

2595

DFS (G) Allocate sufficient memory for a 2D array named Array[][] for each vertex u ∈ G.V u.value = Gradient-Angle //between (1–360) numberArrays = 0 for each vertex u ∈ G.V if 0 x2i < a  P ni1 xiP2 − n ni1P > Pn  > P > n n n > xi 2 − n ni1 x2i ≠ 0 b  x y − n xi yi when > i i i1 i1 i1 i1 > P P < : n n 8 c  −a i1 xi − b i1 yi : >   P P > n 2 > b1 > when − n ni1 x2i ≡ 0 > i1 xi > : : c  − Pn y i1 i

In addition to each arc’s perpendicular bisector information, the positions of the three pixels along the arc, namely two ends and the middle point, are also extracted for processing in the following steps. C. Arc Pair Extraction Each arc is tested against every other arc to determine whether the two arcs belong to the same circle and to form a candidate arc pair. A candidate arc pair must meet certain

1

radial directions. More accurate information of arcs or circles can be extracted with this approach in the following steps. D. Building 1D Radius Voting Function based on Arc Pairs The proposed algorithm employs a 1D voting procedure to highlight the contributions from valid circles (or arcs) while minimizing the effect of background noises. To achieve this, a

2596

J. Opt. Soc. Am. A / Vol. 31, No. 12 / December 2014

K. Chen and J. Wu

Fig. 2. Validation of an arc pair.

radius-based voting function f (r) is built based on the weighted arc pair accumulation as follows: f r 

n X li1 li2 i1

r2

    r − r i2 2 ; exp −τ i1 r

(2)

where r i1 and r i2 represent CP1 and CP2 in Fig. 2. For candidate arc pair i, n is the number of candidate arc pairs that i2 meet the condition ri1 r  r, li1 and li2 are the lengths of 2 the two arcs of the arc pair i, and the factor r12 is introduced i2 into the formulation for normalization. Since larger j ri1 −r j inr dicates that the two arcs are less likely to be on the same i2 2 circle, the factor exp−τri1 −r r   is introduced to reflect this effect, with τ being a predefined threshold. Figure 3 illustrates an engineering drawing image and its radius voting result based on Eq. (2) with α set to 40 and τ set to 600. The image contains eight semicircles (radius of 38) and five concentric circles (radius 140, 151, 175, 233, and 286), among which one circle at radius 233 is broken. The voting process results in two sets of 1D voting distributions, one gathered from inside edges [blue in Fig. 3(b)] and the other from outside edges [pink in Fig. 3(b)] of circles. The radius voting process correctly picks up the six radius

positions of these semicircles or circles; here the peak generated by eight semicircles of identical radius is the highest, as expected, and the peak from the broken circle (radius at 233) is reasonably lower than most of the other peaks. Also note that the smallest concentric circle (radius at 140 pixels) has only an outside voting peak since its inside edges are cut into small pieces, from which the voting process is unable to retrieve adequate accumulation. There are some false peaks lying between 60 and 90 in Fig. 3, which come primarily from the straight lines located around the center of the picture. However, these peaks can be eliminated in the following steps. According to our observation, the full width at half maximum (FWHM) of a peak grows with the radius (Fig. 3). For example, the FWHM is 3 pixels at radius position 38 and 6 pixels at 233. On the other hand, the noises tend to drop when the radius grows. E. Voting-Function-based Peak Extraction Extraction of peaks from the 1D voting result is straightforward. A certain threshold is set to distinguish valid peaks yielded by existing circles from false peaks accumulated from background noises. The threshold selection directly affects the detection rate and false alarm rate. Selecting a low threshold allows the detection of shorter or more fragmented arcs but leads to the increase of the false alarm rate, whereas choosing a high threshold will have the opposite effects. Moreover, selecting a low threshold leads to more peaks being processed and eventually affects the processing speed. The above factors need to be carefully weighed when selecting thresholds for circle detection. After each peak is obtained, the FWHM can be used to determine every peak radius’s effective range between two half-maximum points r left ; r right . F. Further Processing of Arc Pairs based on the Extracted Peaks After all peaks and their half-maximum points r left ; r right  are extracted, each peak is processed individually. In processing a peak, all candidate arc pairs with radii lying between r left and r right of the peak are revisited and are then divided into clusters based on the center positions using a method similar to K-means [27]. The detailed steps to classify candidate arc pairs are as follows: Step 1: Put all of the candidate arc pairs whose radii lie between r left ; r right  in a buffer. Step 2: Search the arc that is most frequently paired with other arcs in the buffer. Step 3: Calculate the mean position of the centers of all those arc pairs that contain the arc. Then move all of the candidate arc pairs whose centers are no more than 4.0  0.01  r left  r right  pixels from the mean center and put them into a new bucket. Step 4: If there are arc pairs left in the buffer, go to Step 2. Step 5: Output all buckets, each of which is ready for circle DLSF.

Fig. 3. 1D radius voting distribution of a typical engineering drawing image.

Figure 3 contains eight semicircles whose radii are around 38. Since the center positions of these semicircles are far away from each other, the arc pairs belonging to different semicircles can be straightforwardly put in different clusters. The more tricky part of clustering, however, is to pick apart

K. Chen and J. Wu

Vol. 31, No. 12 / December 2014 / J. Opt. Soc. Am. A

arc pair candidates belonging to two concentric circles whose radius difference is so small that their peak areas are partly overlapped. Since the FWHM of a peak arising from two or more circles of similar radii is usually significantly wider than the FWHM created by a single circle, every FWHM that is wider than 2  0.04  r peak (the radius position of the peak) is further checked for the existence of multiple circles. The method is to sort the arc sections based on their radial angles. If two or more arc sections are overlapped in radial directions, it can be determined that concentric circles exist. Those radially overlapped arc sections are separated into different buckets (for example, arcs that are nearer to the center are put in a bucket, and the farther ones are put in the other bucket). As almost every cluster contains only those arc pairs belonging exclusively to the same circle after clustering processing via K-means, DLSF is employed to extract the precise circle information, including the radius and the center position, from each cluster. First, all of the arcs belonging to the arc pair cluster are put in a bucket and the duplicate arcs are removed from the bucket. Their pixels are then processed further using circular DLSF. DLSF starts from the following circle equation: x − xc 2  y − yc 2  R2 ;

(3)

where R is the radius of the arc, and xc ; yc  is the arc’s center coordinates. Gander et al. [28] presented two types of least-square circle fitting, namely algebraic fitting (also known as DLSF) and geometrical fitting (iterative fitting, which is more accurate than DLSF, but also more time consuming). We use Kasa’s [29] DLSF algorithm to carry out circle information extraction from edge pixels. Assume that we have a set of n points x1 ; y1 ; x2 ; y2 ; …; xn ; yn , which fall on the circumference of a circle whose radius is R and whose center position is at xc ; yc . For any edge point x; y, the following equation stands: x − xc 2  y − yc 2  R2

(4)

x2  y2   ax  by  c  0;

(5)

or

where a  −2xc ; b  −2yc ; c  x2c  y2c . If we set up a function f a; b; c 

n X i1

x2i  y2i  axi  byi  c2 ;

(6)

then we expect that the best choice of values for a; b; c should result in f a; b; c reaching the minimum, which requires that 8 P 2 P P P ∂f > xi yi  c xi  x3i  xi y2i   0 < ∂a  2a P xi  b P P P ∂f xi yi  b y2i  c yi  x2i yi  y3i   0 : ∂b  2a > : ∂f  2a P x  b P y  P c  Px2  y2   0 i i i i ∂c 7

2597

Equation (10) yields the following results: 0P

x3i  xi y2i

P

xi yi

P

xi

1

BP 2 P 2 P C 3 xc  detB yi yi C A∕ @ xi yi  yi P 2 P 2 xi  yi yi n 0P P P 1 2 xi xi yi xi BP P 2 P C B det@ xi yi yi yi C A∕2; P P xi yi n 0P

x2i

BP yc  detB @ xi yi P xi 0P x2i BP detB @ xi yi P xi

R

P 3 P 1 xi  xi y2i  xi P 2 P C 3 xi yi  yi  yi C A∕ P 2 2 xi  yi  n P P 1 xi yi xi P 2 P C yi yi C A∕2; P yi n

 q X  xi − xc 2  yi − yc 2 ∕n;

(8)

(9)

(10)

where xc ; yc  are the arc’s center coordinates and R is the arc’s radius.

3. COMPUTATION COST ESTIMATION Assuming that the image resolution is M × N (pixels), among which e% are edge pixels, and on average an edge segment contains p pixels, there are approximately n  0.01eMN p −4 2 2 2 segments, and nn−1 ≈ 10 e2pM2 N arc pair validations are 2 needed to extract arc pair candidates. So the computation complexity is OM 2 N 2 , proportional to the square of the pixel number of an image. Since Canny edges are single-pixel-width edges, the fraction of image pixels that the Canny edge detector extracts is very small, usually less than 5%. This being the case, there would be around 2 × 106 of arc pair validations for an image of 1000 × 1000 pixels, supposing that the average number of pixels of a segmented edge is 20. The main cost for an arc pair validation lies in extraction of the intersection of two edge segments and calculation as well as comparisons of r i1 and r i2 , which involves only basic arithmetic operations. Initial elimination of invalid arc pairs can be accelerated by discarding those arc pairs whose two arcs’ inter-center distances are much greater than any of the arc lengths themselves or neither of whose two arcs’ bending angles are less than a preset threshold. For a typical image of 1000 × 1000, the overall computation cost for arc pair extraction is about 2 × 106 simple arithmetic operations (in practice, every operation involves 10 plus multiplications, five additions or subtractions, two divisions, and two comparisons). Since only a very small portion of arc pairs—less than 0.3% based on our experiments—are valid arc pairs that make nonnegligible contributions toward voting results, the computation cost involved in the voting process and the fitting process is negligible compared to the arc pair candidate gathering. Since 2 × 106 is comparable to the image’s pixel size of 1000 × 1000, this cost is comparable to Canny edge detection. However, when the image grows larger, the computational cost of arc

2598

J. Opt. Soc. Am. A / Vol. 31, No. 12 / December 2014

Fig. 4.

K. Chen and J. Wu

Simulated data that contain 80 circles (radius 20 pixels) under different occlusions.

Table 1. Circle Detection Comparison among CHT, RCHT, RCD, FACILE, and SPREAD for the Simulated Data Circle CHT RCHT FCD FACILE SPREAD Detection a b Threshold FNC FPC FNC FPC FNC FPC FNC FPC FNC FPC 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85

0 0 0 3 5 8 12 13 23 41 59 77 79 80 80 80

107 100 64 26 21 20 15 11 6 4 2 1 0 0 0 0

6 7 9 10 12 12 13 13 16 21 27 34 45 62 80 80

27 25 24 18 15 14 13 12 10 8 7 7 6 2 0 0

8 8 8 8 8 8 9 10 11 13 16 28 41 45 62 80

a b

FNC, false negative error count. FPC, false positive error count.

48 42 39 36 34 31 28 24 19 16 10 2 0 0 0 0

13 13 13 13 13 13 13 14 15 16 17 18 24 31 39 50

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 1 2 6 13 20 26 30 39

8 6 3 0 0 0 0 0 0 0 0 0 0 0 0 0

pair validation is proportional to the square of the pixel size of the image and therefore has a more significant impact on the processing speed. Of note, unlike most of the circle detection algorithms, this algorithm’s computation cost is not significantly affected by the number of circles or arcs the image contains. Furthermore, this algorithm processing time degrades gently with the growth of the pixel size and range of the radii of the circles of interest. These properties make the proposed algorithm particularly preferable in situations in which multiple circles of widely distributed radii must be detected and precisely pinpointed in real-time situations.

4. EXPERIMENTS, EVALUATION, AND DISCUSSION The scheme, SPREAD, was implemented in Visual C++ within the Windows operating system and was tested on a desktop PC of Intel I5-4570 CPU (Clock frequency 3.2 GHZ) and 4 GB DRAM. In the experiment, we set the segmentation angle threshold α  40 and τ  600 for Eq. (2). The threshold for jr 1 − r 2 j∕r 1  r 2  was set as jr 1 − r 2 j∕r 1  r 2  < 0.025 for engineering drawing images, and was set as 0.04 for simulated

Fig. 5. F-Measure distributions for CHT, RCHT, FCD, FACLE, and SPREAD.

Fig. 6.

Processing time comparison of the five circle detection algorithms.

K. Chen and J. Wu

Vol. 31, No. 12 / December 2014 / J. Opt. Soc. Am. A

2599

data. Because the proposed scheme is not able to accurately pinpoint small circles, the minimum detectable radius was set to 10 pixels. In addition, we also set the minimum angle between two arcs’ perpendicular bisector lines in a valid arc pair as 40° for standard datasets and 15° for simulated data. The voting function peak threshold was set as 0.2 for both cases (a peak was further investigated for circle/arc detection only if its magnitude was more than 0.2). We first compared the performance of SPREAD with four other circle detection algorithms, namely CHT [2], RCHT [10], FCD [14], and FACILE [25], based on the simulated data shown in Fig. 4, which is a 1000 × 220 pixel image that contains 80 circles (radius at 20 pixels each) under four different occlusions, namely fan occlusions (first row), translating occlusions (second row), circular occlusions (third row), and fence occlusions (fourth row). In the experiment, CHT’s and RCHT’s accumulation cell sizes are all set at 1 pixel [x; y coordinates of center position and radius], and RCHT’s minimum inter-circle-center distance is set at 35 pixels to accelerate its processing speed. A. Detection Reliability Table 1 shows the detection performance for the five algorithms. The comparative experiment was conducted with a span between 0.1 and 0.85 in circle detection threshold, which is defined as the minimum ratio of the number of edge pixels along the circumference of a circle over the full length of the circumference of the circle that a validated circle must satisfy. The experiment showed that when the threshold was between 0.3 and 0.45, SPREAD achieved perfect detection, detecting all 80 circles while committing no false positive error. On the other hand, none of the other four algorithms was able to achieve perfect detection throughout the threshold distribution. To more completely evaluate the circle detection performance of the five algorithms, let us compare their F-measure [30,31], which is the harmonic mean of precision and recall: F

2 precision · recall ; precision  recall

(11)

where precision is defined as the fraction of detected circles that are valid circles, and recall is defined as the fraction of the total number of circles that are successfully detected. With its effective range lying between 0 and 1, F achieves its maximum 1 only when both precision and recall reach 1, which means that all and nothing but the valid circles are detected. F reaches zero if no existing circles are successfully detected. Figure 5 shows the F-measure distributions based on Table 1. From Fig. 5, it is obvious that SPREAD scored the highest F-measure among the five algorithms throughout the circle detection threshold. More specifically, SPREAD achieved a perfect F score of 1 when the circle detection threshold was between 0.3 and 0.45, while the second best performer, FACILE, had an F-measure of 0.91. Overall, SPREAD significantly outperformed the other four algorithms as far as circle detection on the simulated data was concerned. B. Processing Speed Comparison upon the Simulated Data The processing speed of a circle detection algorithm usually depends on the scene complexity, the number of circles that

Fig. 7. Nine test images in the standard dataset [33].

an image contains, and the lower bound and the upper bound of the radius distribution of circles of interest. To compare SPREAD’s processing speed with the other four algorithms (CHT, RCHT, FCD, and FACILE) on the simulated data in Fig. 4, we fixed the lower bound of detectable circles’ radii to 10 pixels and incremented the upper bound of radius from 10 to 100 pixels at steps of five pixels to observe these algorithms’ processing time behavior. Figure 6 shows the

2600

J. Opt. Soc. Am. A / Vol. 31, No. 12 / December 2014

K. Chen and J. Wu

dataset [33] that includes 27 ground-tested engineering linedrawing images used in the Arc Segmentation Contest organized by the 2011 (or 9th) International Conference on Graphics Recognition (GREC 2011). As shown in Fig. 7, the standard dataset contains nine original mechanical engineering drawing images scanned into three different resolutions: 200, 300, and 400 DPI. The ground-truth data for each of the 27 images contain the center, radius, and endpoint information for each of the arcs or circles for the image. Similarly to Al-Khaffaf et al. [24], we evaluated SPREAD’s accuracy using the arc detection performance evaluation protocol [34,35], in which the vector recovery index (VRI) (in the range of 0…1) is formulated as Eq. (12):

experimental result. When the radius upper bound grew from 10 to 100 pixels, SPREAD’s processing time increased gently from 5.4 to 8.0 ms, FACILE’s processing time increased from 3.4 to 9.1 ms, CHT’s processing time grew exponentially from 5.3 to 3604 ms, RCHT’s processing time increased approximately linearly from 25.3 to 164.6 ms, and FCD’s grew from 45.5 to 206.1 ms. Overall, SPREAD is the fastest among the five algorithms when the radius upper bound is 20 pixels or more. More specifically at the radius upper bound point of 50 pixels, SPREAD is 28% faster than FACILE, 11.7 times faster than RCHT, 15.6 times faster than FCD, and 107 times faster than CHT. So at least as far as the simulated data are concerned, SPREAD’s speed outperformed the other four algorithms when the radius range of circles of interest was more than 10 pixels.

VRI 

p Dv 1 − F v ;

(12)

where Dv is the detection rate and F v is the false alarm rate (the subscript “v” refers to vector). More specifically, Dv is the geometric mean of four factors: endpoint quality, overlap distance quality, line style quality, and line shape quality. The false alarm rate F v is the length-weighted sum of the false alarm factors of all arcs detected from the entire image (see [34] for details).

C. Detection and Precision Performance Evaluation based on Standard Ground-Tested Dataset In addition to the above simulated data, we also compared SPREAD with three state-of-the-art arc detection methods, namely RANSAC [23], FACILE [25], and Liu’s incremental arc segmentation (IAS) [32] using a ground-tested standard

Table 2. Performance Scores [Dv , Fv , VRI] Comparison among Four Algorithms on the Standard Datasets IASa

RANSACb

FACILEc

SPREAD (current)

Dv

Fv

VRI

Dv

Fv

VRI

Dv

Fv

VRI

Dv

Fv

VRI

P061

0.770 0.690

0.174 0.331

0.798 0.679

0.286 0.243

0.160 0.315

0.490 0.408

0.587 0.170

0.022 0.706

0.758 0.224

0.804 0.522

0.082 0.498

0.859e 0.512

P168

0.705 0.470 0.285

0.227 0.541 0.695

0.738 0.464 0.295

0.072 0.320 0.306

0.775 0.547 0.623

0.127 0.381 0.340

0.521 0.496 0.448

0.206 0.236 0.215

0.643 0.616 0.593

0.869 0.952 0.608

0.046 0.037 0.414

0.911 0.957 0.597

P229

0.553 0.429 0.327

0.422 0.547 0.681

0.565 0.441 0.323

0.354 0.384 0.000

0.225 0.239 1.000

0.524 0.540 0.000

0.541 0.567 0.080

0.294 0.124 0.874

0.618 0.705 0.100

0.703 0.833 0.235

0.225 0.099 0.752

0.738 0.866 0.242

P234

0.290 0.658 0.469

0.486 0.257 0.496

0.386 0.699 0.486

0.121 0.695 0.687

0.545 0.100 0.133

0.235 0.791 0.772

0.636 0.651 0.603

0.000 0.126 0.204

0.797 0.755 0.693

0.802 0.888 0.695

0.153 0.174 0.359

0.824 0.856 0.668

P238

0.204 0.397 0.284

0.718 0.646 0.745

0.240 0.375 0.269

0.139 0.146 0.139

0.308 0.610 0.708

0.311 0.239 0.201

0.541 0.525 0.469

0.540 0.529 0.493

0.499 0.497 0.487

0.609 0.904 0.759

0.467 0.179 0.280

0.570 0.862 0.739

P253

0.909 0.645 0.488

0.214 0.399 0.569

0.846 0.623 0.459

0.507 0.507 0.435

0.355 0.275 0.419

0.572 0.606 0.503

0.410 0.582 0.365

0.426 0.036 0.351

0.485 0.749 0.487

0.500 0.699 0.714

0.558 0.423 0.352

0.470 0.635 0.680

P254

0.422 0.368 0.525

0.406 0.550 0.469

0.501 0.407 0.528

0.106 0.178 0.198

0.365 0.572 0.594

0.260 0.276 0.283

0.303 0.275 0.127

0.424 0.417 0.761

0.425 0.400 0.174

0.709 0.700 0.769

0.070 0.166 0.135

0.812 0.764 0.815

P260A

0.467 0.528 0.525

0.449 0.471 0.559

0.507 0.528 0.481

0.054 0.205 0.125

0.213 0.227 0.576

0.207 0.398 0.230

0.314 0.355 0.359

0.385 0.501 0.518

0.439 0.421 0.416

0.530 0.666 0.546

0.127 0.156 0.311

0.680 0.750 0.613

P260B

0.379 0.318 0.218

0.525 0.647 0.769

0.424 0.355 0.224

0.074 0.176 0.084

0.498 0.700 0.866

0.193 0.230 0.106

0.105 0.044 0.040

0.260 0.798 0.819

0.278 0.094 0.085

0.573 0.402 0.100

0.222 0.577 0.880

0.668 0.412 0.110

Avg.

0.474

0.500

0.486

0.252

0.460

0.355

0.389

0.395

0.478

0.657

0.298

0.677

Image d

a

IAS performance data come from Table 2 of Al-Khaffaf et al. [24]. b RANSAC performance data come from Table 2 of Al-Khaffaf et al. [24]. c FACILE performance data come from Table 2 of Wu et al. [25]. d First, second, and third rows of each image correspond to 200, 300, and 400 DPI (dots per inch) (P061-400 DPI image is not included because of the lack of correct ground-truth data). e Highest VRI score in each resolution of the images is shown in bold.

K. Chen and J. Wu

Vol. 31, No. 12 / December 2014 / J. Opt. Soc. Am. A

Table 3. Processing Time Comparison among Four Algorithms on the Standard Dataset Method IASa RANSAC FACILE SPREAD (current)

Time/Pixel (μs/pixel) CPU Frequency (Type) 4.4 0.199 0.033 0.044

100M (MIPS R4000) 3.2G (Intel i5) 3.2G (Intel i5) 3.2G (Intel i5)

a

IAS data come from Table 5 of Liu and Dori [32].

Table 2 lists the performance evaluation results of four algorithms on the standard dataset. As shown in Table 2, SPREAD significantly outperformed the other three algorithms in average detection rate Dv , average false alarm rate F v (the lower the better), and, most importantly, average VRI score. The average VRI score of SPREAD (0.677) was about 39% higher than that of IAS (average VRI score of 0.486), which came out as the distant second best, in relative terms. Among the 26 images from the dataset, SPREAD scored the highest VRI in 20 images, while three other algorithms together accounted for the remaining highest VRI in six images, demonstrating that SPREAD is the best among the four algorithms in detection precision. Furthermore, the average detection rate of SPREAD (0.657) was significantly higher (38.6% higher in relative terms) than that of IAS (0.474), which was the best among the other three algorithms. And, SPREAD’s average false alarm rate at 0.298 is also significantly lower than the other three schemes, which shows that SPREAD is the most successful in filtering out invalid arcs among the four algorithms. D. Processing Speed Comparison upon Standard Dataset We compare SPREAD with RANSAC, IAS, and FACILE in processing time based on the standard dataset. Table 3 shows the time/pixel performance comparison between the four algorithms. RANSAC [23] took 0.199 μs to process a pixel on average, FACILE was the fastest and took 0.033 μs, and SPREAD’s average processing time was 0.044 μs/pixel, about 33% slower than FACILE, but approximately 4.5 times as fast as RANSAC. The IAS data in Table 3 come from Liu and Dori [32]. Tested on the SGI Indigo2 equipped with a 64-bit MIPS R4000 (100 MHz), IAS’ average process time was 4.4 μm/pixel, about 100 times slower than SPREAD, on the engineering drawing images similar to the standard dataset. Since SGI Indigo2 is much slower than Intel i5, which we used in our experiment, our comparison was made after appropriate adjustment. If we reasonably assume

Fig. 8. Processing time distributions of RANSAC, FACILE, and SPREAD on the standard dataset.

2601

that an algorithm should run 32 times as fast on a CPU of 3.2 GHz as on a CPU of 100 MHz, IAS’ adjusted time performance on Intel i5 was estimated to be 4.4∕32  0.1375 μm∕pixel. This being the case, SPREAD was about 3.1 times as fast as IAS. Overall, SPREAD was significantly faster than RANSAC and IAS but slightly slower than FACILE. Figure 8 shows the processing time distributions of RANSAC, FACILE, and SPREAD over 26 images in the standard dataset with the horizontal coordinates being the image width (the square root of the total number of pixels of an image). It shows that for small images, SPREAD’s processing speed was almost as fast as FACILE and around three times faster than RANSAC. But with the increase of image size, SPREAD’s processing speed degraded more quickly than FACILE’s, but was still better than RANSAC’s. Overall, SPREAD was consistently faster than RANSAC, and their process time efficiency ratio was between 2.66 and 7.96.

5. SUMMARY We have developed a novel 1D-voting-based circle and arc detection algorithm, which has significantly outperformed all of the state-of-the-art algorithms in processing precision. Its processing speed is comparable to the state of the art in circle detection.

ACKNOWLEDGMENTS This research was supported by the Science and Technology Plan Project of Suzhou (Nos. SYG201408, SGZ2014006, SGZ2012061, SGZ2013132), the Suzhou Vocational University Project (Nos. 2012SZDYY05 and 2012SZDYY06), and the Opening Project of Jiangsu Province Support Software Engineering R&D Center for Modern Information Technology Application in Enterprise (No. SX201203), National Natural Science Funds of China (Grant Nos. 61472268 and 41201338). †The authors contributed equally to the project.

REFERENCES 1. P. V. C. Hough, “Method and means for recognizing complex patterns,” U.S. patent 3,069,654 (December 18, 1962). 2. R. Duda and P. Hart, “Use of the Hough transform to detect lines and curves in pictures,” Commun. ACM 15, 11–15 (1972). 3. E. Davies, “A modified Hough scheme for general circle location,” Pattern Recogn. Lett. 7, 37–43 (1988). 4. P. Kierkegaard, “A method for detection of circular arcs based on the Hough transform,” Mach. Vision Appl. 5, 249–263 (1992). 5. T. Atherton and D. Kerbyson, “Using phase to represent radius in the coherent circle Hough transform,” in Proceedings of IEE Colloquium on the Hough Transform, (IEE, 1993), paper 5. 6. C. Kimme, D. Ballard, and J. Sklansky, “Finding circles by an array of accumulators,” Proc. ACM 18, 120–122 (1975). 7. T. Atherton and D. Kerbyson, “Size invariant circle detection,” Image Vision Comput. 17, 196–803 (1999). 8. D. Kerbyson and T. Atherton, “Circle detection using Hough transform filters,” in IEE Conf. On Image Processing and its Applications (IEE, 1995), pp. 370–374. 9. L. Pan, W. Chu, J. M. Saragih, and F. De la Torre, “Fast and robust circular object detection with probabilistic pairwise voting,” IEEE Signal Process. Lett. 18, 639–642 (2012). 10. L. Xu, E. Oja, and P. Kultanen, “A new curve detection method: randomized Hough transform,” Pattern Recogn. Lett. 11, 331– 338 (1990). 11. T. C. Chen and K. Chung, “An efficient randomized algorithm for detecting circles,” Comput. Vis. Image Underst. 83, 172–191 (2001).

2602

J. Opt. Soc. Am. A / Vol. 31, No. 12 / December 2014

12. K. Chung and Y. Huang, “Speed up the computation of randomized algorithms for detecting lines, circles, and ellipses using novel tuning-and-LUT-based voting platform,” Appl. Math. Comput. 190, 132–149 (2007). 13. M. Ceccarelli, A. Petrosino, and G. Laccetti, “Circle detection based on orientation matching,” in the 11th International Conference on Image Analysis and Processing Proceedings (IEEE 2001), pp. 119–124. 14. A. Rad, K. Faez, and N. Qaragozlou, “Fast circle detection using gradient pair vectors,” in Proceedings of 7th Digital Image Computing: Techniques and Applications (CSIRO, 2003), pp. 10–12. 15. R. Dave, “Fuzzy shell-clustering and applications to circle detection in digital images,” Int. J. Gen. Syst. 16, 343–355 (1990). 16. R. Dave, “Generalized fuzzy c-shells clustering and detection of circular and elliptical boundaries,” Pattern Recogn. 25, 713–721 (1992). 17. J. Bezdek and R. Hathaway, “Numerical convergence and interpretation of the fuzzy c-shells clustering algorithm,” IEEE Trans. Neural Netw. 3, 787–793 (1992). 18. R. Krishnapuram, O. Nasraoui, and H. Frigui, “The fuzzy C spherical shells algorithm: a new approach,” IEEE Trans. Neural Netw. 3, 663–671 (1992). 19. G. Schuster and A. Katsaggelos, “Robust circle detection using a weighted MSE estimator,” in International Conference on Image Processing (ICIP) (IEEE, 2004), pp. 2111–2114. 20. J. Yao, “Fast robust genetic algorithm based ellipse detection,” in 17th International Conference on Pattern Recognition (IEEE, 2004), Vol. 2, pp. 859–862. 21. V. Ayala-Ramirez, C. H. Garcia-Capulin, A. Perez-Garcia, and R. E. Sanchez-Yanez, “Circle detection on images using genetic algorithm,” Pattern Recogn. Lett. 27, 652–657 (2006). 22. S. Dasgupta, S. Das, A. Biswas, and A. Abraham, “Automatic circle detection on digital images using an adaptive bacterial foraging algorithm,” Soft Comput. 14, 1151–1164 (2009).

K. Chen and J. Wu 23. B. Lamiroy, and Y. Guebbas. “Robust and precise circular arc detection,” in Graphics Recognition, Achievements, Challenges, and Evolution, Vol. 6020 of Lecture Notes in Computer Science (Springer, 2010), pp. 49–60. 24. H. Al-Khaffaf, A. Talib, and M. Osman, “Final report of GREC’11 Arc Segmentation Contest: performance evaluation on multi-resolution scanned documents,” in Graphics Recognition: New Trends, Challenges, Vol. 7423 of Lecture Notes in Computer Science (Springer, 2013), pp. 187–197. 25. J. Wu, K. Chen, and X. Gao, “Fast and accurate circle detection using gradient-direction-based segmentation,” J. Opt. Soc. Am. A 30, 1184–1192 (2013). 26. J. Canny, “A computational approach to edge detection,” IEEE Trans. Pattern Anal. Mach. Intell. PAMI-8, 679–698 (1986). 27. J. Hartigan and M. Wang, “A K-means clustering algorithm,” Appl. statist. 28, 100–108 (1979). 28. W. Gander, G. Golub, and R. Strebel, “Least-squares fitting of circles and ellipses,” BIT 34, 558–578 (1994). 29. I. Kasa, “A circle fitting procedure and its error analysis,” IEEE Trans. Instrum. Meas. IM-25, 8–14 (1976). 30. C. van Rijsbergen, Information Retrieval (Butterworths, 1979). 31. D. Powers, “Evaluation: from precision, recall and F-measure to ROC, informedness, markedness & correlation,” J. Mach. Learn. Technol. 2, 37–63 (2011). 32. W. Y. Liu and D. Dori, “Incremental arc segmentation algorithm and its evaluation,” IEEE Trans. Pattern Anal. Mach. Intell. 20, 424–431 (1998). 33. “GREC 2011 Arc Segmentation Contest,” http://www.cs.usm.my/ arcseg2011. 34. W. Y. Liu and D. Dori, “A protocol for performance evaluation of line detection algorithms,” Mach. Vision Appl. 9, 240–250 (1997). 35. http://www.cs.cityu.edu.hk/~liuwy/ArcContest/ArcContest2005 .zip.

One-dimensional voting scheme for circle and arc detection.

Circle detection is an important issue that has not been perfectly solved in automated image analysis to date. It is traditionally carried out via pix...
910KB Sizes 1 Downloads 11 Views