A comprehensive detection method for rail clip fastener defects based on image and point cloud fusion

By fusing RGB depth images and three-dimensional point cloud data, deep learning and density clustering methods are used to detect appearance defects and tightness of rail elastic fasteners, solving the problem of difficulty in comprehensive detection in the existing technology and achieving fast and accurate detection. Fastener inspection reduces inspection costs.

CN117830199BActive Publication Date: 2024-10-18NANCHANG INST OF TECH
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202310400655.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-14
Publication Date
2024-10-18
Estimated Expiration
2043-04-14

AI Technical Summary

Technical Problem

Existing technology is difficult to fully integrate two-dimensional depth images and three-dimensional point cloud data to fully detect the appearance and tightness of track elastic fasteners, and cannot quickly detect appearance defects and tightness defects of fasteners at the same time.

Method used

By acquiring the RGB depth image and 3D point cloud data of the track, the deep learning target detection model is used to detect appearance defects, segment the 3D point cloud of the fastener with normal appearance, extract the skeleton points in the middle area of ​​the spring bar, fit the insulating pad plane, and calculate The distance from the lowest point to the flat surface is used to determine the tightness of the fastener.

Benefits of technology

It achieves fast, accurate and comprehensive detection of fasteners, improves detection efficiency and accuracy, reduces detection hardware costs, and improves track maintenance efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117830199B_ABST
    Figure CN117830199B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for comprehensive detection of rail spring clip fastener defects by fusing images and point clouds, which relates to the technical field of machine vision defect detection and big data processing. The method comprises: obtaining a three-dimensional point cloud of a track containing spring clip fasteners and a corresponding RGB depth image; detecting fasteners with appearance defects and fasteners with normal appearance from the RGB depth image; segmenting the three-dimensional point cloud of fasteners with normal appearance according to the mapping relationship between the RGB depth image and the three-dimensional point cloud, and segmenting the three-dimensional point cloud data of spring clips and three-dimensional point cloud data of insulating pads from the point cloud of fasteners with normal appearance; extracting the skeleton point and the lowest point of the middle area of ​​the spring clip from the point cloud data of the spring clip, calculating the distance from the lowest point to the plane where the insulating pad is located, and judging the loose, tight and normal state of fasteners with normal appearance by the distance. The present invention can quickly and comprehensively detect fastener defects by fusing two-dimensional images with three-dimensional point clouds, and can also reduce the cost of track detection hardware and improve track maintenance efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of machine vision defect detection and big data processing, and in particular to a rail spring clip fastener comprehensive defect detection method by integrating images and point clouds. Background Art

[0002] According to the track design specifications, the types of fasteners used on railways are mainly Vossloh-300, WJ-7, and WJ-8 spring clip fasteners. The functional failure of spring clip fasteners can be divided into two categories: one is appearance defects, such as spring clip loss, misalignment, breakage, and complete loss of fasteners; the other is fastener tightness defects. The functional failure of fasteners can affect the comfort of the ride at the least, or even cause rail deviation and train derailment at the worst. Therefore, it is necessary to monitor the status of track fasteners and detect failed fasteners in a timely manner to ensure safe railway transportation.

[0003] At present, each maintenance section mainly relies on manual inspection during the "window" time to check the abnormal status of fasteners one by one through visual inspection along the line. The traditional manual visual inspection method is inefficient and subjective, and it is obviously unable to meet the application needs of my country's rapidly developing railways. In recent years, with the development of computer vision and image processing technology, visual inspection technology has been initially developed in the railway industry. By installing various cameras on the track inspection vehicle to collect track images or point cloud data, these data are analyzed and processed to achieve automatic detection of fasteners.

[0004] The defect detection technology of rail fasteners based on machine vision can be roughly divided into two-dimensional and three-dimensional visual imaging detection. Two-dimensional vision obtains two-dimensional images of the rail, and three-dimensional vision obtains three-dimensional point clouds of the rail; the appearance defects of the fasteners are obviously different from normal fasteners or loose fasteners in the image. The appearance defects of the fasteners can be quickly detected using two-dimensional images, but the looseness defects of fasteners with normal appearance cannot be detected. Three-dimensional point clouds have spatial information, but point clouds directly have no topological structure, making it difficult to distinguish their appearance defects. Although many scholars have used two-dimensional images and point clouds to detect fastener appearance defects, such as extracting features and classifying two-dimensional images to quickly detect fastener appearance defects, they cannot detect fastener tightness defects; Patents CN201310012873.X and CN202210545365.7 both use line laser sensors to scan rails to obtain three-dimensional point clouds, and the calculation speed of analyzing the point clouds alone to detect fastener tightness defects is slow. Line lasers are also used to obtain point clouds containing fasteners and construct RGB depth images, but fastener appearance defects cannot be detected.

[0005] Using a line laser sensor to scan the track to obtain point cloud data containing fasteners can detect the tightness of fasteners, and a 2D depth image with clear texture can be constructed based on the contour height. The 2D image can quickly detect the appearance defects of the fasteners. The fastener detection methods based on 2D images and 3D point clouds each have their own advantages. If the 2D image and 3D point cloud are fused, the advantages can be complementary. However, there is a lack of research on how to fully fuse the 2D depth image and 3D point cloud data to comprehensively detect defects such as the appearance and tightness of fasteners. Summary of the invention

[0006] Based on this, it is necessary to address the above technical problems: how to fully integrate two-dimensional depth images and three-dimensional point cloud data to comprehensively detect defects such as fastener appearance and tightness status, and provide a comprehensive defect detection method for rail spring clip fasteners that integrates images and point clouds.

[0007] The embodiment of the present invention provides a rail clip fastener comprehensive defect detection method based on image and point cloud fusion, which includes:

[0008] Acquire a three-dimensional point cloud of a track including spring clips and an RGB depth image corresponding to the spring clips;

