Rapid matching method for steel rail profiles
By using the ICP algorithm based on point-line measurement and dynamic loss function in the rail profile matching, the problems of low matching efficiency and low accuracy in the prior art are solved, fast and accurate rail profile matching are achieved, and the robustness of the algorithm is improved.
Patent Information
- Application Number
- CN202411618057.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-13
- Publication Date
- 2025-03-07
AI Technical Summary
The existing rail profile matching methods have slow convergence efficiency, low matching accuracy, and are easily affected by outlier noise, resulting in the inability to converge to the best match.
The closest point iteration algorithm (ICP) based on point-line metrics is used to combine dynamic loss function, and through nonlinear optimization and dynamic update of loss function coefficients, the convergence speed and accuracy of matching are improved and the interference of outlier data is reduced.
The convergence speed and accuracy of rail profile matching are significantly improved, the robustness of the algorithm is enhanced, the dependence on initial state estimation is avoided, and the stability and repetition of the matching are improved.
Smart Images

Figure CN119579933A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of railway engineering detection technology, and in particular to a method for fast matching of rail profiles based on point-line metric ICP (a closest point iterative algorithm) and dynamic loss function. Background Art
[0002] my country's railway train operation is characterized by high speed and high density. With the long-term high-load operation of rails, problems such as fish scales, wear, surface scratches, peeling blocks, fat edges and cracks are becoming increasingly prominent, and regular inspection and maintenance are required. Rail wear detection is an important guarantee for the safe operation of railways, and is very important for formulating reasonable railway transportation plans and reducing maintenance costs. For a long time, rail wear detection has been mainly carried out by manual sampling using special wear gauges or measuring tools such as Miniprof. This static measurement method is not only inefficient and greatly wastes manpower and material resources, but also inevitably introduces human factors in the measurement process, affecting the accuracy and reliability of the measurement, and it is difficult to adapt to the growing railway inspection needs in my country in the future. Another method is dynamic measurement based on computer vision, which has the characteristics of non-contact, high speed and high precision. As a tool with a wide range of current applications, the on-board rail detector can perform continuous dynamic real-time measurement of the rail profile, and can effectively identify various defects on the rail surface. Profile detection based on computer vision requires the alignment of the measured profile with the standard template profile. The algorithm generally matches the rail waist, rail jaw and other parts that can maintain a stable shape for a long time, and then calculates key parameters such as the vertical wear and side wear of the rail based on the degree of wear and deformation in the rail head area.
[0003] However, in actual rail detection, due to the influence of external lighting, complex surface imaging of rails, and train vibration, there are problems such as large profile noise and more outlier data interference. At the same time, since the waist part of the actual rail has fewer features, there are high requirements for the real-time, repeatability and robustness of the matching algorithm, which is the main challenge of the current real-time measurement technology of rails. The traditional ICP matching algorithm mainly has low matching efficiency. When there is no rough match in the profile or the rough matching effect is not good, dozens or even hundreds of iterations are required. In addition, ICP is greatly affected by outlier noise, and it is easy to fail to converge to the best match. The iterative algorithm generally needs to obtain a reasonable initial state, that is, the rough matching process. Due to the complex imaging environment, the rough matching process based on local features is prone to errors, which in turn affects the subsequent matching process.
[0004] In the prior art, the following documents are mainly related to this application:
[0005] Document 1 is a Chinese invention application filed by China Academy of Railway Sciences Group Co., Ltd. on July 3, 2018, and published on June 22, 2016, with publication number CN108896000A. The application discloses a rail profile alignment method and device, and a rail wear calculation method and device, wherein the rail profile alignment method includes: determining the alignment reference point cp and the rotation reference slope kr according to the target profile; determining the point where the second straight line segment in the measured profile connects the first arc segment and the slope km of the second straight line segment according to the measured profile data; calculating the alignment translation between the point where the second straight line segment in the measured profile connects the first arc segment and the alignment reference point cp; translating the measured profile data according to the alignment translation, rotating and translating the rail profile data according to the alignment reference point cp, the rotation reference slope kr, and the slope km of the second straight line segment in the measured profile, and completing the alignment of the measured profile. The invention can quickly and accurately align the measurement profile, improve the accuracy of the measurement profile, and further, can quickly and accurately determine the rail wear, providing guidance for rail evaluation and daily rail maintenance and repair.
[0006] Document 2 is a Chinese invention application filed by Chengdu Tangyuan Electric Co., Ltd. on April 26, 2022, and published on June 22, 2016, with publication number CN114987577A. The application discloses a track profile alignment method and a 3D laser rail profile detection method, including using a 3D laser scanner to collect rail profile image data; performing spatiotemporal calibration on the collected rail profile image data to obtain corrected rail profile data; substituting the corrected rail profile data and the standard rail profile data into the trained profile detection model to obtain a profile damage score; and judging the rail damage according to the profile damage score. The 3D laser rail profile detection method uses a 3D laser scanner to collect rail profile image data, performs spatiotemporal calibration on the collected rail image data, and then performs calculations to obtain a profile damage score, and judges the rail damage according to the profile damage score. The entire process of the invention method does not require manual judgment of whether the profile has defects, and has the advantages of high accuracy and high detection efficiency.
[0007] Document 3 is a Chinese invention application filed by the University of Science and Technology Beijing on August 3, 2023, and published on June 22, 2016, with the publication number CN116678321A. The application discloses a rail wear measurement method and device, the method comprising: using at least two sets of laser sources to simultaneously project laser lines onto the rail surface, the two projected laser lines are located in the same plane, and cover all cross-sectional parts except the rail bottom; using at least two sets of black and white cameras to shoot the laser lines and save them as original images; binarizing the original images; performing profile curve refinement processing on the binarized images; extracting profile curves from the refined images; correcting the extracted profile curves according to the system calibration results; splicing the images obtained by the two cameras after the above steps; applying the iterative closest point method to the spliced images to align with the standard profile curve; and using the combined measurement method to obtain the horizontal wear value and the vertical wear value according to the alignment results. The invention can improve the accuracy of rail wear measurement.
[0008] Document 4 is a Chinese invention application filed by Hefei Fuhuang Junda Hi-Tech Information Technology Co., Ltd. on November 8, 2022, and published on June 22, 2016, with publication number CN115311481A. The application discloses a rail profile alignment method and device, a rail wear calculation method and device, the method comprising obtaining a rail profile collection point set, obtaining a first feature collection point based on the collection point set; obtaining a second feature collection point in the rail profile collection point set based on the positional relationship between the first feature collection point pairing point in the standard profile and the preset second feature collection point pairing point in the standard profile; obtaining initial affine transformation parameters based on the first feature collection point, the second feature collection point, the first feature collection point pairing point and the second feature collection point pairing point; based on the initial affine transformation parameters, using the ICP algorithm to iteratively search for the optimal affine transformation parameters between the rail profile collection point set and the standard profile point set, and obtaining the standard profile pairing point set aligned with the rail profile collection point set under the optimal affine transformation parameters. This invention greatly improves the robustness of rail profile matching.
[0009] The above applications all involve the alignment of the rail profile with the standard profile, among which Document 1 and Document 2 are based on the positioning and alignment of the rail profile features to achieve high-precision measurement in complex environments. Documents 3 and 4 both use the ICP iterative algorithm, which has the problem of low matching efficiency, being greatly affected by outlier noise, and easily failing to converge to the best match. Documents 3 and 4 both use the traditional ICP algorithm based on the point-to-point distance measurement method, which has slow convergence efficiency and low matching accuracy. In addition, Document 4 uses positioning and coarse matching based on rail profile features, which is prone to coarse matching errors in cases of excessive wear. Summary of the invention
[0010] In view of this, the purpose of the present application is to provide a method for fast matching of rail profiles to solve the technical problems of slow convergence efficiency and low matching accuracy of existing profile matching methods.
[0011] In order to achieve the above-mentioned invention object, the present application specifically provides a technical implementation scheme of a rail profile rapid matching method, comprising the following steps:
[0012] S0) Input the collected rail profile, the number of collected points is N;
[0013] S1) Transforming the rail profile;
[0014] S2) searching for matching points of transformed silhouette;
[0015] S3) sorting all matching points according to the distance from large to small and filtering N / 2 points with relatively large distance;
[0016] S4) determining whether the distance of the N1th point is less than a given threshold T1;
[0017] S5) If yes, the loss function coefficient is set to K1;
[0018] S6) if otherwise the loss function coefficient is set to K2;
[0019] S7) using the first N / 2 points to perform nonlinear optimization to obtain the current optimal matching matrix;
[0020] S8) determining whether the change in the matching matrix parameter is less than a given threshold, if not, returning to step S1) to execute;
[0021] S9) determining the number of points N2 at which the distance between the transformed silhouette and the standard silhouette matching point is less than a threshold value T3;
[0022] S10) Determine whether the number of points N2 is greater than a given number of points threshold T4. If so, the match is successful and the optimal matching matrix is obtained. Otherwise, the match fails.
[0023] Furthermore, in the step S0), the light plane of the line laser camera is used to illuminate one side of the rail, and the profile of the one side of the rail is obtained by the camera.
[0024]
[0025] Among them, p i are the homogeneous coordinates of the contour points, and N is the number of contour points.
[0026] Furthermore, the step S1) further comprises:
[0027] In the initial state, a reasonable initial transformation matrix P0 is found based on experience, and the collected rail profile Transform to get the initial transformation profile is the transformed silhouette after the k-th optimization;
[0028]
[0029] Among them, θ,t x ,t z They are respectively the rotation angle, x-direction translation and z-direction translation of the profile.
[0030] Further, the step S2) includes:
[0031] For the transformed silhouette Each contour point Find the closest point in the standard template silhouette as the matching point and its corresponding matching point normal At the same time, get the distance between each point and the matching point
[0032] Further, in step S2), the KD tree algorithm is used to find the contour points corresponding to each contour point in the standard template. The nearest point is used as the matching point and its corresponding matching point normal
[0033] Further, the step S3) includes:
[0034] Based on the distance between each point and its matching point Sort from smallest to largest.
[0035] Further, the step S7) includes: filtering the data by data truncation, using only the first N / 2 contour points after sorting for optimization, and discarding the N / 2 points with too large errors. The following optimization function is used to optimize each point p in the measured contour i To the standard profile curve matching point p′ i The distance d i , and the perpendicular line from the point to the standard profile curve and the normal line n of the perpendicular point i The angle between the measured and standard profiles is as close as possible to the measured profile curve:
[0036]
[0037] in, They are the silhouettes after the last transformation. The matching points and matching point normals corresponding to each point on the graph are shown in Figure 1. T is the matrix transpose. The current optimal transformation matrix P is obtained through nonlinear optimization. k , and the corresponding transformed silhouette
[0038] Furthermore, in step S7), the following optimization function is used for nonlinear optimization:
[0039]
[0040] Among them, a is the loss function coefficient, the value range of a is (0, 1], and s is the matching error.
[0041] Furthermore, the steps S4) to S6) include:
[0042] According to experience, the threshold is set to judge the sequence number N1, and the transformed profile after sorting Find the N1th point. When the matching point distance is greater than the given distance threshold T1, it is considered that the matching effect is poor and a smaller loss function coefficient a=K2 is used. Otherwise, a larger loss function coefficient a=K1 is used.
[0043] Further, the step S8) includes:
[0044] By optimizing the change in parameters, that is, the transformation matrix P k The parameter θ,t x ,t z The change in θ k -θ k-1 ,
[0045] Are they less than the given threshold T? θ , Determine whether the optimization has converged. If not, return to step S1) to execute.
[0046] Further, the step S9) includes:
[0047] When the algorithm converges, determine the distance between each point of the transformed silhouette and the matching point The number of contour points N2 that is less than a given threshold T3.
[0048] Further, the step S10) includes:
[0049] When the number of points N2 is greater than the given minimum matching point threshold T4, the silhouette matching is determined to be successful and the final transformation matrix P is returned. k , otherwise the silhouette matching is judged to have failed.
[0050] By implementing the technical solution of the rail profile rapid matching method provided by the present application, the following beneficial effects are achieved:
[0051] (1) The rail profile fast matching method of the present application regards the two-dimensional rail profile as a continuous surface and applies the closest point iterative algorithm based on point-line measurement to rail profile matching. Thanks to the more reasonable measurement method and secondary convergence speed, the matching convergence speed is greatly improved, and the convergence residual is much smaller than the traditional closest point iterative algorithm, which greatly improves the matching accuracy.
[0052] (2) The rail profile fast matching method of the present application adopts the Cauchy dynamic loss function, which reduces the weight of the loss function when the matching effect is poor, and increases the weight of the loss function when the matching degree meets the set conditions, so as to obtain a smaller matching residual, thereby effectively suppressing the interference of outlier data;
[0053] (3) The fast rail profile matching method of the present application, the dynamic update of the loss function coefficient reduces the technical problem that the algorithm cannot converge due to poor initial state estimation, avoids excessive reliance on rough profile matching, and has higher robustness;
[0054] (4) In the rail profile rapid matching method of the present application, since the offset and angle range of the profile in the imaging field of view in actual imaging are limited, there is no need for coarse matching, and the final matching residual obtained is small, which improves the matching repeatability. When the profile position is reasonable, coarse matching is not required, and the stability is higher. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other embodiments can be obtained based on these drawings without creative work.
[0056] Figure 1 This is a flowchart of a specific embodiment of the rail profile rapid matching method of the present application;
[0057] Figure 2 This is a schematic diagram of rail profile acquisition based on line laser in a specific embodiment of the rail profile fast matching method of the present application;
[0058] Figure 3 This is a schematic diagram of rail profile matching of a specific embodiment of the rail profile rapid matching method of the present application;
[0059] Figure 4It is a schematic diagram comparing a Cauchy loss function and a square loss function in a specific embodiment of the rail profile fast matching method of the present application;
[0060] Figure 5 It is a comparative schematic diagram of Cauchy loss functions with different coefficients in a specific embodiment of the rail profile fast matching method of the present application;
[0061] Figure 6 This is a system structure composition principle block diagram of a specific embodiment of a rail profile quick matching device based on the method of the present application;
[0062] In the figure: 1-rail profile acquisition unit, 2-profile transformation unit, 3-nearest matching point search unit, 4-effective matching point sorting and filtering unit, 5-loss function coefficient evaluation unit, 6-nonlinear optimization unit, 7-matching effect evaluation unit, 8-rail, 9-standard template profile, 10-measured profile, 20-matched profile. DETAILED DESCRIPTION
[0063] For the purpose of reference and clarity, the technical terms, abbreviations or abbreviations used below are recorded as follows:
[0064] ICP: Iterative Closest Point, point cloud registration algorithm, a closest point iterative algorithm;
[0065] Cauchy: A loss function that assigns different penalty weights to different error sizes in the optimization function;
[0066] KD-tree: A fast closest point search algorithm.
[0067] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0068] As attached Figure 1 To Attachment Figure 6 As shown, a specific embodiment of the rail profile rapid matching method of the present application is given, and the present application is further explained below in conjunction with the drawings and specific embodiments.
[0069] Example 1
[0070] In response to the deficiencies in the prior art, Example 1 of the present application provides a method for fast matching of rail profiles based on point-line metric ICP (Iterative Closest Point, point cloud registration algorithm) and dynamic loss function, which has fast convergence speed, high robustness, and low dependence on initial state estimation.
[0071] As attached Figure 1 As shown, an embodiment of the rail profile rapid matching method of the present application specifically includes the following steps:
[0072] S0) Input the collected rail profile, the number of collected points is N;
[0073] S1) Transforming the rail profile;
[0074] S2) searching for matching points of transformed silhouette;
[0075] S3) sorting all matching points according to the distance from large to small and filtering N / 2 points with relatively large distance;
[0076] S4) determining whether the distance of the N1th point is less than a given threshold T1;
[0077] S5) If yes, the loss function coefficient is set to K1;
[0078] S6) if otherwise the loss function coefficient is set to K2;
[0079] S7) using the first N / 2 points to perform nonlinear optimization to obtain the current optimal matching matrix;
[0080] S8) determining whether the change in the matching matrix parameter is less than a given threshold, if not, returning to step S1) to execute;
[0081] S9) determining the number of points N2 at which the distance between the transformed silhouette and the standard silhouette matching point is less than a threshold value T3;
[0082] S10) Determine whether the number of points N2 is greater than a given number of points threshold T4. If so, the match is successful and the optimal matching matrix is obtained. Otherwise, the match fails.
[0083] As attached Figure 3 As shown, in step S0), the light plane of the line laser camera is used to illuminate one side of the rail, and the profile of one side of the rail is obtained by the camera.
[0084]
[0085] Among them, p i are the homogeneous coordinates of the contour points, and N is the number of contour points.
[0086] The key to the fast rail profile matching method is to find an optimal transformation matrix P0 so that the profile obtained after transforming each point of the measured profile 10 is It overlaps with the standard template profile 9, and 10 is the matching profile, as shown in the attached figure. Figure 4 Step S1) further comprises:
[0087] In the initial state, a reasonable initial transformation matrix P0 is found based on experience, and the collected rail profile Transform to get the initial transformation profile is the transformed silhouette after the k-th optimization;
[0088]
[0089] Among them, θ,t x ,t z They are respectively the rotation angle, x-direction translation and z-direction translation of the profile.
[0090] Step S2) further comprises:
[0091] For the transformed silhouette Each contour point Find the closest point in the standard template silhouette as the matching point and its corresponding matching point normal At the same time, get the distance between each point and the matching point The distance d between the matching point and the standard profile normal n is shown in the attached figure. Figure 4 shown.
[0092] As a typical specific embodiment of the present application, in step S2), a KD tree algorithm is used to find the points corresponding to each contour point in the standard template contour. The nearest point is used as the matching point and its corresponding matching point normal
[0093] Step S3) further comprises:
[0094] In order to facilitate subsequent operations, the distance between each point and its matching point is Sort from smallest to largest.
[0095] Step S7) further includes: filtering the data by data truncation, using only the first N / 2 contour points after sorting for optimization, discarding N / 2 points with too large errors, and further reducing the influence of outlier noise.
[0096] This embodiment uses a point-line metric method for optimization, that is, the following optimization function is used to optimize each point p in the measurement profile:i To the standard profile curve matching point p′ i The distance d i , and the perpendicular line from the point to the standard profile curve and the normal line n of the perpendicular point i The angle between the vertical line and the normal line is , so that the measured profile fits the standard profile curve as closely as possible. It can be expressed by the dot product of the vertical line and the normal line, that is, the following optimization function is used:
[0097]
[0098] in, They are the silhouettes after the last transformation. The matching points and matching point normals corresponding to each point on the graph are shown in Figure 1. T is the matrix transpose. The current optimal transformation matrix P is obtained through nonlinear optimization. k , and the corresponding transformed silhouette
[0099] The square error loss used in the prior art has poor anti-interference performance against outliers. This embodiment uses the Cauchy loss function to reduce the technical problem of non-convergence caused by excessive outlier errors. In step S7), the following optimization function is further used for nonlinear optimization:
[0100]
[0101] in:
[0102] ρ(s)=log(1+s)
[0103] As attached Figure 5 As shown in the figure, it is a comparison between the Cauchy loss function and the square loss function. The weight of the Cauchy loss function is higher than that of the square loss function when the error is small, and is much smaller than the square loss function when the error is large, thus avoiding the interference of excessive outlier noise errors.
[0104] In order to avoid the failure of convergence caused by a large error between the measured profile and the standard profile at the initial position, this embodiment adopts a dynamic Cauchy loss function:
[0105]
[0106] Among them, a is the loss function coefficient, and the value range of a is (0, 1], and s is the matching error. When the measured silhouette differs too much from the standard silhouette, the coefficient a takes a smaller value to reduce the error penalty weight; when the silhouette is close to the standard silhouette, a takes a larger value to ensure the precision of the matching. The loss function comparison of different coefficients is shown in the following figure. Figure 6 shown.
[0107] Steps S4) to S6) further include:
[0108] According to experience, the threshold is set to judge the sequence number N1, and the transformed profile after sorting Find the N1th point. When the matching point distance is greater than the given distance threshold T1, it is considered that the matching effect is poor and a smaller loss function coefficient a=K2 is used. Otherwise, a larger loss function coefficient a=K1 is used.
[0109] In step S7), the data is filtered by data truncation, that is, only the first N / 2 contour points after sorting are used for optimization, and N / 2 points with relatively large errors are discarded, further reducing the impact of outlier noise.
[0110] Step S8) further comprises:
[0111] By optimizing the change in parameters, that is, the transformation matrix P k The parameter θ,t x ,t z The change in θ k -θ k-1 ,
[0112] Are they less than the given threshold T? θ , Determine whether the optimization has converged. If not, return to step S1) to perform matching point search and nonlinear optimization process.
[0113] Step S9) further comprises:
[0114] When the optimization converges, determine the distance between each point of the transformed silhouette and the matching point The number of contour points N2 that is less than a given threshold y3.
[0115] Step S10) further comprises:
[0116] When the number of points N2 is greater than the given minimum matching point threshold T4, the silhouette matching is determined to be successful and the final transformation matrix P is returned. k , otherwise the silhouette matching is judged to have failed.
[0117] The rail profile fast matching method described in Example 1 of the present application aims to solve the technical problems existing in the traditional ICP algorithm, and adopts the ICP algorithm based on point-line metric to achieve fast convergence at the square level and high-precision rail profile matching. It combines the dynamic Cauchy loss function with the outlier data removal strategy, and effectively reduces the interference of outlier data points on rail profile matching. At the same time, the dynamic update of the loss function coefficients also reduces the problem of non-convergence caused by poor initial state estimation, avoids the reliance on rough matching of the profile, and has higher robustness.
[0118] Example 2
[0119] As attached Figure 6 As shown, an embodiment of a rail profile fast matching device based on the method described in Example 1 specifically includes: a rail profile acquisition unit 1, a profile transformation unit 2, a nearest matching point search unit 3, an effective matching point sorting and filtering unit 4, a loss function coefficient evaluation unit 5, a nonlinear optimization unit 6 and a matching effect evaluation unit 7. The rail profile acquisition unit 1 collects the rail profile, and the profile transformation unit 2 performs profile transformation according to the input rail profile. The nearest matching point search unit 3 searches for matching points on the transformed profile and outputs a matching point sequence to the effective matching point sorting and filtering unit 4. The effective matching point sorting and filtering unit 4 sorts all matching points from large to small according to the distance and filters N / 2 points with relatively large distances. The loss function coefficient evaluation unit 5 determines whether the distance of the N1th point is less than a given threshold □1. If so, the loss function coefficient is set to L1, otherwise the loss function coefficient is set to K2, and the loss function coefficient is output to the nonlinear optimization unit 6. The nonlinear optimization unit 6 uses the first N / 2 points for nonlinear optimization according to the matching point ranking, obtains the current optimal matching matrix and outputs it to the matching effect evaluation unit 7. The matching effect evaluation unit 7 determines the number of points N2 whose distance between the transformed silhouette and the standard silhouette matching point is less than the threshold T3, and determines whether the number of points N2 is greater than a given point threshold T4. If so, the match is successful and the optimal matching matrix is obtained.
[0120] The rail profile acquisition unit 1 further uses the light plane of the line laser camera to illuminate one side of the rail 8, and acquires the profile of one side of the rail through the camera.
[0121]
[0122] Among them, p i are the homogeneous coordinates of the silhouette points, and N is the number of collection points of the silhouette.
[0123] The profile transformation unit 2 finds a reasonable initial transformation matrix P0 based on experience in the initial state, and transforms the collected rail profile Transform to get the initial transformation profile is the transformed silhouette after the k-th optimization.
[0124]
[0125] Among them, θ,t x ,t z They are respectively the rotation angle, x-direction translation and z-direction translation of the profile.
[0126] The nearest matching point search unit 3 searches for the transformed silhouette Each contour point Find the closest point in the standard template silhouette as the matching point and its corresponding matching point normal At the same time, get the distance between each point and the matching point
[0127] The nearest matching point search unit 3 further finds the nearest matching point in the standard template silhouette by using the KD tree algorithm. The nearest point is used as the matching point and its corresponding matching point normal
[0128] The effective matching point sorting and filtering unit 4 is based on the distance between each point and its matching point. Sort from smallest to largest.
[0129] The nonlinear optimization unit 6 further uses data truncation to filter the data, using only the first N / 2 contour points after sorting for optimization, and discarding the N / 2 points with too large errors. The following optimization function is used to optimize each point p in the measured contour i To the standard profile curve matching point p′ i The distance d i , and the perpendicular line from the point to the standard profile curve and the normal line n of the perpendicular point i The angle between the measured and standard profiles is as close as possible to the measured profile curve:
[0130]
[0131] in, They are the silhouettes after the last transformation. The matching points and matching point normals corresponding to each point on the graph are shown in Figure 1. T is the matrix transpose. The current optimal transformation matrix P is obtained through nonlinear optimization. k , and the corresponding transformed silhouette
[0132] The nonlinear optimization unit 6 further uses the following optimization function to perform nonlinear optimization:
[0133]
[0134] Among them, a is the loss function coefficient, the value range of a is (0, 1], and s is the matching error.
[0135] The loss function coefficient evaluation unit 5 sets a threshold value based on experience to determine the sequence number N1. Find the N1th point. When the matching point distance is greater than the given distance threshold T1, it is considered that the matching effect is poor and a smaller loss function coefficient a=K2 is used. Otherwise, a larger loss function coefficient a=K1 is used.
[0136] The nonlinear optimization unit 6 optimizes the change of the parameters, that is, the transformation matrix P k The parameter θ,t x ,t z The change in θ k -θ k-1 , Are they less than the given threshold T? θ , Determine whether the optimization has converged. If not, re-transform the rail profile.
[0137] When the optimization converges, the matching effect evaluation unit 7 determines the distance between each point of the transformed outline and the matching point. The number of contour points N2 that is less than a given threshold T3.
[0138] When the number of points N2 is greater than the given minimum matching point threshold T4, the matching effect evaluation unit 7 determines that the silhouette matching is successful and returns the final transformation matrix P to the silhouette transformation unit 2. k , otherwise the silhouette matching is judged to have failed.
[0139] In the description of this application, it should be noted that when an element is referred to as being "fixed to" or "disposed on" another element, it can be directly disposed on the other element or indirectly disposed on the other element. When an element is referred to as being "connected to" another element, it can be directly connected to the other element or indirectly connected to the other element.
[0140] It should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present application.
[0141] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this application, "multiple" and "several" mean two or more, unless otherwise clearly and specifically defined.
[0142] It should be noted that the structures, proportions, sizes, etc. illustrated in the drawings of this specification are only used to match the contents disclosed in the specification for people familiar with this technology to understand and read, and are not used to limit the conditions under which this application can be implemented. Therefore, they have no substantive technical significance. Any structural modification, change in proportional relationship or adjustment of size should still fall within the scope of the technical content disclosed in this application without affecting the effects and purposes that can be achieved by this application.
[0143] By implementing the technical solution of the rail profile rapid matching method described in the specific embodiment of the present application, the following technical effects can be achieved:
[0144] (1) The rail profile fast matching method described in the specific embodiment of the present application regards the two-dimensional rail profile as a continuous surface, and applies the closest point iterative algorithm based on point-line measurement to rail profile matching. Thanks to the more reasonable measurement method and secondary convergence speed, the matching convergence speed is greatly improved, and the convergence residual is much smaller than the traditional closest point iterative algorithm, which greatly improves the matching accuracy;
[0145] (2) The rail profile fast matching method described in the specific embodiment of the present application adopts the Cauchy dynamic loss function, which reduces the weight of the loss function when the matching effect is poor, and increases the weight of the loss function when the matching degree meets the set conditions, so as to obtain a smaller matching residual, thereby effectively suppressing the interference of outlier data;
[0146] (3) The rail profile fast matching method described in the specific embodiment of the present application, the dynamic update of the loss function coefficient reduces the technical problem that the algorithm cannot converge due to poor initial state estimation, avoids excessive reliance on rough matching of the profile, and has higher robustness;
[0147] (4) The rail profile fast matching method described in the specific embodiment of the present application does not require coarse matching because the offset and angle range of the profile in the imaging field of view in actual imaging is limited, and the final matching residual is small, which improves the matching repeatability. When the profile position is reasonable, coarse matching is not required, and the stability is higher.
[0148] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0149] The above is only a preferred embodiment of the present application, and does not constitute any formal limitation to the present application. Although the present application has been disclosed as above with a preferred embodiment, it is not intended to limit the present application. Any technician familiar with the art can use the above disclosed methods and technical contents to make many possible changes and modifications to the technical solution of the present application, or modify it into an equivalent embodiment of equivalent changes, without departing from the spirit and technical solution of the present application. Therefore, any simple modification, equivalent replacement, equivalent change and modification made to the above embodiments according to the technical essence of the present application, which does not depart from the content of the technical solution of the present application, still falls within the scope of protection of the technical solution of the present application.
Claims
1. A rail profile rapid matching method, characterized in that: The following steps are involved: S0) Input the collected rail profile, the number of collected points is N; S1) Transforming the rail profile; S2) searching for matching points of transformed silhouette; S3) sorting all matching points according to the distance from large to small and filtering N / 2 points with relatively large distance; S4) determining whether the distance of the N1th point is less than a given threshold T1; S5) If yes, the loss function coefficient is set to K1; S6) if otherwise the loss function coefficient is set to K2; S7) using the first N / 2 points to perform nonlinear optimization to obtain the current optimal matching matrix; S8) determining whether the change in the matching matrix parameter is less than a given threshold, if not, returning to step S1) to execute; S9) determining the number of points N2 at which the distance between the transformed silhouette and the standard silhouette matching point is less than a threshold value T3; S10) Determine whether the number of points N2 is greater than a given number of points threshold T4. If so, the match is successful and the optimal matching matrix is obtained. Otherwise, the match fails.
2. The rail profile rapid matching method according to claim 1, characterized in that: In step S0), the light plane of the line laser camera is used to illuminate one side of the rail, and the profile of the rail is obtained by the camera. Among them, p i are the homogeneous coordinates of the contour points, and N is the number of contour points.
3. The rail profile rapid matching method according to claim 2, characterized in that: The step S1) further comprises: In the initial state, a reasonable initial transformation matrix P0 is found based on experience, and the collected rail profile Transform to get the initial transformation profile is the transformed silhouette after the k-th optimization; Among them, θ,t x , t z They are respectively the rotation angle, x-direction translation and z-direction translation of the profile.
4. The rail profile rapid matching method according to claim 3, characterized in that: The step S2) further comprises: For the transformed silhouette Each contour point Find the closest point in the standard template silhouette as the matching point and its corresponding matching point normal At the same time, get the distance between each point and the matching point 5. The rail profile rapid matching method according to claim 4, characterized in that: In step S2), the KD tree algorithm is used to find the points corresponding to each contour point in the standard template. The nearest point is used as the matching point and its corresponding matching point normal 6. The rail profile rapid matching method according to claim 5, characterized in that: The step S3) further comprises: Based on the distance between each point and its matching point Sort from smallest to largest.
7. The rail profile rapid matching method according to claim 6, characterized in that: The step S7) further includes: filtering the data by data truncation, using only the first N / 2 contour points after sorting for optimization, and discarding the N / 2 points with too large errors; optimizing each point p in the measured contour by using the following optimization function i To the standard profile curve matching point p′ i The distance d i , and the perpendicular line from the point to the standard profile curve and the normal line n of the perpendicular point i The angle between the measured and standard profiles is as close as possible to the measured profile curve: in, They are the silhouettes after the last transformation. The matching points and matching point normals corresponding to each point on the graph are shown in Figure 1. T is the matrix transpose. The current optimal transformation matrix P is obtained through nonlinear optimization. k , and the corresponding transformed silhouette 8. The rail profile rapid matching method according to claim 7, characterized in that: In the step S7), the following optimization function is further used for nonlinear optimization: Among them, a is the loss function coefficient, the value range of a is (0, 1], and s is the matching error.
9. The rail profile rapid matching method according to claim 8, characterized in that: The steps S4) to S6) further include: According to experience, the threshold is set to judge the sequence number N1, and the transformed profile after sorting Find the N1th point. When the matching point distance is greater than the given distance threshold T1, it is considered that the matching effect is poor and a smaller loss function coefficient a=K2 is used. Otherwise, a larger loss function coefficient a=K1 is used.
10. The rail profile rapid matching method according to claim 7, 8 or 9, characterized in that: The step S8) further comprises: By optimizing the change in parameters, that is, the transformation matrix P k The parameter θ,t x , t z The change in θ k -θ k-1 , Are they less than the given threshold T? θ , Determine whether the optimization has converged. If not, return to step S1) to execute.
11. The rail profile rapid matching method according to claim 10, characterized in that: The step S9) further comprises: When the optimization converges, determine the distance between each point of the transformed silhouette and the matching point The number of contour points N2 that is less than a given threshold T3.
12. The rail profile rapid matching method according to claim 11, characterized in that: The step S10) further comprises: When the number of points N2 is greater than the given minimum matching point threshold T4, the silhouette matching is determined to be successful and the final transformation matrix P is returned. k , otherwise the silhouette matching is judged to have failed.
Citation Information
Patent Citations
Steel rail profile alignment method and device, and steel rail abrasion calculation method and device
CN108896000A
3D laser steel rail profile detection method and system based on space-time calibration
CN114987577A
Steel rail contour automatic matching method and device based on linear structured light
CN115311481A
Steel rail abrasion measuring method and device
CN116678321A