A clutter-calibrated Hough transform for the estimation of directional structure and dominant directions in grey-level images

Increasing amounts of image data are being routinely collected as part of the big-data revolution, with applications as diverse as automated security surveillance and dynamic medical imaging. To make best use of the data, the analyses must be automatic and rapid. Simple image properties can be used to highlight speciﬁc features in an initial screening or form input to elaborate classiﬁcation techniques. A key stage in any image analysis is the identiﬁcation of structure amongst the noise. It is important to realise that noise can be localized, independent and random, or it could contain small-scale structure which, in some ways, resembles the important features—this is called clutter. This paper uses the concept of the Hough transform to convert grey-level images into a more useful feature space representation. This space is searched for high density regions to identify dominant structure whilst taking into account micro-line clutter. Further, a directional distribution is introduced and a resulting dominant direct is proposed as a single structural summary. Many examples of simulated and real data images are used to illustrate the proposed techniques.


Introduction
The Hough transform, first introduced by Paul Hough in 1962, is a method for extracting features of a particular shape from an image.The original Hough transform is most commonly used for the detection of curves, such as lines, circles and ellipses, in a black and white image where the transform can be regarded as an edge linker grouping pixels together even though they may not be spatially close.The main idea of the method is to transform a spatially-extended pattern into a concentrated region in a feature space, that is a problem of detecting a global feature in the image space is then converted into a local problem in the feature space.A more detailed introduction to the Hough transform can be found in [1] [2], [3] and [4] who place a particular group of Hough transforms in the framework of importance sampling.Variations on the original Hough transform have been proposed for different situations.For example, Shen and Wang [5] introduced a new algorithm to detect corners and Yang and Lee [6] modify the Hough transform to detect short, thick and connected line segments by including weights.Several modified approaches, see for example [7], have been presented to alleviate the computation and storage difficulties in the standard Hough transform.Further extensions have focused on developing a Hough transform for use in grey-level images, see for example [8].There are also varied applications, for example to the detection of eyes in human faces [9], and to the location of burried objects in radar images [10].

349
The Hough transform method for line detection can be described as follows.The locations of a set of collinear points (x, y) in the image can be described by the equation f (m, c, x, y) = y − mx − c = 0 where m and c are two parameters, the slope and intercept, which characterize the line.The Hough transform technique assumes that the coordinates of the point (x, y) are known and therefore serve as constant in the parametric equation, whilst c and m are the unknown variables.This is a many-to-one mapping of the image to the parameter space, but it defines a one-to-many mapping of the parameter space to the image space.Unfortunately, this parameterization has a potential problem when m is infinite, that is when vertical lines exist in the image.To avoid this problem, [11] suggested the alternative parameterization d = x cos(θ) + y sin(θ).A way of explaining this transformation is to plot a perpendicular from the origin to the line, the angle that the perpendicular makes with the x-axis is θ and d is the length of the perpendicular.See Figure 1  The transform is implemented by partitioning the Hough parameter space into a finite number of small regions, called accumulator cells, which is equivalent to discretising the angle, θ and the distance d.As the algorithm runs, each (x, y) is transformed into the discretised (θ, d) space and the corresponding cell is incremented in the Hough accumulator.Resulting peaks in the accumulator represent strong evidence that a corresponding straight line exists in the image.The original Hough transform method can be summarized in the following steps: (i) threshold the given image to produce a binary representation, choosing the threshold to identify the desired features; (ii) discretise the parameter space into a two dimensional matrix, H (the accumulator array), with appropriate discretisation to balance resolution and robustness; (iii) define a function, such as count or sum, to summarize the points in the image space; (iv) each point in the image space is mapped to the (θ, d) space and the accumulator updated appropriately; (v) find the local maxima in the accumulator corresponding to the parameters of potentially important features; and (vi) if desired, map each maxima in the accumulator back to image space.
The original definition has limitations in that it only identifies structure which appears as high intensities-in particular above the threshold.Our modification has been made, because the standard Hough transform does not deal with negative intensities, while the features in some images can take negative values, and it avoids the need to choose a threshold.The main difference, between the standard Hough transform and the modified Hough transform, is in forming the accumulator.The standard method counts the number of pixels above a threshold, while in the modified Hough transform, the accumulator cells represent the absolute values of the summation for the intensities of the pixels, The modification is important to allow detection of curves which consist of negative, as well as positive, intensities.The comparison can be explained in the following example.Figure 2(a) shows a synthetic image containing an Xshape as a feature plus independent Gaussian noise with small variance.The standard and the modification Hough transforms are used to produce the results in Figures 2(b) and (c).Both lines are visible in the modified Hough transform as important peaks, but only one peak appears in the standard Hough transform.That is, the standard Hough transform misses the line with negative intensity.It can also be seen that the low level noise in the data has an increased influence in the Hough space making identification of important peaks challenging.

