# Research on Feature Identification and Trajectory Planning of Pavement Cracks
## 3 Intelligent pavement Crack Detection and Repair Algorithm
### Canny Marginalization and Hough Space Transformation  
In the image filtering stage, for the high-density noise wide crack type image and the low-density noise narrow crack type image collected by the system camera, the algorithm adopts corresponding feature extraction policies, respectively, and obtains a binarized image containing only crack features. In order to further fit the crack to obtain the coordinate points of the repair trajectory, the algorithm uses the Canny edge detection algorithm to extract the edge of the binarized image, and adopts the polar coordinate Hough space transformation method to perform the Hough straight lines fitting on the feature lines of the edged crack image. The Hough space transformation, as a very important method for detecting the shape of discontinuous point boundaries, transforms the image coordinate space into the parameter space, and realizes the fitting of straight lines and curves. The algorithm in this paper adopts the generalized polar coordinate Hough space transformation [19], and the algorithm flow is as follows:  
1. The algorithm uses the normal form to represent each line in the image coordinate space: \(r=xcos\theta+ysin\theta\), where \(r\) represents the distance from the origin of the coordinate system to the straight line, and \(\theta\) represents the angle formed by the coordinate point and the x-axis. Therefore, in Hough space, any straight line can be represented by a \((r,\theta)\) parameter pair and points on the same line have the same \((r,\theta)\) parameter pair. If many feature points in a parameter space hold the same \((r,\theta)\) parameter pair, it means that in the Cartesian coordinate system the corresponding number of feature points in are collinear. After this step, each line in the binarized image is represented in the form \((r,\theta)\). 2. For each coordinate point in the parameter space, the algorithm counts the corresponding \((r,\theta)\) parameter pair in the Hough space, then we could establish an array which contains the count values of all \((r,\theta)\) parameter pairs. 3. The algorithm uses a voting mechanism to traverse the \((r,\theta)\) parameter pairs corresponding to all feature points with non-zero pixel values in the image matrix, and vote for the model parameters. When there are feature points with the same \((r,\theta)\), the corresponding parameter pair is increased by one vote. After the execution of this step, we can obtain the global statistics of the parameter pairs, so that the parameter pairs with high statistical times can be set as the contour lines recognized by the Hough space algorithm. 4. An appropriate threshold is set according to the size of the pixel matrix and the \((r,\theta)\) parameter pair with a high number of votes is retained, and the corresponding straight line constitute the Hough space fitting line set of the image. Figure 10: Narrow crack filtering results. The Hough space transformation uses the global characteristics of the image to connect the edge pixels and form a closed boundary of the region. While directly performing Hough space line fitting on the binarized crack feature image will introduce a lot of unnecessary redundant calculations. In order to achieve the best fitting effect, the algorithm introduces the Canny edge detection algorithm to marginalize the crack feature image in the early stage of Hough line fitting. The Canny edge detection algorithm is a multi-level edge detection algorithm, which smooths the image through Gaussian filtering, calculates the image intensity gradient, performs non-maximum suppression of the gradient amplitude and double threshold processing to achieve the optimal edge detection of the image [20]. Since in the image filtering stage, the algorithm has performed filtering operations according to different types of crack feature images, the Canny operator introduced in the algorithm would only include the operation of calculating image gradient and non-maximum suppression.