Elsevier

Pattern Recognition Letters

Volume 27, Issue 6, 15 April 2006, Pages 578-586
Pattern Recognition Letters

Mean shift based clustering of Hough domain for fast line segment detection

https://doi.org/10.1016/j.patrec.2005.09.023Get rights and content

Abstract

This paper proposes a new algorithm for extracting line segments from edge images. Basically, the method performs two consecutive stages. In the first stage, the algorithm follows a line segment random window randomized Hough transform (RWRHT) based approach. This approach provides a mechanism for finding more favorable line segments from a global point of view. In our case, the RWRHT based approach is used to actualise an accurate Hough parameter space. In the second stage, items of this parameter space are unsupervisedly clustered in a set of classes using a variable bandwidth mean shift algorithm. Cluster modes provided by this algorithm constitute a set of base lines. Thus, clustering process allows using accurate Hough parameters and, however, detecting only one line when pixels along it are not exactly collinear. Edge pixels lying on the lines grouped to generate each base line are projected onto this base line. A fast and purely local grouping algorithm is employed to merge points along each base line into line segments. We have performed several experiments to compare the performance of our method with that of other methods. Experimental results show that the performance of the proposed method is very high in terms of line segment detection ability and execution time.

Introduction

The detection of linear structures in images is an important task in computer vision because they are frequently used as an input to higher-level processes such as stereo matching or object recognition. Over decades, many models have been reported in literature to detect line segments. These models can be broadly classified into three main categories: Hough transform (HT) based approaches (Ji and Xie, 2003), gradient based approaches (Nelson, 1994) and line segment grouping approaches (Boldt et al., 1989, Nacken, 1993).

The HT and its extensions constitute a robust method for extracting line segments. Basically, the principal concept of the standard HT is to define a mapping between an image space and a parameter space. Each feature point in an image is mapped to the parameter space to vote for the parameters whose associated lines pass through the data points. The votes for each line are accumulated, and after all the points have been considered, local maxima in the accumulator correspond to the parameters of the detected lines (Ji and Xie, 2003). Despite the fact that the HT endures noise and discontinuities in an image, it has some inherent limitations such as high computing time and unwieldy memory requirement. Besides, HT based approaches can fail when pixels constituting a long segment are not exactly collinear. To solve these problems, a coarse quantization of parameter space is normally performed (Jang and Hong, 2002), but it causes inaccurate detection of lines. Section 2.1 describes several extensions to the standard HT which have been proposed to alleviate these problems. In the gradient based approaches, gradient magnitude and orientation of each image pixel are explored for the purpose of detecting line segments. The principle of these approaches is to use the gradient direction to split the image into a set of support regions. However, these approaches fail to identify even linear edges sometimes, if they happen to be parts of curve segments (Guru et al., 2004). Instead of looking at edge images, the line segment grouping approaches looks at images containing a number of short line segments, such as the output of an edge detection and line segment fitting algorithm. Adjacent line segments are grouped according to some grouping criteria and replaced by a new line segment. This process is repeated until no new line segment occurs. The main disadvantage of these approaches is that its process is generally purely local and, therefore, the globally optimal grouping is not guaranteed. To overcome this problem, Jang and Hong (2002) proposed a grouping approach that incorporate the concept of line detection by voting from HT based models. Finally, there are other models that cannot be easily classify into these three groups. Thus, Mansouri et al. (1987) proposed a hypothesize-and-test algorithm to extract line segments of specified lengths by hypothesizing their existence by the use of local information. This method could be classified as a statistical based approach.

