Train identification method, electronic device and storage medium
By performing rasterization and connected component analysis on the irregular point cloud of the trackside monitoring equipment, and combining the distinction between ground points and non-ground points with time interval judgment, the problem of train identification under the influence of sparse lidar point cloud was solved, and accurate train identification was achieved.
Patent Information
- Application Number
- CN202310953679.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-31
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2043-07-31
AI Technical Summary
Existing trackside monitoring equipment struggles to accurately identify trains due to the irregular and sparse nature of lidar point clouds.
A train identification method based on irregular point clouds is adopted. The method identifies the presence of trains by rasterizing template point clouds and point clouds to be processed, performing connected component analysis, distinguishing between ground points and non-ground points, performing cluster analysis, and determining time intervals.
It enables accurate train identification even in irregular point cloud conditions, improving the accuracy and efficiency of train identification.
Smart Images

Figure CN117237695B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the field of rail transit, and particularly relates to a rail transit signal system. BACKGROUND
[0002] The invasion of foreign matters such as rockfall and animals has a serious impact on the safe driving of trains, so rail monitoring equipment can be used to monitor foreign matters in the track area. Currently, the rail monitoring equipment mainly uses laser radar or camera sensors. When detecting foreign matters in the track area, the normal passing trains need to be filtered to avoid false positives.
[0003] The laser radar has the characteristics of long detection distance and strong light adaptability, and the point cloud distribution has the characteristics of near density and far sparseness. Meanwhile, affected by the installation position of the rail monitoring equipment, the shape difference of freight and passenger trains, the low reflectivity of the train window and other factors, the train point cloud scanned by the laser radar is irregular and sparse, which affects the accurate identification of the train. SUMMARY
[0004] To solve the problem of irregular and sparse point cloud train identification, the technical problem to be solved by the present application is to provide a train identification method based on irregular point cloud, which solves the identification filtering of the train under irregular point cloud conditions.
[0005] To solve the above technical problems, the present application adopts the following technical solutions:
[0006] On the one hand, a train identification method based on irregular point cloud is provided, which includes the following steps:
[0007] S1: Obtain complete ground point cloud in the area where the train passes without any object, and process the point cloud after passing the discrete point and roi area cutting as a template point cloud;
[0008] S2: Perform gridding processing on the to-be-processed point cloud and the template point cloud respectively, perform ground point cloud missing statistics according to the grid division, record the to-be-processed grid belonging to the vacancy area in set A {R 00 , R 01 , R 02 ,..., R ij}, where R ij represents the grid of the ith row and jth column, and perform connected component analysis between each grid in set A, calculate the area of each connected component, and record the maximum value of the area as Area max ;
[0009] S3: Divide the to-be-processed point cloud into ground points and non-ground points, extract the rails for the ground points, and record them as Points rail , and perform clustering analysis on the non-ground point cloud, calculate the center coordinates of the clustered point cloud, and record them as Center iwhere i is the i-th cluster of clustered point clouds, Center i and Points rail are projected to XOY plane, and are recorded as Center_xoy i , Points_xoy rail respectively.
[0010] S4: record the time t0 when the non-ground point cloud appears and the time t1 when the non-ground point cloud disappears, and calculate the time interval t=t1-t0 when the non-ground point cloud exists;
[0011] S5: determine whether a train passes through the point cloud to be processed. If the Area max value is greater than the area threshold value, the points of Center_xoy i are all located on one side of Points_xoy rail , and the time interval t is less than the time threshold value, it is considered that a train passes through the point cloud to be processed.
[0012] Preferably, the template point cloud production includes the following steps:
[0013] S11: collect n frames of point clouds in an environment where there is no object in the monitoring area, and superimpose multiple frames of point clouds;
[0014] S12: uniformly down-sample cloud to cloud_resample, and remove outliers from cloud_resample to remove noise points in the point cloud;
[0015] S13: extract the rail point cloud in cloud_resample, perform spatial curve fitting on the rail point cloud, and record the results as curve1 and curve2; according to the track area limited by curve1 and curve2, crop cloud_resample to obtain cloud_model.
[0016] Preferably, the ground point cloud loss statistics method is to calculate the difference in the number of point clouds in the corresponding grid between the point cloud to be processed and the template point cloud, and determine whether the grid to be processed belongs to the vacancy area according to the set threshold value.
[0017] Preferably, S2 includes the following steps:
[0018] S21: obtain the maximum and minimum values of x and y directions in the template point cloud cloud_model, and record them as max_x, min_x, max_y, and min_y. The maximum and minimum values of x and y directions are extended to the boundary, and the formula is as follows:
[0019] max_x_border = max_x + border_constant_x
[0020] max_y_border = max_y + border_constant_y
[0021] min_x_border = max_x + border_constant_x
[0022] min_y_border = max_y + border_constant_y
[0023] S22: According to max_x_border, max_y_border, max_y_border, max_y_border and the step length of the set division grid, the number of grids in x and y directions is calculated,
[0024] The points in the template point cloud cloud_model within the range of x∈[min_x_border, max_x_border] and y∈[min_y_border, max_y_border] are grid divided, and are recorded as grids_model N×M , wherein N is the number of grids in the y direction, and M is the number of grids in the x direction, that is, there are N rows and M columns of grids in total;
[0025] The to-be-processed point cloud cloud_current is grid divided, and is recorded as grids_current N×M ,
[0026] The grids_current N×M is initialized, and the label of each grid in the grids_current
[0027] S23: The grids_model N×M and the grids_current N×M are traversed,
[0028] The number of point clouds grids_model_num ij and grids_current_num ij (i = 0, 1, 2,..., N; j = 0, 1, 2,..., M) of the grids_model ij and the grids_current ij are calculated,
[0029] If grids_model_num ij -grids_current_num ijIf grids_current ij is empty, the label of grids_current ij is marked as 1.
[0030] S24: The connected component analysis is performed on the grids_current N×M with label 1, and the grids connected to each other are marked as the same area, and the grids_current N×M is divided into K connected components, and the connected component with the largest number of grids is calculated, and the number of grids of the connected component is recorded as the area Area max .
[0031] Preferably, the CSF algorithm is used to distinguish the ground points and non-ground points in the point cloud to be processed, and the specific steps are as follows:
[0032] a) The point cloud is flipped in the Z direction;
[0033] b) The cloth is initialized, and the initial position of the cloth is usually above the highest point of the point cloud in the Z direction;
[0034] c) The point cloud and the particle are projected onto the horizontal plane, and the nearest point of each particle in the point cloud is found, and the height value is recorded as IHV;
[0035] d) For each movable particle, the position affected by gravity is calculated, and compared with the IHV of the point in the point cloud corresponding to the current particle, if the height of the particle is lower than or equal to the IHV, the height of the particle is set to the IHV, and the particle is considered as an immovable point;
[0036] e) For each particle, the displacement affected by the internal driving factor is calculated;
[0037] f) Repeat steps d) and e) until the maximum height difference of all particles changes enough or the number of iterations reaches a pre-set value, then stop the simulation process;
[0038] g) Calculate the height difference between the point cloud and the particle;
[0039] h) If the distance between the point cloud and the particle is less than a set threshold, it is considered as a ground point.
[0040] Preferably, the method for judging whether the point cloud to be processed has a train passing through is as follows:
[0041] The two-dimensional curve fitting is performed on Points_xoy rail and resampling is performed to obtain the point cloud Points_resample;
[0042] If the following formula is satisfied, it is considered that there is a train passing through the point cloud:
[0043]
[0044] where Center_xoy i denotes the center coordinates of the point cloud of the i-th cluster,
[0045] Points_resample i-1 and Points_resample i denotes the two nearest rail points in the x direction from Center_xoy i , k is the number of categories of clustering, Area max is the empty area size after comparing the point cloud to be processed with the template point cloud.
[0046] Preferably, the area threshold is set according to the grid size, and the time threshold is set according to the normal time required for the train to pass through the monitoring area.
[0047] In another aspect, an electronic device is provided, which comprises:
[0048] a memory storing a plurality of instructions;
[0049] a processor loading the instructions from the memory to perform the steps in the above method.
[0050] A computer-readable storage medium is also provided, which stores a computer program that, when executed by an electronic device, implements the steps in the above method.
[0051] The technical solutions adopted by the present application have the following beneficial effects:
[0052] By comparing with the ground points of the template point cloud, the problem of train recognition when the trackside laser radar cannot scan out complete point cloud is solved.
[0053] When the present application is used to perform ground point cloud missing statistics, the discrete and unordered point cloud is converted into an ordered grid through grid division and connected region calculation, and the area of the connected grid is calculated as the coverage area of the missing point cloud, which has the characteristics of simple calculation steps and less time consumption.
[0054] The specific technical solutions adopted by the present application and the beneficial effects brought by them will be disclosed in detail in the following specific embodiments in conjunction with the drawings. BRIEF DESCRIPTION OF DRAWINGS
[0055] The present application will be further described below in conjunction with the drawings and specific embodiments:
[0056] Figure 1 A neighborhood map is shown. DETAILED DESCRIPTION
[0057] The technical solutions of the embodiments of the present application will be explained and described below in combination with the drawings of the embodiments of the present application. The following embodiments are only preferred embodiments of the present application, and not all. Based on the embodiments in the embodiments, other embodiments obtained by those skilled in the art without creative labor are within the protection scope of the present application.
[0058] Embodiment one
[0059] In order to solve the problem that the train point cloud scanned by the laser radar is irregular and sparse, and the train is difficult to identify, the present application proposes a train identification method based on irregular point cloud, which calculates and analyzes the point cloud passed by the train to accurately judge whether the train has passed.
[0060] The method comprises the following steps:
[0061] 1) In order to obtain complete ground point cloud, multiple frames of point cloud in the state of no train, inspection worker and other objects in the monitoring area are collected by the laser radar.
[0062] And further, the point cloud of the track area is cut out and stored as a background template.
[0063] 2) Template point cloud is made. The original point cloud of the laser radar usually has some discrete points, which will interfere with the subsequent point cloud processing to some extent, so that the outlier points need to be removed.
[0064] The point cloud after discrete point processing and roi area cutting is used as the template point cloud, and the point cloud for subsequent processing is compared.
[0065] 3) The point cloud to be processed and the template point cloud are respectively subjected to rasterization processing.
[0066] According to the x and y coordinates of each point in the point cloud, it is divided into different grids, and each grid contains multiple points, and each grid represents a small area in three-dimensional space.
[0067] 4) The number of point clouds in the corresponding grids of the point cloud to be processed and the template point cloud is counted, and whether the grid to be processed belongs to the vacancy area is judged according to the set threshold.
[0068] The grid belonging to the vacancy area is recorded in the set A{R 00 , R 01 , R 02 ,..., R ij}, wherein R ij represents the grid of the ith row and jth column.
[0069] The empty area threshold needs to be set according to the resolution of the laser radar and the size of the grid.
[0070] 5) Calculate the missing area size of the point cloud to be processed compared with the template point cloud.
[0071] The connected component analysis is performed between each grid in set A, the area of each connected component is calculated, and the maximum area value is recorded as Area max .
[0072] 6) The ground points and non-ground points of the point cloud to be processed are distinguished.
[0073] The ground points are extracted for the rail, and are recorded as Points rail .
[0074] The non-ground point cloud is subjected to clustering analysis, and the center coordinates of the clustered point cloud are calculated, recorded as Center i , wherein i is the i-th clustered point cloud of the clustered point cloud. Center i and Points rail are projected onto the XOY plane, and are recorded as Center_xoy i , Points_xoy rail , respectively.
[0075] 7) The time t0 when the non-ground point cloud appears and the time t1 when the non-ground point cloud disappears are recorded, and the time interval t=t1-t0 of the non-ground point cloud is calculated.
[0076] 8) If the Area max value in step 5) is greater than the area threshold, the points of Center_xoy i in step 6) are all located on one side of Points_xoy rail , and the time interval t in step 7) is less than the time threshold, it is considered that a train passes through the point cloud to be processed.
[0077] The area threshold is set according to the grid size, and the time threshold is set according to the normal time required for the train to pass through the monitoring area.
[0078] Further, the following describes several important steps:
[0079] Template point cloud making
[0080] 1, The template point cloud provides a comparison template for train identification, and the accuracy of the template point cloud making affects the train identification accuracy to a certain extent. The present application collects n frames of point clouds in an environment without any objects in the monitoring area, and superimposes the multiple frames of point clouds, and the formula is as follows.
[0081]
[0082] 2, uniformly downsample cloud, denoted as cloud_resample. In order to remove the noise of the point cloud, the present application adopts SOR algorithm to remove outliers of cloud_resample. The algorithm performs statistical analysis on the neighborhood of each point in the point cloud, and removes points that do not meet the specified rules. Traverse each point in the point cloud, calculate the average distance of the point to its k neighboring points, and assume that a Gaussian distribution is obtained, the formula is as follows, The points whose average distance is outside the standard range are considered as outliers.
[0083] 3, extract the rail point cloud in cloud_resample, and perform spatial curve fitting on the rail point cloud, denoted as curve1 and curve2. According to the track area limited by curve1 and curve2, the point cloud of cloud_resample is cropped, and the cropped point cloud is denoted as cloud_model.
[0084] Point cloud rasterization processing
[0085] 1, obtain the maximum and minimum values of x direction and y direction in the template point cloud cloud_model, denoted as max_x, min_x, max_y, and min_y.
[0086] Since the maximum and minimum values of different frames of point clouds will have certain differences, the maximum and minimum values of x and y directions are boundary expanded, and the formula is as follows.
[0087] max_x_border = max_x + border_constant_x
[0088] max_y_border = max_y + border_constant_y
[0089] min_x_border = max_x + border_constant_x
[0090] min_y_border = max_y + border_constant_y
[0091] 2, according to max_x_border, max_y_border, max_y_border, max_y_border and the step length of the set grid, the number of grids in x and y directions is calculated.
[0092] The points in the template point cloud cloud_model within the range of x∈[min_x_border, max_x_border] and y∈[min_y_border, max_y_border] are divided into grids, denoted as grids_model. N×M , where N is the number of grids in the y direction and M is the number of grids in the x direction, that is, a total of N rows and M columns of grids.
[0093] Similarly, the point cloud to be processed, cloud_current, is divided into grids, denoted as grids_current. N×M Initialize grids_current N×M Each grid cell is labeled 0, and this label is used for subsequent connected component analysis.
[0094] 3. Simultaneously iterate through grids_model N×M and grids_current N×M Calculate grids_model ij and grids_current ij The number of point clouds (i = 0, 1, 2, ..., N; j = 0, 1, 2, ..., M) in grids_model_num ij and grids_current_num ij .
[0095] If grids_model_num ij -grids_current_num ij If the value is greater than or equal to threshold_number, then grids_current is considered to be active. ij This is an empty area. Also, mark grids_current. ij The label is 1.
[0096] 4. Regarding grids_current N×M Connectivity analysis is performed on the grid with label 1, and grids that are connected to each other are marked as the same region.
[0097] This invention calculates the connectivity of 8-neighborhoods, where 8-neighborhoods are as follows: Figure 1 As shown. Figure 1 The grid in row (i, j) and column j is defined. After connected component analysis, grids_current can be... N×M Divide the system into K connected components. Calculate the connected component with the largest number of grid cells. The number of grid cells in this connected component is denoted as its area. max .
[0098] Non-ground point clustering analysis
[0099] 1、The application uses CSF algorithm to distinguish ground points and non-ground points from the point cloud to be processed, and the basic idea of the CSF algorithm is based on cloth simulation, the point cloud is flipped, the surface of the flipped point cloud is covered with cloth with rigid parameters, and the position of the cloth can be approximated as the ground position under the influence of gravity. The cloth can be considered as a grid composed of mass particles connected to each other, and the position and velocity of the particles depend on the force acting on the particles. According to Newton's second law, the relationship between the position of the particle and the force is as follows:
[0100]
[0101] Where X represents the position of the particle at time t, F ext (X, t) represents external driving factors (gravity, collision, etc.), F int (X, t) represents internal driving factors (internal connection between particles).
[0102] The specific steps are as follows:
[0103] a) Flip the point cloud in the Z direction.
[0104] b) Initialize the cloth, and the initial position of the cloth is usually above the highest point of the point cloud in the Z direction.
[0105] c) Project the point cloud and the particles onto the horizontal plane, find the nearest point of each particle in the point cloud, and record the height value as IHV.
[0106] d) For each movable particle, calculate the position affected by gravity, and compare it with the IHV of the point in the point cloud corresponding to the current particle. If the height of the particle is lower than or equal to the IHV, set the height of the particle to the IHV, and consider the particle as an immovable point.
[0107] e) For each particle, calculate the displacement affected by the internal driving factors.
[0108] f) Repeat steps d) and e) until the maximum height difference of all particles changes sufficiently small or the number of iterations reaches the pre-set value, then stop the simulation process.
[0109] g) Calculate the height difference between the point cloud and the particles.
[0110] h) If the distance between the point cloud and the particles is less than the set threshold, it is considered as a ground point.
[0111] 2、Divide the point cloud into ground points cloud_ground and non-ground points cloud_nonground by the CSF algorithm.
[0112] Extract the rail point cloud Points in cloud_ground rai1 Meanwhile, the cloud_nonground is clustered to obtain k-class cluster point clouds. The center coordinates of each class of cluster point clouds Center are obtained by traversing the k-class cluster point clouds i .
[0113] Train condition determination
[0114] The Center i and Points rail are projected onto the xoy plane to obtain Center_xoy i and Points_xoy rail respectively. Two-dimensional curve fitting is performed on Points_xoy rail and resampling is performed to obtain the point cloud Points_resample. If the following formula is satisfied, it is considered that a train passes through the point cloud.
[0115]
[0116] where Center_xoy i represents the center coordinates of the i-th class of cluster point clouds, Points_resample i-1 and Points_resample i represent the two rail points closest to Center_xoy i in the x direction, k is the number of classes, and Area max is the empty area size after comparing the point cloud to be processed with the template point cloud.
[0117] Example two
[0118] The electronic device provided in this embodiment comprises:
[0119] a memory storing a plurality of instructions;
[0120] a processor loading the instructions from the memory to execute the steps in the method of example one.
[0121] Example three
[0122] The computer readable storage medium provided in this embodiment has a computer program stored thereon, which is executed by an electronic device to implement the steps in the method of example one.
[0123] The above merely illustrates the specific embodiments of the present application, but the protection scope of the present application is not limited thereto, and those skilled in the art should understand that the present application includes but is not limited to the contents described in the above specific embodiments and the drawings. Any modification not deviating from the functional and structural principles of the present application shall be included in the scope of the claims.
Claims
1. A train recognition method based on irregular point clouds, characterized in that, Includes the following steps: S1: Obtain the complete ground point cloud in the area where there are no objects in the train's passage, and use the point cloud after discrete point processing and ROI region clipping as the template point cloud. S2: Rasterize the point cloud to be processed and the template point cloud separately. Based on the raster division, perform ground point cloud missing data statistics, and add the unprocessed grids belonging to the missing regions to set A{ , ,..., },in Indicates the first Given a grid of rows and columns j, perform connectivity analysis on the grids in set A, calculate the area of each connected component, and record the maximum area. ; S3: Distinguish between ground points and non-ground points in the point cloud to be processed. Extract the railway tracks from the ground points, denoted as... Cluster analysis is performed on non-terrestrial point clouds, and the coordinates of the center of the clustered point clouds are calculated and denoted as . ,in The first clustered Clustering point clouds, and All projected to Planes, respectively denoted as , ; S4: Record the time of occurrence of non-ground point clouds And the time of disappearance And calculate the time interval for the existence of non-ground point clouds. ; S5: Determine if a train has passed through the point cloud to be processed. The value is greater than the area threshold. The points are all located in If a train passes through one side of the point cloud and the time interval t is less than the time threshold, then it is considered that a train has passed through the point cloud to be processed.
2. The train recognition method based on irregular point clouds according to claim 1, characterized in that, Template point cloud creation includes the following steps: S11: Acquire n frames of point cloud data in an environment where there are no objects in the monitoring area, and then overlay the multiple frames of point cloud data to obtain the template point cloud data. ; S12: Yes Perform uniform downsampling, denoted as At the same time, in order to remove noise from the point cloud, Outlier removal; S13: Extract The railway track point cloud is used for spatial curve fitting, denoted as follows: ;according to and The restricted track area will Perform point cloud cropping, and denote the cropped point cloud as... model.
3. The train recognition method based on irregular point clouds according to claim 1, characterized in that, The method for counting missing points in ground point clouds is as follows: count the difference in the number of points in the corresponding grids of the point cloud to be processed and the template point cloud, and determine whether the grid to be processed belongs to the missing area based on the set threshold.
4. The train recognition method based on irregular point clouds according to claim 1, characterized in that, S2 includes the following steps: S21: Obtain Template Point Cloud The maximum and minimum values in the x and y directions of the model are denoted as max_x, min_x, max_y, and min_y, respectively. The boundaries of the maximum and minimum values in the x and y directions are then expanded using the following formulas: ; ; ; ; S22: According to , , And set the meshing step size, and calculate the number of meshes in the x and y directions. Template point cloud In the model , ], , The points within the range are divided into a grid, denoted as . Where N is the number of grids in the y direction and M is the number of grids in the x direction, that is, a total of N rows and M columns of grids; Point cloud processing _current performs mesh generation, denoted as , initialization The label for each grid cell is 0; S23: Traversal and , calculate and Number of point clouds (i=0,1,2,...,N; j = 0,1,2,...,M) and , like Then it is believed It is a missing area, and it is marked. The label is 1; S24: Yes Connectivity analysis is performed on the meshes labeled 1, marking interconnected meshes as the same region. Divide the system into K connected components. Calculate the connected component with the largest number of grid cells. The number of grid cells in this connected component is denoted as its area. .
5. The train recognition method based on irregular point clouds according to claim 1, characterized in that, The CSF algorithm is used to distinguish between ground points and non-ground points in the point cloud to be processed. The specific steps are as follows: a) Flip the point cloud in the Z direction; b) Initialize the cloth. The initial cloth position is usually above the highest point in the Z direction of the point cloud. c) Project both the point cloud and the particles onto a horizontal plane, find the nearest neighbor point of each particle in the point cloud, and record the height value as IHV; d) For each movable particle, calculate its position caused by gravity and compare it with the IHV of the point in the point cloud corresponding to the current particle. If the height of the particle is lower than or equal to the IHV, set the height of the particle to IHV and consider the particle to be an immovable point. e) For each particle, calculate the displacement caused by the influence of internal driving factors; f) Repeat steps d) and e) until the maximum elevation difference of all particles is sufficiently small or the number of iterations reaches a preset value, then stop the simulation process; g) Calculate the height difference between the point cloud and the particles; h) If the distance between the point cloud and the particle is less than the set threshold, it is considered a ground point.
6. The train recognition method based on irregular point clouds according to claim 1, characterized in that, The method for determining whether a train has passed through the point cloud to be processed is as follows: right Perform two-dimensional curve fitting and resampling to obtain the point cloud. ; If the following formula is satisfied, then a train is considered to have passed through the point cloud: ; in Represents the center coordinates of the point cloud of the i-th cluster. and Represents distance in the x-direction The two closest railway track points, where k is the number of clusters. The threshold area is the maximum area of the missing region after comparing the point cloud to be processed with the template point cloud. The threshold_area is the threshold area and the threshold_time is the threshold time.
7. The train recognition method based on irregular point clouds according to claim 1, characterized in that, The area threshold is set according to the grid size, and the time threshold is set according to the normal time required for a train to pass through the monitored area.
8. An electronic device, characterized in that, The electronic device includes: The memory stores multiple instructions; A processor that loads instructions from the memory to perform the steps of the method as described in any one of claims 1 to 7.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by an electronic device, it implements the steps of the method described in any one of claims 1 to 7.
Citation Information
Patent Citations
Scanning radar judgment method for preventing train passage false alarm
CN110161524A
Track foreign matter invasion detection system and method
CN113011252A