Research on Contour Feature Extraction Algorithms for Arc-shaped Groove of Safety Seat Base

The spatial position of the seat base is complicated. The contour structure of arc groove is complex and its contour feature extraction is difficult. Aiming at the above problems, this paper presents an improved corner detection algorithm based on Curvature Scale Space (CSS), which uses adaptive local curvature and dynamic angle threshold to accurately extract corner points of arc groove contour. The correct corner positioning error of the algorithm proposed in this paper is only 0.99 pixel. The experimental results show that this method can effectively implement contour feature extraction.


Introduction
In recent years, children's car safety has attracted more and more attention. The child safety seat market is booming, and the quality problem is becoming ever more serious. The appearance of the safety seat is mostly irregular curved surface. The assembly mainly depends on the waist groove above the base and the arc groove below to work together with the bottom cover. Since the seat base is made of plastic and the arc of an arc groove curve grows, warping deformation is easy to occur in injection molding, and the unqualified rate of the product reaches 12~15%. Due to the deformation of the arc groove, the phenomenon of illegal assembly in the assembly process of safety seats often occurs. Depending on statistics, the number of parts that fail to assemble accounts for about 20% of the total number of products. The contour structure of the arc groove of safety seats is complex. At present, most enterprises use human eye observation to detect whether the arc groove has defects. This method has high labor intensity, low accuracy and efficiency, and high cost. Machine vision detection is a very suitable improvement method. Therefore, it is of great significance to study the contour extraction algorithm of arc groove on the seat base.
The edge can be detected by finding the local maximum of the first order differential or the zero intersection of the second order differential. Common first order differential operators are Robberts, Prewitt, Sobel [1]. Commonly used second order differential operators are Laplacian [2] and LoG. Canny edge detection operator with superior performance was proposed by Canny in 1986 [3]. In order to assist the extraction of arc-shaped groove parameters, corner detection of arc-shaped groove contour is required. Corner detection method based on contour mainly includes Harris [4], multiresolution Harris [5], SUSUAN [6] CSS [7,8], Anisotropic Directional Derivative (ANDD) [9] and Chord-to-Point Distance Accumulation (CPDA) [10], etc. This paper presents an improved corner detection algorithm based on CSS, the feature contour is obtained through bilateral filtering and contour extraction, and the curvature maximum point is considered as the candidate corner point. Using curvature adaptive local threshold and dynamic Region of Support (ROS) angle threshold to 2 remove the rounded corners and false corners from candidate corner points, the contour corner points of arc groove are accurately extracted. Compared to the traditional manual visual measurement method, this method can realize the automatic high-precision detection of arc groove contour quality, and improve the detection efficiency and intelligence level.