In this paper, we propose a new algorithm for extracting line segments from edge images. The proposed method performs two consecutive stages. In the first stage, the algorithm follows a line segment randomized HT (RHT) based approach. The RHT method is based on the fact that a single parameter item can be determined uniquely with a pair of edge points. Such point pairs are selected randomly, the parameter point is solved from the line equation and the corresponding cell is accumulated in the accumulator space. This random selecting is called random sampling. The RHT is iteratively run to detect global maxima by thresholding the accumulator space. When a line is detected, it is removed from the edge image and the algorithm starts again with the remaining edge pixels. Despite the merits of the RHT, it suffers from some problems mainly due to random variations (Kälviäinen et al., 1995). In our case, a variant of the RHT (the random window RHT, RWRHT (Kälviäinen et al., 1995) is employed to select an initial set of items of the parameter space. In the second stage, these items are clustered by using a mean shift based clustering algorithm (Comaniciu and Meer, 2002). The efficacy of mean shift analysis has been demonstrated in computer vision problems such as tracking and segmentation (Comaniciu and Meer, 2002). To avoid the specification of a scale parameter (the global bandwidth of the mean shift procedure), we employ the variable bandwidth mean shift algorithm (VBMS) proposed by Comaniciu et al. (2001). This clustering stage permits the algorithm to avoid the global maxima detection. Therefore, our implementation of the RWRHT algorithm run faster than the current one because it will be used without accumulator actualisation and thresholding. Cluster modes are used to extract a set of base lines from the edge image. Finally, edge pixels belonging to lines that have been clustered together are projected onto the base line that they generate. The projections of these points onto each base line are grouped into line segments by using a fast and purely local merging procedure.

This work is related to a previous work of Walsh and Raftery (2002). In that paper, a simple clustering procedure is employed to avoid the peak detection by thresholding. Basically, they threshold the sampled parameters. Then, they place each parameter in a cell of an accumulator space and run a connected component algorithm on the nonempty cells in the array. The parameters contained in the cells associated with a particular connected component are assumed to be associated with one curve in the image. The main disadvantage of this method is that it conserves a thresholding procedure, whose importance is great because it determines the set of occupied cells in the parameter space. If the threshold value is too low, this clustering algorithm can merge two different lines into a single one. If it is too high, the algorithm can lose short lines. Besides, the cell size must be appropriately chosen for the curves to be detected accurately (Walsh and Raftery, 2002). As it is commented in (Jang and Hong, 2002), a coarse quantization of the parameter space usually causes inaccurate detection of lines.

This paper is organized as follows. Section 2 describes previous work related to the two stages of the proposed method. Section 3 presents the proposed method. The experimental results revealing the efficacy of the proposed method are presented in Section 4. The results of the comparative study of the proposed method with other methods are given in Section 5. The paper concludes along with discussions and future works in Section 6.

Section snippets

HT based approach to line segment detection

Works in line segment detection using the HT focuses on improving its two main drawbacks: its high consuming of time and memory and the selection of an optimal and efficient resolution of the parameter space. The extensions of the standard HT can be categorized as nonprobabilistic and probabilistic approaches. For the nonprobabilistic HT, every image pixel is employed to obtain the line parameters. To reduce computational time, Gerig and Klein (1986) proposed a backmapping which links the image

Proposed method

The proposed method of line segments detection has two stages. Firstly, an edge image is obtained by employing a suitable edge detector on a gray-scale image. This edge image is used as input of a RWRHT based approach, the output image of which is a set of Hough parameters. Then, these items are clustered by a variable bandwidth mean shift algorithm. Cluster modes are selected as the set of base lines. Projections of the edge points onto the corresponding base line are grouped to obtain the

Experimental results

This section shows the results of several tests conducted to reveal the performance of the proposed algorithm. The method has been implemented in C++ Language on a Pentium II 266 MHz PC. Experiments on real images have been conducted. The presented benchmark images have been chosen from various research papers. Fig. 4(a)–(c) show three benchmark real images (Galambos et al., 1999, Jang and Hong, 2002). The Canny edge detector (Canny, 1986) has been used to obtain an edge image, since most of the

A comparative study

The proposed method has been compared to several line segment detection methods to test its performance. Particularly, we chose for the purpose of comparison the methods proposed by Nacken, 1993, Jang and Hong, 2002, Yuen et al., 1993. In order to compare the performance of the different methods, four sets of edge images have been created (Jang and Hong, 2002). The size of test images is 256 × 256 pixels and each image contains 13 true line segments with a random length of 40–200 pixels (Fig. 5).

Conclusions

This paper proposes a new method for finding line segments in edge images. The method overcomes the drawbacks of the global nature of a conventional HT based approach while retaining most of its advantages. The clustering process of the HT parameter items permits to obtain high accuracy line detection with a reduced computational time. Experimental results show that the proposed method is fast and possesses a good line segment detection ability compared to other approaches.

References (31)

  • D. Ben-Tzvi et al.

    A combinatorial Hough transform

    Pattern Recognition Lett.

    (1990)
  • M. Boldt et al.

    Token-based extraction of straight lines

    IEEE Trans. Sys. Man Cybernet

    (1989)
  • J.F. Canny

    A computational approach to edge detection

    IEEE Trans. Pattern Anal. Machine Intell.

    (1986)
  • D. Comaniciu et al.

    Mean shift: a robust approach toward feature space analysis

    IEEE Trans. Pattern Anal. Machine Intell.

    (2002)
  • Comaniciu, D., Ramesh, V., Meer, P., 2001. The variable bandwidth mean shift and data-driven scale detection. In: IEEE...
  • Costa, L.F., Ben-Tzvi, D., Sandler, M., 1990. Performance improvements to the Hough transform. In: IEE Conf....
  • M.A. Fischler et al.

    Parallel guessing: a strategy for high-speed computation

    Pattern Recognition

    (1987)
  • Galambos, C., Matas, J., Kittler, J., 1999. Progressive probabilistic Hough transform for line detection. In: IEEE Int....
  • Georgescu, B., Shimshoni, I., Meer, P., 2003. Mean shift based clustering in high dimensions: a texture classification...
  • Gerig, G., Klein, F., 1986. Fast contour identification through efficient Hough transform and simplified interpretation...
  • D.S. Guru et al.

    A simple and robust line detection algorithm based on small eigenvalue analysis

    Pattern Recognition Lett.

    (2004)
  • M. Herbin et al.

    A clustering method based on the estimation of the probability density function and on the skeleton by influence zones

    Pattern Recognition Lett.

    (1996)
  • A.K. Jain et al.

    Algorithms for Clustering Data

    (1988)
  • J. Jang et al.

    Fast line segment grouping method for finding globally more favorable line segments

    Pattern Recognition

    (2002)
  • Q. Ji et al.

    Randomised Hough transform with error propagation for line and circle detection

    Pattern Anal. Appl.

    (2003)
  • Cited by (46)

    • Image-based onsite object recognition for automatic crane lifting tasks

      2021, Automation in Construction
      Citation Excerpt :

      However, these methods are insufficiently robust in practice due to the unavoidable effect of a changing environment on feature extraction during lifting progress, such as the effect of light on texture/color extraction. In addition, most feature-extraction algorithms (e.g., Canny operator [67,68] and Hough detection [69]) are not adjustable with fixed thresholds, making them unsuitable for complicated construction environment. Considering these limitations, a non-feature-based method is presented, which directly compares the 2D data representation (the “spin-image” [33,70]) of a search object to that of its model.

    • Incremental circle hough transform: An improved method for circle detection

      2017, Optik
      Citation Excerpt :

      A third type of method uses the probabilistic interpretation of the Hough approach [17,26]. Other type of method uses the randomized selection of edge points, the geometrical properties of the circle [1,4,22], and the edge orientation information of each edge pixel to reduce the computing time or the requirement of the accumulator [3]. And finally the type of method proposes a variety of voting scheme used in the Hough transform [28,9].

    • Mode seeking on graphs for geometric model fitting via preference analysis

      2016, Pattern Recognition Letters
      Citation Excerpt :

      However, most of them are very sensitive to unbalanced data (i.e., the numbers of inliers belonging to different model instances in data are significantly different), which are quite common in practical applications. Mode-seeking is a simple and powerful data analysis technique, and it has been widely applied to clustering and filtering, e.g., [1,5,7,17,24,25,28]. For example, mean-shift [7] and medoid-shifts [24] are two popular nonparametric mode-seeking methods.

    • EVOLIN Benchmark: Evaluation of Line Detection and Association

      2023, IEEE International Conference on Intelligent Robots and Systems
    View all citing articles on Scopus

    This work has been partially granted by Spanish Ministerio de Educación y Ciencia (MEC) project no. TIN2004-05961.

    View full text