[0009] Detect appearance defective fasteners and appearance normal fasteners from RGB depth images;

[0010] Using the mapping relationship between RGB depth images and 3D point clouds, the 3D point clouds of fasteners with normal appearance are segmented from the 3D point clouds of the track;

[0011] Segment the 3D point cloud of the spring bar and the 3D point cloud of the insulating spacer from the 3D point cloud of the fastener with normal appearance;

[0012] Extract skeleton points of the middle area of ​​the spring clip from the three-dimensional point cloud of the spring clip;

[0013] Determine the lowest point among the skeleton points in the middle area of ​​the spring bar; fit the plane where the insulating spacer is located according to the three-dimensional point cloud of the insulating spacer; and calculate the distance from the lowest point to the plane where the insulating spacer is located, and judge the looseness, tightness and normal state of the fastener with normal appearance by the distance.

[0014] Furthermore, the acquisition of the track three-dimensional point cloud includes:

[0015] The line laser scanning sensor is vertically mounted on the inspection vehicle, and the encoder mounted on the inspection vehicle is used to trigger the line laser sensor to dynamically scan the track profile;

[0016] Set the acquisition range of the line laser sensor in the horizontal and height directions, establish the acquisition coordinate system, and set the forward direction of the inspection vehicle as the Y direction, the vertical track direction as the X direction, and the height direction as the Z direction; set the point spacing of the line laser sensor in the X direction to be Δx, the encoder trigger spacing to be Δy, the number of point clouds in the X direction to be N, and the M lines of contours in the Y direction to form a three-dimensional point cloud image of the track;

[0017] Among them, in the track 3D point cloud image, the coordinate of the i-th point in the X direction is expressed as X i =X0+i*Δx, the Y coordinate of the jth row is expressed as Y j =Y0+j*Δy, X0 and Y0 are the starting coordinates in the X and Y directions, i=1,2,…,N-1, j=1,2,…,M-1, then the height of the point in the i-th row and j-th column is expressed as Z ij , the track 3D point cloud data is represented as (X i ,Y j ,Z ij ).

[0018] Furthermore, the acquisition of the RGB depth image includes:

[0019] Assume that the measurement range of the laser sensor is h and the point cloud height is Z ij ∈(-h / 2,h / 2), with Δh as the equal interval, divide the height into K equal parts, K = h / Δh, establish a color table, randomly select K different colors and put them into the color table, so that different height segments are represented by different colors, and the same height segments are represented by the same color. The corresponding relationship between height and color is:

[0020]

[0021] Where [·] is the rounding function, t represents the tth color in the color table, t∈[0,K-1];

[0022] Create a text file in the specified folder to store the point cloud, and create a two-dimensional empty image I with a size of N×M corresponding to the point cloud file t ;

[0023] Start the line laser sensor to scan the track containing the spring clip fastener, read each line profile of the line laser sensor, and determine the validity of the data at each point: if the current point P ij The height value is a valid value. ij Height Z ij Mapping to 2D image I t Coordinate (i, j), select the corresponding color from the color table to represent the color of point (i, j); if point P ij Height Z ij is an invalid value, then the two-dimensional image I tThe color at the coordinate (i, j) is represented by a color other than that in the color table; ij The three coordinate values ​​(X i ,Y j ,Z ij ) are saved in a line of a text file in the order of scanning. Each line in the text file represents a point cloud. The point cloud and RGB depth image constitute a dual-modal image of the scene.

[0024] Furthermore, the mapping relationship between the RGB depth image and the three-dimensional point cloud includes:

[0025] Establish the mapping relationship between point cloud and RGB dual-modal image, read the text file and convert it into a matrix, let the matrix represent Point, the size of the matrix Point is (M×N)×3; given the two-dimensional image coordinates (i, j), the mapping relationship between the three-dimensional point cloud image and the two-dimensional image is:

[0026] X i =Point[i×M+j,0]

[0027] Y i =Point[i×M+j,1].

[0028] Z ij =Point[i×M+j,2]

[0029] Furthermore, the step of segmenting the three-dimensional point cloud of the fastener with normal appearance from the three-dimensional point cloud of the track includes:

[0030] The target detection sample labels are produced for the RGB depth image. The sample labels are divided into three categories, namely, fasteners with normal appearance, fasteners with incomplete appearance, and fasteners with defective appearance. The insulating pads on the contact surface of the spring bar in the fasteners with normal appearance are marked in the fastener area. Among them, fasteners with normal appearance include normal fasteners and fasteners with loose bolts. Incomplete fasteners are fasteners with normal appearance that are stored in two consecutive files. Fasteners with defective appearance include fasteners with missing buckles, broken fasteners, buckle dislocation, and fasteners with missing bolts.

[0031] Construct a training data set based on sample labels, denoted as D t ={X t ,Y t} Among them, X t is the RGB depth image, Y t For X t The ground truth label image of the bullet-hit bar fastener;

[0032] Using the training data set D t ={X t ,Y t} Train a deep neural network to obtain a trained deep learning model for spring clip fastener detection;