Feature Extraction of Arc-Shaped Groove Contour
There are three similar grooves in the middle of arc-shaped grooves. In order to separate the grooves and arc-shaped grooves, the contour features of arc-shaped grooves are extracted by using the curvature scale space corner method. Contour feature extraction process of arc-shaped groove is shown in Figure 1.
In order to reduce noise interference, the image of the arc-shaped groove is filtered bilaterally. Spatial and range information of filtered pixels are considered in bilateral filter. On the basis of gauss filter, geometric distance weight and color distance weight are used to smooth the image, which can remove noise and protect the edge. Bilateral filter results of arc-shaped groove are shown in Figure 2. Canny edge detection is conducted for arc-shaped groove in order to obtain the full arc-shaped groove edge with a single pixel width, but it is more difficult to choose the Canny double threshold manually. The Canny algorithm is improved in this paper. By using statistical gradient histogram, the appropriate Canny threshold value is found.   The detection process of adaptive threshold Canny algorithm is as follows: (1) First, the Sobel operator is used to detect the horizontal and vertical gradients of the image and obtain the horizontal and vertical gradient images.
(2) The horizontal and vertical gradient images are used to calculate the gradient value, and then the maximum gradient value is found.
(3) The dimension of gradient histogram is set to = histsize max_ value , and then the gradient histogram in the range of   0,max_ value is counted. (4) According to the formula total = PercentOfPixelsNotEdges × height × width, the threshold value of non-edge pixel points is calculated. In this paper, the proportion of non-edge pixels in the whole image is set as 07 = PercentOfPixelsNotEdges . , and  height width is the size of the gradient image. (5) By traversing the gradient histogram, the number of pixel points corresponding to each gradient value i can be obtained. The sum of all pixel counts is sum, and when the sum satisfies sum>total, it will exit the loop.  The statistical result of histogram of Canny threshold value is shown in Figure 3, in which the high threshold value is 218 and the low threshold value is 87. According to the analysis of gradient histogram, the first sharp peak is the edge of the black background of the image, and the gray value is about 5; the second sharp peak is the edge of the arc-shaped groove, and the gray value is about 130. According to the analysis results of gray histogram, the left area of low threshold is the black background of arc-shaped groove image, while the right area of high threshold is the highlighted part of arc-shaped groove surface, and the edge of arc-shaped groove is just in the trough area between high and low threshold. As can be observed in Figure 4, the arc-shaped groove adaptive Canny edge includes arc-shaped groove contour, triangular hole, pentagonal hole and broken edge. By traversing all the contour in the Canny groove edge graph, the contour of the small connected domain can be removed by filtering the contour area, and then the feature contour can be determined by the contour circumference sorting. It can be observed in Figure 5 that the contour edge of the extracted arc-shaped groove is fractured, so it is necessary to connect the edge of the feature contour. The starting point of the edge is determined by line-by-line scanning, and the edge endpoint is found by analyzing the octet neighborhood of the edge point, and then the 4×4 neighborhood of the endpoint is connected to the edge. The processing result of the edge fracture of the arc-shaped groove is shown in Figure 6.   with corresponding scale are obtained, and then contour curvature is calculated. Based on CSS Curvature calculation formula is ( , σ).
are the convolution results of the second order differential gauss template.
CSS corner detection firstly calculates contour curvature at the gauss scale of 5  = to retain all real corner points, and selects all local maximum points of curvature as candidate corner points, among which there are rounded corner points and false corner points. The interval of two adjacent local curvature maxima points is taken as the support region, and the curvature adaptive threshold of the support region is substituted for the global threshold to eliminate the rounded corners in the candidate corner points. The calculation formula of the adaptive curvature threshold is ( ).  (2) where ̅ represents the average curvature of the neighborhood, represents the position of candidate corner points on the curve, 1 and 2 are the front and rear arm lengths of the support area, and α is the correction coefficient of curvature threshold. In this paper, the curvature threshold correction coefficient α is equivalent to 1.5. There are some false corner points among the candidate corner points calculated by curvature adaptive local threshold. The support region of candidate corner points is used to calculate the angle, and then the convergence position of corner points is obtained by iterating dynamic support region. Finally, false corner points in candidate corner points can be With the dynamic ROS iterating, corner candidate set will gradually converge, isolated corner candidates will be removed, and main corner points will be retained. If 60°≤ ∠ < 180°, ∠ is considered to be the wrong corner point, which is excluded from the candidate corner point in the next iteration.
where ( ) ( ) In the experiment, the dynamic ROS angle threshold ∠C is equal to 160°.

Analysis of Experimental Results
Harris, SUSAN, multiresolution Harris and improved CSS corner detection algorithm this paper presented were respectively used for corner detection of arc-shaped groove contour curve. The actual set of corner points of arc-shaped groove was obtained by manually marking, and the Euclidean distance between the actual corner points and the detected corner points was compared. In this paper, it is defined that the distance is less than 4 pixels as the correct corner point, otherwise it will be regarded as the wrong corner point. The number of correct corner points detected by Harris algorithm was 7, the number of wrong corner points was 2, and the number of missed corner points was 5. The number of correct corner points detected by SUSAN algorithm was 9, the number of wrong corner points was 2, and the number of missed corner points was 3. The correct corner points detected by the multiresolution Harris algorithm were 11. The wrong corner points were 3, and missed corner points were 2. The correct corner points detected by improved CSS algorithm this paper presented were 12, the wrong corner points were 0, and the missing corner points were 0. Detection results of arc-shaped groove corner points are shown in Figure 7.
In this paper, the root mean square of the distance between the correctly detected corner and the marked real corner is defined as the positioning error of the corner. The evaluation results of arc-shaped groove corner detection algorithm are shown in Table 1. Table 1 shows that the error detection rate and missed detection rate of the two improved Harris algorithms were reduced. Since multiresolution Harris detects contour corner points in different gauss scale space, the time consumed by multiresolution Harris algorithm increased greatly. Multiresolution method would lead to multiple detection results corresponding to the same corner point, and the positioning error of corner points was affected by the size of scale. Due to its missed detection rate and false detection rate were all 0, the improved CSS corner detection algorithm this paper presented had obvious advantages in processing arc-shaped groove contour compared with the three Harris algorithms.  The corner detection results could be used to segment the contour curve of arc-shaped groove accurately. The correct corner positioning error was 0.99 pixel, and the execution time of the algorithm was 1.55s, meeting the requirements of accuracy and real-time of the visual measurement of arc-shaped groove.

Conclusions
Improved CSS corner detection algorithm this paper presented has been used to extract arc-shaped groove contour, and adaptive curvature threshold and dynamic ROS angle threshold have been used to achieve accurate extraction of arc-shaped groove CSS corner. The experimental results have showed that, compared with other existing corner methods, the missed detection rate and error detection rate of arc-shaped groove corners extracted by this method were 0, the correct corner positioning error was 0.99pixel, and the execution time of the algorithm was 1.55s, which was obviously better than other corner algorithms.