Location of peaks in Hough space
The task now is to determine the location of peaks in Hough space, which represent the lines in the image.The important peaks are extracted from noisy and cluttered images by combining smoothing, thresholding and morphological operations.Two methods for thresholding will be presented in this paper to extract dominant peaks based on: (i) percentiles of the observed accumulator value distribution, and (ii) calibration to allow sensitivity to lines of different length, then relate the threshold to a minimum line length which is of practical importance.Using either of these methods, the threshold can be obtained and then the important lines can be found from the Hough space.The basic steps to implement the method are as follows: (i) all cell entries below the threshold are removed from the Hough space; (ii) smoothing by spatial median filter which usually leaves small groups of high pixels; (iii) groups of pixels are then shrunk to single points; and (iv) mapping back from Hough space into Cartesian space yields identified lines.We shall call the isolated points principle peaks and the corresponding back-transformed lines, principle lines.Again, consider the image of an X-shaped feature, redrawn in Figure 3(a) with modified Hough transformation in Figure 3(b).To identify the peaks in the Hough space image, the first stage is a method to find a threshold.As it can be seen, in (b), the feature constituted only a few high values compare to the whole image, hence the required percentile in (c) might be taken as 98% or 99% to identify the peaks in the accumulator.Figure 3(c) shows the cumulative distribution of the Hough matrix with the 99% percentile giving a threshold of t = 0.85.The regions in Hough space, which are extracted using this threshold, are illustrated in Figure 4(a).
To reduce isolated noise in the thresholded Hough space image, the spatial median filter has been applied, which replaces each pixel by the median value from the first-order neighbourhood values.The filtered Hough space image now has several regions, each region with non-zero values surrounded by values equal to zero, as shown in Figure 4(b).The regions can be represented by their highest intensity, that is, each region will be reduced to its maximum value as shown in Figure 4(c).Then, mapping back the obtained values from the Hough space into Cartesian space yields a line description of the image as shown in Figure 4(d).The result, in this example, demonstrates that the proposed method performs successfully and efficiently.

Calibration of Hough space threshold
In the previous section, because the choice of percentile to use in the cumulative distribution is unknown, the threshold was chosen to be at an arbitrary high values.In some cases this may lead to missed important features or picking up unwanted features.The main aim in this section is to obtain the optimum threshold which can extract the features from the noise.The proposed new method is based on simulating noisy images to calibrate the approach with the threshold obtained from the Hough transform of the noisy image.The size and intensity of the noise is generated to be close to that in the real image.The data set, shown in Figure 5(a), is generated using the same noise model as was used to simulate the Xshape in Figure 3(a).The Hough space image is shown in Figure 5(b), and Figure 5(c) shows the Hough space for the original X-shape image using the same grey-scale to allow comparison.The threshold is found using the maximum value in the accumulator of the noise image.The threshold was obtained then applied to the Hough space for the original image with results shown in Figure 6(a).The speckles, that remain after the thresholding, will be smoothed by the spatial median filter and then the remaining regions are represented by their peaks as shown in  Although the results of this example are good, the assumption of independent and identically distributed noise may not be appropriate.In many imaging cases, the background in the image is not only noise, but some edge fragments may produce false lines, this is called clutter.The effect on the Hough transform from clutter was discussed by Benoudine et al. [12].In cluttered images, some peaks in Hough space result from unwanted short lines, which we call micro-lines, in the image.The micro-lines, for instance, may be due to background objects rather than part of the feature and can mislead the methods by undesirable increases in the accumulator.The purpose, therefore, is to design an approach that minimizes the problem of false detection of false objects in the image background.A simple way to deal with this problem is to produce a threshold that can remove or reduce the clutter and noise.To do so a threshold should be obtained which exceeds the peaks that are caused by the clutter.A higher threshold detects long lines, but misses short lines, whereas a low threshold detects short lines as well as long lines.
Our proposed calibration process is similar to that for pure noise, but the simulated image includes clutter, in additional to the independent noise.The clutter is simulated using lines of increasing length and pre-specified angles.The prior knowledge, of minimum length of important lines, is used to set the length of lines to use for the simulated clutter.Then, the threshold is set as a high percentile of the cumulative distribution of the corresponding Hough space.In order to evaluate the performance, three simulated images have been generated each containing 10 randomly positioned lines, shown in the left-hand column in Figure 7.The lines are simulated to be in two groups according to their directions.The simulated lines have intensity equal to 1 and the intensity of the background is 0.
The Gaussian noise of mean 0 and standard deviation 0.1 is added to the image.Using the modified Hough transform, the three simulated datasets are transformed into Hough spaces, see the central column in Figure 7. Suppose that, as prior knowledge, the line is acceptable as a feature in an image, if it is of length more than three pixels, otherwise it is regarded as clutter in the image.The right-hand column in Figure 7 shows the cumulative distribution for the three Hough spaces.The 98% of the cumulative distribution of this Hough space is used as a threshold, giving t = 0.0015, which has been applied to the Hough space.It is important to note that, the number of the observations, which are greater than the threshold, on the cumulative distribution curve of long lines is more than that for medium lines, which is more than that on the cumulative distribution curve of the smallest lines.The Hough spaces are thresholded and the spatial median filter has been used, then the prominent peaks in the results image are mapping back to Cartesian coordinates, shown in Figure 8. Due to the way that the short lines were generated, some of them lay in the same straight line.Using the maximum value in the Hough space would be too large, and hence the threshold was obtained at 98%.The use of a threshold set at 98% of the cumulative distribution has led to some unwanted short lines but works better for medium and long lines.In this example, the method can detect most of straight lines from the medium and long lines.and there is some duplication where many line fragments are nearly collinear.