[0033] The unlabeled sample dataset D v ={X v Input the trained deep learning model for spring clip fastener detection: when the fastener is predicted to have an appearance defect, directly output the detection result; when the fastener is predicted to have an incomplete appearance, splice the previous or next image of the current image to form a new image, and re-input the trained deep learning model for spring clip fastener detection for label prediction; when the fastener is predicted to have a normal appearance, output the four coordinates of the detection rectangle, and use the mapping relationship to segment the point cloud data of the fastener area.

[0034] Furthermore, the 3D point cloud of the spring bar and the 3D point cloud of the insulating spacer are segmented from the 3D point cloud of the fastener with normal appearance, including:

[0035] The 3D point cloud data of fasteners with normal appearance are used as training samples, and the point cloud of the spring bar and the point cloud of the insulating pad under the spring bar are marked for each sample;

[0036] A training sample data set is constructed based on the training samples. The sample data set is represented as PointFastener = {PC1, ...PC t}, where PC t is the i-th label sample;

[0037] The Pointnet++ network is trained using the sample label PointFastener to obtain a Pointnet++ network with stable network parameters.

[0038] The point cloud of the fastener with complete appearance to be segmented is input into the trained Pointnet++ model to segment the point cloud of the spring clip and the point cloud of the insulating pad, which are represented as PointClip = {clipP1,…,clipP n}, PointBlock={blockP1,…,blockP m}, where n and m are the number of point clouds of elastic bars and insulating spacers, respectively.

[0039] Furthermore, the step of extracting skeleton points of the middle region of the spring bar from the spring bar point cloud data includes:

[0040] The Laplace algorithm is used to refine the point cloud dataset PointClip to obtain the initial skeleton of the spring clip, which is represented by SkeletonInitial = {sP1,…,sP m}, where m is the number of skeleton points, and SkeletonInitial∈SkeletonClip;

[0041] Based on the density clustering method, the initial skeleton point cloud of the elastic clip is spatially clustered and segmented, the noise skeleton points are eliminated, and the skeleton points in the middle area of ​​the elastic clip are extracted.

[0042] Furthermore, the density clustering method is used to spatially cluster and segment the initial skeleton point cloud of the elastic clip, remove the noise skeleton points, and extract the skeleton points in the middle area of ​​the elastic clip, including:

[0043] Based on the density clustering method, the point cloud SkeletonInitial of the elastic skeleton is spatially clustered, and the discontinuous skeleton is divided into T data clusters, which are expressed as PointCluster = {Cluster1,...,Cluster T};

[0044] Determine each data cluster of PointCluster i The number of point clouds, where i = 1, ..., T, when Cluster i When the number of point clouds is small, the cluster is considered as noise data and deleted from the skeleton points to obtain the elastic skeleton containing s data clusters Skeleton = {Cluster1,...,Cluster S};

[0045] Calculate the maximum and minimum coordinates of the Skeleton point set in the X and Y directions, denoted as X min , X max , Y min , Y max ; Calculate the center plane of the skeleton point, expressed as x = X center , y=Y center , and X center =(X max -X min ) / 2,Y center =(Y max -Y min ) / 2;

[0046] Search for distance plane y=Y in the skeleton point Skeleton center The nearest point B, and determine the data cluster to which B belongs, set point B belongs to data cluster Cluster i , from Cluster i Extract skeleton points whose X coordinate is less than X center The skeleton points constitute the new dataset ClipCenterInitial.

[0047] ClipCenterInitial is used as a new data set, and the density clustering method is used to cluster the ClipCenterInitial data set to determine the number C of ClipCenterInitial data clusters. If C=1, ClipCenterInitial is the point cloud skeleton of the middle part of the elastic clip, represented by ClipCenter. If C>1, the data cluster where point B is located is selected as the skeleton of the middle part of the elastic clip.

[0048] Furthermore, the density clustering method comprises:

[0049] For any point sP∈SkeletonInitial in the three-dimensional skeleton, its mean shift vector is expressed as:

[0050]

[0051] Among them, g(x) is the Gaussian kernel function, and the bandwidth h of the i-th skeleton point is set according to the density of the sampling point cloud and the size of the elastic bar. i The value of

[0052] Select any point from the SkeletonInitial skeleton points and represent it as x;

[0053] Calculate the drift point m(sP) of point sP according to the mean shift vector formula:

[0054]

[0055] Let sP=m(sP), ||sP-m(sP)||≤ε and the iteration ends, where ε is generally set to be less than 0.1, otherwise the drift point of point sP is recalculated.

[0056] Furthermore, the determination of the loose, tight and normal state of the fastener with normal appearance includes:

[0057] Sort the data points in the skeleton ClipCenter in the middle of the elastic strip, build a neighborhood for ClipCenter based on the KD tree, search for the point with the smallest y coordinate in the data set ClipCenter, and use this point as the starting point P for sorting start , P start The nearest neighboring point is used as the next starting point to continue searching for the nearest neighboring point until all skeleton points are traversed. Each searched starting point is stored in sequence to obtain the sorted ClipCenter.

[0058] The spline interpolation method is used to fit the sorted clip middle skeleton ClipCenter to obtain the second-order continuous curve SC of ClipCenter. The first-order derivative of the curve SC is calculated, and the lowest point P in the middle of the clip skeleton is determined according to the extreme point of the first-order derivative.low ;

[0059] For the insulating block data set PointBlock = {blockP1,…,blockP m} Fitting plane, let the fitting plane be PlaneBlock, passing through point P low , draw a straight line lp, and the straight line lp is parallel to the Z direction of the coordinate system, and find the parameters of the straight line lp. Given the plane PlaneBlock and the straight line lp, find the intersection of lp and PlaneBlock, which is represented by point P cross ;

[0060] Point P cross Add it to the insulation pad data set Pointblock, and set the number of points in the Pointblock data set to K P , reconstruct the neighborhood of Pointblock based on the KD tree, and move point P cross The K neighborhood of is taken as a new data set, which is set as CrossCener, where K is set by the user; a plane is fitted to the CrossCener data set, which is represented as PlaneCenter, and the plane is the plane where the insulating pad is located;

[0061] Calculate the lowest point P in the middle of the spring clip skeleton low The distance d from the insulating block plane to the PlaneCenter can be used to determine whether the fastener is loose, tight, or in normal condition based on the size of d.

[0062] Compared with the prior art, the rail clip fastener comprehensive defect detection method based on the above-mentioned image and point cloud fusion provided by the embodiment of the present invention has the following beneficial effects:

[0063] (1) The track contour is obtained by using a line laser sensor and a clear RGB depth image and three-dimensional point cloud data are constructed to obtain dual-modal data of the track. Target detection is performed on the RGB depth image based on a deep learning target detection model to detect fasteners with appearance defects and fasteners with normal appearance. Target detection on the RGB depth image can not only directly detect fasteners with appearance defects, but also segment fasteners with normal appearance at the same time, thereby reducing the frequency of fastener detection and data processing and improving the efficiency of fastener detection.

[0064] (2) A depth image corresponding to the three-dimensional point cloud is constructed based on the contour height, and the RGB depth image coordinates of the normal-looking fastener area are mapped to the three-dimensional point cloud. The fastener area point cloud is quickly segmented, and the fastener point cloud is segmented while performing detection in the RGB depth image, thereby improving the fastener data processing efficiency and further improving the detection speed.

[0065] (3) The Pointnet++ network is used to segment the point cloud of the fastener spring bar and the direct contact surface of the spring bar, and the spring bar point cloud skeleton and the middle skeleton point of the spring bar are extracted. The middle skeleton line of the spring bar is fitted based on cubic spline, and the lowest point in the middle of the spring bar is extracted. The plane where the insulating pad is located is fitted, and the distance between the lowest point in the middle of the spring bar and the plane is calculated. The looseness, tightness and normal defects of the fastener are judged based on the distance. This method of judging the tightness of the fastener by calculating the distance between the lowest point in the middle of the spring bar and the plane where the insulating pad is located as the gap value of the spring bar is closer to the actual measurement, so the measurement result is more accurate.

[0066] In summary, the use of line laser sensors can simultaneously construct three-dimensional point clouds and two-dimensional images. By fusing two-dimensional images with three-dimensional point clouds, fastener defects can be quickly and accurately detected comprehensively. It can also reduce the cost of track detection hardware and improve track maintenance efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] Figure 1 A flow chart of a comprehensive defect detection method for rail spring clip fasteners by integrating images and point clouds provided in one embodiment;

[0068] Figure 2 A schematic diagram of a track data acquisition coordinate system provided in an embodiment;

[0069] Figure 3 RGB depth image of a rail spring clip fastener provided in an embodiment and a three-dimensional point cloud image corresponding thereto; wherein (a) is an RGB depth image, and (b) is a three-dimensional point cloud image;

[0070] Figure 4 A flowchart of fastener appearance defect detection and fastener segmentation with normal appearance based on a depth image provided in one embodiment;

[0071] Figure 5 RGB depth image appearance defect samples, appearance incomplete samples and appearance normal samples provided in an embodiment; wherein (a) is a spring bar out of position, (b) is a bolt missing, (c) is a fastener missing, (d) is a fastener with incomplete appearance, and (e) is a fastener with normal appearance;

[0072] Figure 6 A spring clip fastener structure provided in one embodiment;

[0073] Figure 7 An example of a sample label of a fastener area point cloud provided in one embodiment;

[0074] Figure 8 A fastener point cloud segmentation process based on Pointnet++ is provided in one embodiment;

[0075] Fig. 9The results of point cloud segmentation and skeleton extraction of a fastener region provided in one embodiment, wherein (a) is a point cloud of the fastener region, (b) is a point cloud of a spring bar, and (c) is a skeleton of a spring bar;

[0076] Fig.10 A process for extracting the lowest point in the middle of a spring bar skeleton provided in one embodiment;

[0077] Fig.11 A schematic diagram of the middle area of ​​a spring bar skeleton provided in one embodiment;

[0078] Fig.12 A schematic diagram of plane projection of a three-dimensional point cloud skeleton region division provided in one embodiment;

[0079] Fig.13 A flowchart for calculating the height of the spring bar from the insulating spacer provided in one embodiment. DETAILED DESCRIPTION

[0080] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0081] See also Figure 1 , an embodiment of the present invention provides a rail spring clip fastener comprehensive defect detection method based on image and point cloud fusion, the method comprising:

[0082] S1. Obtain the track 3D point cloud containing the spring clip fastener and the RGB depth image paired with it.

[0083] S2. Use the deep learning target detection model to detect fasteners with appearance defects and segment fasteners with normal appearance from RGB images. According to the mapping relationship between RGB depth images and point clouds, quickly segment the track point cloud to obtain a three-dimensional point cloud of the complete fastener area.

[0084] S3. Based on the Pointnet++ 3D point cloud deep learning model, the 3D point cloud of the fastener is semantically segmented, and the point cloud data of the spring bar and the insulating pad are segmented from the complete fastener point cloud.

[0085] S4. The elastic strip point cloud is refined to obtain the initial elastic strip skeleton. The skeleton point cloud is clustered and segmented based on the density clustering method, the noise skeleton points are removed, and the skeleton points in the middle area of ​​the elastic strip are extracted.

[0086] S5. Use the three-spline interpolation method to fit the skeleton points in the middle area of ​​the elastic bar, extract the lowest point in the middle of the elastic bar, fit the surface of the insulating pad, calculate the distance d from the lowest point to the plane where the insulating pad is located, and judge the loose, tight and normal state of the fastener based on the distance d.

[0087] Compared with other methods for detecting loose rail spring clip fasteners, the advantages of the above steps S1 to S5 are: using two-dimensional images and three-dimensional point cloud data at the same time, so that the advantages of the two types of data complement each other, using one detection technology can quickly and comprehensively detect various defects of fasteners, reduce track maintenance costs, and improve track maintenance efficiency.

[0088] Combination Figure 2-3 The implementation method of the above step S1 includes the following steps:

[0089] S11. Vertically install the line laser scanning sensor on the inspection vehicle, and use the encoder installed on the inspection vehicle to trigger the line laser sensor to dynamically scan the track profile.