The directional distribution and scale-space threshold tree
If the distance in the Hough space is not of interest, that is the main objective is to describe the direction of the features in the image, the Hough space is collapsed over the distance.Rather than looking at the true marginal distribution, however, the maximum observation corresponding to each angle in the Hough space is taken and then divided by the sum of the maximum values.The directional distribution exhibits principle modes which define the dominant directions.Note that the number of modes in the directional distribution does not represent the number of lines in the image but the number of dominant directions in the image.
Recall the X-shaped dataset in Figure (3).The data were simulated with two dominant directions, these are −π/4 = −0.785and π/4 = 0.785.The directional distribution, obtained from the Hough space, in Figure 9(a) shows a bimodal shape.The two modes are caused by the two dominant directions in the data.Due to noise and artifacts in the Hough space, however, some small modes arise.These minor modes, which are unimportant, can be removed, or reduced, by smoothing, such as smoothing splines.However incorrectly chosen smoothing parameters may lead to over smoothing or under smoothing.
Using the optimal smoothing parameter, see the result in Figure 9(b), it is easy to identify and isolate the principle peaks in the directional distribution.Choosing a large smoothing parameter leads to over smoothing, which means a very smooth appearance missing important details, for example as in Figure 9(c).
To avoid over and under smoothing in the directional distribution, the scale space method, see for example [13], can be used to automatically choose an optimal smoothing parameter and to detect the number of peaks in the data.To achieve a selective smoothing that removes noise while preserving the dominant direction peaks in the directional distribution, the scale space method is applied rather than cross validation.This is because the crossvalidation method is not designed to find the number of groups, but to best estimate the full distribution.However, the scale-space method provides the number of thresholds that splits the directional distribution into groups, each group representing a dominant direction.
To reduce edge effects, that may occur at the ends of the directional distribution, the data is repeated.The periodic data is smoothed with a range of smoothing parameters, including those extreme cases of under smoothing and over smoothing.Then the best smoothing level is regarded as the median of the values in the range of smoothing parameter that makes the most persistent number of modes.That is with the longest twigs in the threshold tree.The best representation of the smoothed curve is plotted in Figure 10(a) with dashed vertical lines to split the different dominant directions.These correspond to peaks in the smoothed curve, and are equal to -0.77 and 0.77.The threshold tree is in Figure 10(b), with dashed lines to show the ends of the longest twigs in the tree.In this example, the smoothed curve yields dominant directions closer to the true directions of the feature than the standard default smoothing.In addition, however, the scale-space tree also gives a multi-scale summary which can be used for a deeper understanding of structure in the data image.
The two dominant directions, in the simulated micro-lines, were −π/5 = −0.628and π/4 = 0.785.The directional distribution of the medium length micro-lines is obtained but is a very rough curve, as plotted in Figure 11(a), and it is not easy to identify the number of dominant directions.To appropriately smooth the directional distribution, the optimal smoothing parameter has been found using the scale-space method, the threshold tree is presented in Figure 11(b) and the optimal smoothing curve is displayed in Figure 11(c).The dominant directions, in the smoothed curve, are now easily detected and they are -0.54 and 0.85. Figure 11(d) shows the directional distribution of long lines, the two peaks corresponding to the dominant directions are -0.61 and 0.74.Using the scale-space method the optimal smoothing is chosen for the directional distributions resulting in the bimodal curve, in Figure 11(f).The smoothed curve has peaks at -0.61 and 0.79 which represent the dominant directions.Because the data were simulated, the number of dominant directions is known, and it has been identified easily and correctly from the smoothed curve.In both cases, medium and long lines, the smoothed curves were more helpful in detecting the dominant direction than the unsmoothed directional distributions.

Application to real texture data
Three different textures have been taken from the internet † .The three textures are plotted in the left-hand column in Figure 12, and are paving (128 × 128 pixels), zebra (503 × 484) and mesh net (92 × 64) respectively.Each texture image consists of curves that represent the feature.To detect the major features in the texture, the Hough transform method was applied as described.The middle column in Figure 12 presents the Hough space corresponding to each textured image and mapping back the important pixels in the Hough transform space into Cartesian space is plotted in the right column.In this example, the features in the paving image were described well using the method and in particular, a very good representation has been obtained for the pattern in zebra skin data.The final image is mesh netting, but because none of the lines are particularly straight and there is variation of directions, the method does not give as good results as in the other datasets.
Results for the directional distribution and dominant direction are shown in Figure 13.The left-hand column presents the directional distributions of paving, zebra and mesh respectively.The threshold trees are plotted in the dominant directions in the mesh is two which can easily be extracted from the smoothed directional distribution at −1.25 and 0.22.

Summary and discussion
A modified Hough transform has been proposed and works well when images contain both negative or positive intensities.Also, a combination of thresholding and smoothing is included to identify important points in Hough space which are back-transformed to reconstruct corresponding line features in image space.Further, a novel approach to the identification of dominant directions based on a scale-space tree is proposed.All methods have been tested on simulated data and then applied successfully to real data images.
The proposed techniques have wide-spread applications in many areas of image processing and image analysis which involve the identification of linear features and dominant directions.Such current applications include security surveillance, for example X-rays of airport user luggage or automatic tracking of vehicles in street-scenes -testing of our proposed techniques in similar situations can form useful further work.We believe that our methods can form a useful building block for other researchers and have the potential to become part of the standard toolbox of users of image analysis techniques.

Figure 1 .
Figure 1.Diagram of the transform and the Hough space.

Figure 2 .
Figure 2. Standard and modified Hough transforms applied to a simulated image.

Figure 5 .Figure 6 .
Figure 5. Threshold calibration using pure noise: (a) simulated noisy image; (b) Hough space for noise image; (c) Hough space for original image.

Figure 6 (
Figure 6(b).Finally the peaks are mapping back to Cartesian space.The simple structure of the feature in the image is reconstructed correctly by the method.Although the results of this example are good, the assumption of independent and identically distributed noise may not be appropriate.In many imaging cases, the background in the image is not only noise, but some edge fragments may produce false lines, this is called clutter.The effect on the Hough transform from clutter was discussed by Benoudine et al.[12].In cluttered images, some peaks in Hough space result from unwanted short lines, which we call micro-lines, in the image.The micro-lines, for instance, may be due to background objects rather than part of the feature and can mislead the methods by undesirable increases in the accumulator.The purpose, therefore, is to design an approach that minimizes the problem of false detection of false objects in the image background.A simple way to deal with this problem is to produce a threshold that can remove or reduce the clutter and noise.To do so a threshold should be obtained which exceeds the peaks that are caused by the clutter.A higher threshold detects long lines, but misses short lines, whereas a low threshold detects short lines as well as long lines.Our proposed calibration process is similar to that for pure noise, but the simulated image includes clutter, in additional to the independent noise.The clutter is simulated using lines of increasing length and pre-specified angles.The prior knowledge, of minimum length of important lines, is used to set the length of lines to use for the simulated clutter.Then, the threshold is set as a high percentile of the cumulative distribution of the corresponding

Figure 7 .
Figure 7. Clutter analysis using, short lines (top row), medium lines (middle row) and long lines (bottom row), each with simulated data, modified Hough space and corresponding cummulative distribution.
Figure 8. Back-transformed principle lines for, (a) short lines; (b) medium lines (c) long lines.

Figure 10 .
Figure 10.Scale space tree for threshold choice: (a) the smoothed directional distribution; (b) the scale-space tree for the X-shaped feature.

Figure 11 .
Figure 11.The first row: directional distribution, scale-space tree and smoothed directional distribution for medium lines; the second row: directional distribution, scale-space tree and smoothed directional distribution for long lines.

Figure 12 .
Figure 12.Left column: texture images; Middle column: Hough spaces; Right column: Reconstruction of principle lines corresponding to paving (top row), zebra skin (middle row) and mesh net (bottom row).