[0090] S12. Set the collection range of the line laser sensor in the horizontal and height directions, establish a data collection coordinate system, set the forward direction of the inspection vehicle as the Y direction, the vertical track direction as the X direction, and the height direction as the Z direction; set the point spacing of the line laser sensor in the X direction to be Δx, the encoder trigger spacing to be Δy, the number of point clouds in the X direction to be N, and the M lines of contour in the Y direction to form a three-dimensional point cloud image of the track.

[0091] Among them, in the track 3D point cloud diagram, the coordinate of the i-th point in the X direction is expressed as X i =X0+i*Δx, the Y coordinate of the jth row is expressed as Y j =Y0+j*Δy, X0 and Y0 are the starting coordinates in the X and Y directions, i=1,2,…,N-1, j=1,2,…,M-1, then the height of the point in the i-th row and j-th column is expressed as Z ij , whose point cloud is represented as (X i ,Y j ,Z ij ).

[0092] S13, set the measurement range of the laser sensor to h, the point cloud height Z ij ∈(-h / 2,h / 2), with Δh as the equal interval, divide the height into K equal parts, K = h / Δh, establish a color table, randomly select K different colors and put them into the color table, so that different height segments are represented by different colors, and the same height segments are represented by the same color. The corresponding relationship between height and color is:

[0093]

[0094] Where [·] is the rounding function, t represents the tth color in the color table, t∈[0,K-1].

[0095] S14. Create a text file in the specified folder to store the point cloud, and create a two-dimensional empty image I with a size of N×M that is paired with the point cloud file. t .

[0096] S15, start the sensor to scan the track containing the fastener, read each line of the sensor contour, and determine the validity of the data at each point. If the current point P ij The height value is a valid value. ij Height Z ij Mapping to 2D image I t Coordinates (i, j), its color is determined by formula (1), select the corresponding color from the color table to represent the color of point (i, j), if point P ij Height Z ij is an invalid value, then the two-dimensional image I t The color at the coordinate (i, j) is represented by a color other than the color table Table; and the point P ij The three coordinate values ​​(X i ,Y j ,Z ij ) are saved in a line of a text file in the order of scanning, and each line in the text file represents a point cloud; the point cloud and RGB depth image constitute a dual-modal image of the scene.

[0097] S16. Establish the mapping relationship between point cloud and RGB dual-modal image, read the text file and convert it into a matrix, let the matrix represent Point, and the size of the matrix Point is (M×N)×3. Given the image coordinates (i, j), the mapping relationship between the three-dimensional point cloud image and the two-dimensional image

[0098]

[0099] In this implementation, the LMI Gogator 2450 line laser sensor is installed on a hand-pushed track detector for data collection. The differential encoder output of the detector triggers the line laser sensor to collect the rail bottom contour data. One line of contour is set as N point clouds, and M lines of contour constitute a set of 3D point clouds. The 3D point clouds are stored in a txt file. Each line in the txt file represents three points, which are the X, Y, and Z coordinates of the point cloud. Each line of contour points is stored in the txt file from left to right. Construct an RGB empty image of size N×M, and map each contour height to the RGB depth image. The corresponding relationship between the RGB depth image and the 3D point cloud image is shown in Figure 3 .

[0100] Combination Figures 4 to 7 The implementation method of step S2 includes the following steps:

[0101] S21. Create target detection sample labels for the RGB depth image. The sample labels are divided into three categories, namely, fasteners with normal appearance, fasteners with incomplete appearance and fasteners with defective appearance. For fasteners with normal appearance, the insulating pads on the contact surface of the elastic bar need to be marked in the fastener area. Fasteners with normal appearance include normal fasteners and fasteners with loose bolts. Incomplete fasteners are fasteners with normal appearance stored in two consecutive files. Fasteners with defective appearance include fasteners with missing buckles, broken fasteners, dislocated buckles and missing bolts.

[0102] S22. According to the sample labels, construct a training data set, represented as D t ={X t ,Y t}, where X t is the RGB depth image, Y t For X t Ground truth label image of the bullet-hit bar fastener.

[0103] S23, using the labeled sample dataset D t ={X t ,Y t}Train the deep learning object detection model to obtain a trained fastener detection model.

[0104] S24, the unlabeled sample dataset D v ={X v Input the trained deep learning model for spring clip fastener detection. When the fastener is predicted to have an appearance defect, the detection result is directly output. When the fastener is predicted to have an incomplete appearance, the previous or next image of the current image is spliced ​​to form a new image, and the trained model is re-input for label prediction. When the fastener is predicted to have a normal appearance, the four coordinates of the detection rectangle are output, and the point cloud data of the fastener area is segmented using formula (2).

[0105] In this implementation, defects such as missing fasteners, broken spring bars, misplaced spring bars and missing bolts, which are inconsistent with the appearance of normal fasteners, are marked as appearance defects with a label value of 0. Since a fastener is stored in two different images and files when the data is stored, forming an incomplete fastener, the incomplete fastener is marked as an incomplete fastener with a label value of 1. The type of fastener with complete fastener shape is marked as a fastener with a normal appearance, with a label value of 2. 3,000 samples are used as training samples, including 300 samples with appearance defects, 500 incomplete fasteners, and the others are fasteners with normal appearance. The Yolov3 model is used to train the samples to detect fasteners with appearance defects, and at the same time, the coordinates of the complete fastener can be segmented into the fastener area point cloud.

[0106] Combination Figures 6 to 9 , the implementation method of step S3 comprises the following steps:

[0107] S31. Use the point cloud data of fasteners with normal appearance as training samples, and mark the point cloud of the spring bar and the point cloud of the insulating pad under the spring bar for each sample.

[0108] S32, construct a training sample data set based on the sample data set, expressed as PointFastener = {PC1, ...PC t}, where PC t Sample label sample.

[0109] S33. Build the Pointnet++ three-dimensional point cloud deep learning semantic segmentation model, and use the sample label PointFastener to train Pointnet++ to obtain a Pointnet++ network with stable network parameters.

[0110] S34, input the point cloud of the fastener with complete appearance to be segmented into the trained Pointnet++ model, and quickly segment the point cloud of the spring bar and the point cloud of the insulating pad, which are represented as PointClip = {clipP1, ..., clipP n}, PointBlock={blockP1,…,blockP m}, where n and m are the number of point clouds of elastic bars and insulating spacers, respectively.

[0111] In this implementation, the fastener point cloud with normal appearance obtained by segmentation in step S24 is further processed, and the fastener spring bar point cloud and insulating spacer point cloud are marked using cloudcompare software. The Pointnet++ network is trained using labeled samples with 1,000 training samples. The fastener point cloud is segmented according to the trained Pointnet++ model to obtain the spring bar point cloud and insulating spacer point cloud of each fastener, and the two groups of point clouds are subsequently processed separately.

[0112] Combination Fig. 9 and Fig.12 , the implementation method of step S4 comprises the following steps:

[0113] S41. Use the Laplace algorithm to refine the point cloud data set PointClip of the spring clip to obtain the initial skeleton of the point cloud of the spring clip surface, expressed as SkeletonInitial = {sP1, ..., sP m}, where m is the number of skeleton points, and SkeletonInitial∈SkeletonClip;

[0114] S42. Based on the density clustering method, the elastic skeleton point cloud SkeletonInitial is spatially clustered, and the discontinuous skeleton is divided into multiple clusters. The skeleton point cloud is clustered as follows:

[0115] For any point sP∈SkeletonInitial in the three-dimensional skeleton, its mean shift vector is expressed as:

[0116]

[0117] Among them, g(x) is the Gaussian kernel function, and the bandwidth h of the i-th skeleton point is set according to the density of the sampling point cloud and the size of the elastic bar. i The value of .

[0118] S42-1. Select any point from the SkeletonInitial skeleton points and denote it as x.

[0119] S42-2. Calculate the drift point m(sP) of point sP according to formula (4):

[0120]

[0121] S42-3. Let sP=m(sP).

[0122] S42-4, the iteration ends when ||sP-m(sP)||≤ε, where ε is generally set to be less than 0.1, otherwise execute steps S42-2 to S42-3.

[0123] The skeleton point cloud is divided into T data clusters by density clustering method, represented as PointCluster = {Cluster1,...,Cluster T}.

[0124] S43, determine each data cluster of PointCluster i The number of point clouds, where i = 1, ..., T, when Cluster i When the number of point clouds is small, the cluster is considered as noise data and deleted from the skeleton points to obtain the elastic skeleton containing s data clusters Skeleton = {Cluster1,...,Cluster S}.

[0125] S44. Calculate the maximum and minimum coordinates of the Skeleton point set in the X and Y directions, expressed as X min , X max , Y min , Y max , calculate the center plane of the skeleton point, expressed as x = X center , y=Y center , and: X center =(X max -X min ) / 2,Y center =(Y max-Y min ) / 2.

[0126] S45. Search for distance plane y=Y in the skeleton point Skeleton center The nearest point B, and determine the data cluster to which B belongs, set point B belongs to data cluster Cluster i , from Cluster i Extract skeleton points whose X coordinate is less than X center The skeleton points constitute the new dataset ClipCenterInitial.

[0127] S46. Take ClipCenterInitial as a new data set, cluster the ClipCenterInitial data set using the clustering method described in S42, and determine the number C of ClipCenterInitial data clusters. If C=1, ClipCenterInitial is the point cloud skeleton of the middle part of the elastic strip, represented by ClipCenter. If C>1, the data cluster where point B is located is selected as the skeleton of the middle part of the elastic strip.

[0128] Combination Figure 12-13 The implementation method of step S5 comprises the following steps:

[0129] S51, sort the data points in ClipCenter, build a neighborhood for ClipCenter based on the KD tree, search for the point with the smallest y coordinate in the data set ClipCenter, and use this point as the starting point P for sorting start , P start The nearest neighboring point is used as the next starting point to continue searching for the nearest neighboring point until all skeleton points are traversed. Each searched starting point is stored in sequence to obtain the sorted ClipCenter. The spline interpolation method is used to fit the sorted elastic clip middle skeleton ClipCenter to obtain the second-order continuous curve SC of ClipCenter. The first-order derivative of the curve SC is calculated, and the lowest point P in the middle of the elastic clip skeleton is determined according to the extreme point of the first-order derivative. low .

[0130] S52, for the insulating block data set PointBlock = {blockP1, ..., blockP m} Fitting plane, let the fitting plane be PlaneBlock, passing through point P low , draw a straight line lp, and the straight line lp is parallel to the Z direction of the coordinate system, the parameters of the straight line lp can be obtained, the plane PlaneBlock and the straight line lp are known, find the intersection of lp and PlaneBlock, expressed as point P cross .

[0131] S53, point P cross Add it to the insulation pad data set Pointblock, and set the number of points in the Pointblock data set to K P , reconstruct the neighborhood of Pointblock based on the KD number, and move point P cross The K neighborhood of is taken as a new data set and is set as CrossCener, where K is set by the user and is approximately K P / 3. Fit a plane to the CrossCener data set, denoted as PlaneCenter, and use this plane as the plane where the insulating spacer is located.

[0132] S54. Calculate the distance d from the lowest point Plow in the middle of the spring clip skeleton to the plane PlaneCenter of the insulating pad, and determine whether the fastener is loose, tight, or normal based on the size of d.

[0133] In summary, since the data formats of two-dimensional images and three-dimensional point cloud images are completely different, the embodiments of the present invention make full use of the color and texture of two-dimensional images and the spatial structure of three-dimensional point clouds to achieve complementary advantages of the two types of data, thereby achieving faster detection speed and better robustness, and can eliminate interference from factors such as track garbage and gravel, and accurately detect defective fasteners with loose spring bars.

[0134] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A comprehensive detection method for rail spring clip fastener defects by fusion of image and point cloud, characterized in that: include: Acquire a three-dimensional point cloud of a track including spring clips and an RGB depth image corresponding to the spring clips; Detect appearance defective fasteners and appearance normal fasteners from RGB depth images; Using the mapping relationship between RGB depth images and 3D point clouds, the 3D point clouds of fasteners with normal appearance are segmented from the 3D point clouds of the track; Segment the 3D point cloud of the spring bar and the 3D point cloud of the insulating spacer from the 3D point cloud of the fastener with normal appearance; Extract skeleton points of the middle area of ​​the spring strip from the three-dimensional point cloud of the spring strip; Determine the lowest point among the skeleton points in the middle area of ​​the spring bar; fit the plane where the insulating pad is located according to the three-dimensional point cloud of the insulating pad; and calculate the distance from the lowest point to the plane where the insulating pad is located, and judge the looseness, tightness and normal state of the fastener with normal appearance through the distance; The acquisition of the track three-dimensional point cloud includes: The line laser scanning sensor is vertically mounted on the inspection vehicle, and the encoder mounted on the inspection vehicle is used to trigger the line laser sensor to dynamically scan the track profile; Set the acquisition range of the line laser sensor in the horizontal and height directions, establish the acquisition coordinate system, and set the forward direction of the inspection vehicle as the Y direction, the vertical track direction as the X direction, and the height direction as the Z direction; set the point spacing of the line laser sensor in the X direction to be Δx, the encoder trigger spacing to be Δy, the number of point clouds in the X direction to be N, and the M lines of contours in the Y direction to form a three-dimensional point cloud image of the track; Among them, in the track 3D point cloud image, the coordinate of the i-th point in the X direction is expressed as X i =X0+i*Δx, the Y coordinate of the jth row is expressed as Y j =Y0+j*Δy, X0, Y0 are the starting coordinates in the X and Y directions, i=1,2,…,N-1, j=1,2,…,M-1, then the height of the point in the i-th row and j-th column is expressed as Z ij , the track 3D point cloud data is represented as (X i ,Y j ,Z ij ); The acquisition of the RGB depth image includes: Assume that the measurement range of the laser sensor is h and the point cloud height is Z ij ∈(-h / 2,h / 2), with Δh as the equal interval, divide the height into K equal parts, K = h / Δh, establish a color table, randomly select K different colors and put them into the color table, so that different height segments are represented by different colors, and the same height segments are represented by the same color. The corresponding relationship between height and color is: Where [·] is the rounding function, t represents the tth color in the color table, t∈[0,K-1]; Create a text file in the specified folder to store the point cloud, and create a two-dimensional empty image I with a size of N×M corresponding to the point cloud file t ; Start the line laser sensor to scan the track containing the spring clip fastener, read each line profile of the line laser sensor, and determine the validity of the data at each point: if the current point P ij The height value is a valid value. ij Height Z ij Mapping to 2D image I t Coordinate (i, j), select the corresponding color from the color table to represent the color of point (i, j); if point P ij Height Z ij is an invalid value, then the two-dimensional image I t The color at the coordinate (i, j) is represented by a color other than that in the color table; ij The three coordinate values ​​(X i ,Y j ,Z ij ) are saved in a line of a text file in the order of scanning, each line in the text file represents a point cloud, and the point cloud and RGB depth image constitute a dual-modal image of the scene; The mapping relationship between the RGB depth image and the three-dimensional point cloud includes: Establish the mapping relationship between point cloud and RGB dual-modal image, read the text file and convert it into a matrix, let the matrix represent Point, the size of the matrix Point is (M×N)×3; given the two-dimensional image coordinates (i, j), the mapping relationship between the three-dimensional point cloud image and the two-dimensional image is: The method of segmenting the three-dimensional point cloud of the fastener with normal appearance from the three-dimensional point cloud of the track includes: The target detection sample labels are produced for the RGB depth image. The sample labels are divided into three categories, namely, fasteners with normal appearance, fasteners with incomplete appearance, and fasteners with defective appearance. The insulating pads on the contact surface of the spring bar in the fasteners with normal appearance are marked in the fastener area. Among them, fasteners with normal appearance include normal fasteners and fasteners with loose bolts. Incomplete fasteners are fasteners with normal appearance that are stored in two consecutive files. Fasteners with defective appearance include fasteners with missing buckles, broken fasteners, buckle dislocation, and fasteners with missing bolts. Construct a training data set based on sample labels, denoted as D t ={X t ,Y t }, where X t is the RGB depth image, Y t For X t The ground truth label image of the bullet-hit bar fastener; Using the training data set D t ={X t ,Y t } Train a deep neural network to obtain a trained deep learning model for spring clip fastener detection; The unlabeled sample dataset D v ={X v Input the trained deep learning model for spring clip fastener detection: when the fastener is predicted to have an appearance defect, directly output the detection result; when the fastener is predicted to have an incomplete appearance, splice the previous or next image of the current image to form a new image, and re-input the trained deep learning model for spring clip fastener detection for label prediction; when the fastener is predicted to have a normal appearance, output the four coordinates of the detection rectangle, and use the mapping relationship to segment the point cloud data of the fastener area; The step of extracting skeleton points of the middle region of the spring strip from the three-dimensional point cloud of the spring strip comprises: The Laplace algorithm is used to refine the point cloud dataset PointClip to obtain the initial skeleton of the spring clip, which is represented by SkeletonInitial = {sP1,…,sP m }, where m is the number of skeleton points, and SkeletonInitial∈SkeletonClip; Based on the density clustering method, the initial skeleton point cloud of the elastic clip is spatially clustered and segmented, the noise skeleton points are removed, and the skeleton points in the middle area of ​​the elastic clip are extracted; The density-based clustering method is used to spatially cluster and segment the initial skeleton point cloud of the elastic clip, remove the noise skeleton points, and extract the skeleton points in the middle area of ​​the elastic clip, including: Based on the density clustering method, the point cloud SkeletonInitial of the elastic skeleton is spatially clustered, and the discontinuous skeleton is divided into T data clusters, which are expressed as PointCluster = {Cluster1,...,Cluster T }; Determine each data cluster of PointCluster i The number of point clouds, where i = 1, ..., T, when Cluster i When the number of point clouds is small, the cluster is considered as noise data and deleted from the skeleton points to obtain the elastic skeleton containing s data clusters Skeleton = {Cluster1,...,Cluster S }; Calculate the maximum and minimum coordinates of the Skeleton point set in the X and Y directions, denoted as X min , X max , Y min , Y max ; Calculate the center plane of the skeleton point, expressed as x = X center , y=Y center , and X center =(X max -X min ) / 2,Y center =(Y max -Y min ) / 2; Search for distance plane y=Y in the skeleton point Skeleton center The nearest point B, and determine the data cluster to which B belongs, set point B belongs to data cluster Cluster i , from Cluster i Extract skeleton points whose X coordinate is less than X center The skeleton points constitute the new data set ClipCenterInitial. ClipCenterInitial is used as a new data set. The density clustering method is used to cluster the ClipCenterInitial data set. The number C of ClipCenterInitial data clusters is determined. If C=1, ClipCenterInitial is the point cloud skeleton of the middle part of the elastic clip, which is represented by ClipCenter. If C>1, the data cluster where point B is located is selected as the skeleton of the middle part of the elastic clip. The method of judging whether a fastener having normal appearance is loose, tight or normal includes: Sort the data points in the skeleton ClipCenter in the middle area of ​​the elastic clip, build a neighborhood for ClipCenter based on the KD tree, search for the point with the smallest y coordinate in the data set ClipCenter, use the point with the smallest coordinate as the starting point Pstart for sorting, use the nearest neighboring point of Pstart as the next starting point, and continue to search for the nearest neighboring point until all skeleton points are traversed, and store each searched starting point in sequence to obtain the sorted ClipCenter; The spline interpolation method is used to fit the sorted clip middle skeleton ClipCenter to obtain the second-order continuous curve SC of ClipCenter. The first-order derivative of the curve SC is calculated, and the lowest point P in the middle of the clip skeleton is determined according to the extreme point of the first-order derivative. low ; For the insulating block data set PointBlock = {blockP1,…,blockP m } Fitting plane, let the fitting plane be PlaneBlock, passing through point P low , draw a straight line lp, and the straight line lp is parallel to the Z direction of the coordinate system, and find the parameters of the straight line lp. Given the plane PlaneBlock and the straight line lp, find the intersection of lp and PlaneBlock, which is represented by point P cross ; Point P cross Add it to the insulation pad data set Pointblock, and set the number of points in the Pointblock data set to K P , reconstruct the neighborhood of Pointblock based on the KD tree, and move point P cross The K neighborhood of is taken as a new data set, which is set as CrossCener, where K is set by the user; a plane is fitted to the CrossCener data set, which is represented as PlaneCenter, and the plane is taken as the plane where the insulating pad is located; Calculate the lowest point P in the middle of the spring clip skeleton low The distance d from the insulating block to the PlaneCenter plane can be used to determine whether the fastener is loose, tight, or in normal condition based on the size of d.

2. The method for comprehensive detection of rail spring clip defects by image and point cloud fusion according to claim 1, characterized in that: The 3D point cloud of the spring clip and the 3D point cloud of the insulating spacer are segmented from the 3D point cloud of the normal-looking fastener, including: The 3D point cloud data of fasteners with normal appearance are used as training samples, and the point cloud of the spring bar and the point cloud of the insulating pad under the spring bar are marked for each sample; A training sample data set is constructed based on the training samples. The sample data set is represented as PointFastener = {PC1, ...PC t }, where PC t is the i-th label sample; The Pointnet++ network is trained using the sample label PointFastener to obtain a Pointnet++ network with stable network parameters. The point cloud of the fastener with complete appearance to be segmented is input into the trained Pointnet++ model to segment the point cloud of the spring clip and the point cloud of the insulating pad, which are represented as PointClip = {clipP1,…,clipP n }, PointBlock={blockP1,…,blockP m }, where n and m are the number of point clouds of elastic bars and insulating spacers, respectively.

3. The method for comprehensive detection of rail spring clip defects by image and point cloud fusion according to claim 1, characterized in that: The density clustering method comprises: For any point sP∈SkeletonInitial in the three-dimensional skeleton, its mean shift vector is expressed as: Among them, g(x) is the Gaussian kernel function, and the bandwidth h of the i-th skeleton point is set according to the density of the sampling point cloud and the size of the elastic bar. i The value of Select any point from the SkeletonInitial skeleton points and represent it as x; Calculate the drift point m(sP) of point sP according to the mean shift vector formula: Let sP=m(sP), ||sP-m(sP)||≤ε and the iteration ends, where ε is generally set to be less than 0.1, otherwise the drift point of point sP is recalculated.

Citation Information

Patent Citations

  • Method and device for automatically checking fastening states of railway fasteners and spring fasteners

    CN103061219B

  • Automatic state detection device and method for railway track spring bar fastener

    CN106192634A

  • Fastener state detection method and system and readable storage medium

    CN112819752A

  • Tightness state detection method for track elastic strip fastener

    CN115100109A