Steel rail head profile registration method and system, electronic equipment and program product
By obtaining the profile segment of the unworn area for rail head profile alignment and combining it with rotation and translation matrix adjustment, the accuracy and efficiency issues caused by the lack of rail waist data are solved, and efficient and accurate rail head profile automatic alignment is achieved.
Patent Information
- Application Number
- CN202510721028.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-30
- Publication Date
- 2025-09-12
AI Technical Summary
Existing rail head profile registration methods have low accuracy and efficiency when rail waist data is missing or the rail waist shape changes, and cannot meet the needs of high-precision and high-efficiency automated inspection.
The profile of the unworn area of the rail head to be inspected is obtained as the profile segment to be registered, and the profile of the unworn area of the standard rail head is combined as the reference profile segment. Through one-time registration and correction matrix adjustment, automatic registration of the rail head profile is achieved, including optimization of rotation, translation and Euclidean distance errors.
In the scenario where there is no track waist data, high-precision and high-efficiency rail head profile alignment is achieved, avoiding the accumulation of rail waist data errors and improving alignment efficiency and accuracy.
Smart Images

Figure CN120635000A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of rail detection, and in particular relates to a rail head profile registration method, system, electronic equipment and program product. Background Art
[0002] Rails are the primary components of railway tracks, directly supporting and guiding the wheels of rolling stock. To ensure safe operation, rail wear must be regularly inspected. Because the rail head has a more complex geometry than the waist, and due to the dynamic effects of the vehicle, the rail head can experience significant deformation, while the waist's geometry is generally more stable. The wear on the rail head generally reflects the overall wear of the rail. To achieve this, the profile of the rail head to be inspected must be aligned with that of a standard rail head, and the wear on the rail head can then be confirmed.
[0003] Traditional rail head profile alignment methods often rely on manual operation for alignment and matching, primarily through visual inspection and manual adjustment. During manual alignment, operators typically view the track geometry on a display or computer interface, manually adjust the positions of different rail head profiles, and then visually determine whether the rail head profiles are aligned. However, this method is inefficient and susceptible to human factors, making it unable to meet the requirements of high-precision, high-efficiency automated inspection.
[0004] To address the low accuracy and efficiency of manual registration, a point-to-point registration geometric fitting method has emerged in the prior art. This method first obtains point cloud data of the track profile to be inspected, then matches the rail waist points with the standard rail waist points point by point. The distance between each point is calculated to gradually adjust the registration parameters to minimize the matching error, thereby achieving rail waist registration and ultimately aligning the rail head profile to calculate the rail head wear value. However, the inventors have discovered that this prior art has at least the following problems:
[0005] First, in the actual process of rail data collection, there are situations where the collection equipment is unable to collect rail waist data due to different collection requirements, or fails to collect rail waist data due to collection errors and other reasons. As a result, in the scenario where rail waist data is missing, the existing rail waist-based alignment method cannot be used to achieve rail head profile alignment.
[0006] Secondly, during track operation, the rail waist may undergo local bending or twisting due to factors such as wheel pressure and weather changes. This will result in the geometric shape of the rail waist being unable to be accurately mapped to the actual shape of the rail head during the registration process based on the rail waist, resulting in error accumulation and reduced rail head profile registration accuracy. In order to compensate for the problem of rail head profile registration deviation, multiple iterations are usually required to optimize the registration results, which increases calculation time and reduces registration efficiency. Summary of the Invention
[0007] The present invention aims to at least to some extent solve the above-mentioned technical problem that it is not applicable to the scenario where rail waist data is missing, and the alignment accuracy and efficiency need to be further improved. The present invention provides a rail head profile alignment method, system, electronic equipment and program product.
[0008] In order to achieve the above object, the present invention adopts the following technical solutions:
[0009] In a first aspect, the present invention provides a rail head profile registration method, comprising:
[0010] Acquire a measured rail head profile of the rail head to be inspected, and extract the profile of an unworn area in the measured rail head profile as a profile segment to be registered;
[0011] Acquiring a standard rail head profile, and extracting a profile of a profile area corresponding to the unworn area in the standard rail head profile as a reference profile segment;
[0012] Performing a registration on the to-be-registered profile segment and the reference profile segment, and obtaining an initial registration matrix that matches the to-be-registered profile segment to the reference profile segment;
[0013] Correcting the initial registration matrix to obtain a corrected registration matrix;
[0014] According to the corrected registration matrix, the measured rail head profile where the profile segment to be registered is located is translated and / or rotated according to the corrected registration matrix, thereby achieving registration between the measured rail head profile and the standard rail head profile.
[0015] In one possible design, performing a registration on the to-be-registered profile segment and the reference profile segment, and obtaining an initial registration matrix that matches the to-be-registered profile segment to the reference profile segment, includes:
[0016] The reference profile segment is rotated with the initial point of the reference profile segment as the center of the circle to obtain a rotated reference profile segment; wherein the rotated reference profile segment shows a monotonically increasing and / or monotonically decreasing trend;
[0017] Extracting a set of feature points to be registered from the profile segment to be registered, and constructing a shape-preserving invariant constraint condition based on the set of feature points to be registered;
[0018] Using a conformal transformation method, the feature point set to be registered is sequentially mapped to different candidate point sets of the rotated reference silhouette segment, all candidate point sets of the rotated reference silhouette segment are traversed, and the best candidate point set that satisfies the conformal invariant constraint is selected;
[0019] A registration matrix that maps the feature point set to be registered to the optimal candidate point set is obtained, and the registration matrix is used as an initial registration matrix for matching the silhouette segment to be registered to the reference silhouette segment.
[0020] In one possible design, the set of feature points to be registered includes a starting point to be registered and an end point to be registered; the conformal invariant constraint conditions include: the distance between any two endpoints in the rotated reference contour segment is consistent with the length of the line between the starting point to be registered and the end point to be registered, and the area of the figure enclosed by the section where the two endpoints are located and the rotated reference contour segment is minimally different from the area of the figure enclosed by the section where the starting point to be registered and the end point to be registered and the contour segment to be registered.
[0021] In one possible design, any candidate point set of the rotated reference profile segment includes any endpoint corresponding to the start point to be registered and another endpoint corresponding to the end point to be registered in the rotated reference profile segment, and the distance between the two endpoints is consistent with the length of the line between the start point to be registered and the end point to be registered; correspondingly, mapping the feature point set to be registered to any candidate point set of the rotated reference profile segment using a conformal transformation method includes:
[0022] Mapping the starting point to be registered to any end point of the rotated reference profile segment;
[0023] Obtain the distance between the rotated reference profile segment and any endpoint, another endpoint having the same length as the line between the start point to be registered and the end point to be registered, and map the end point to be registered to the other endpoint.
[0024] In one possible design, the initial registration matrix is corrected to obtain a corrected registration matrix, including:
[0025] Obtaining a preset correction value range, and adjusting the initial registration matrix within the correction value range to obtain an adjusted correction matrix;
[0026] Obtaining the adjusted silhouette segment to be registered after the silhouette segment to be registered is translated and / or rotated according to the adjusted correction matrix;
[0027] Calculating the Euclidean distance error between the adjusted silhouette segment to be registered and the reference silhouette segment;
[0028] With the goal of minimizing the Euclidean distance error, adjusting the initial registration matrix within the correction value range, and obtaining a correction value that minimizes the Euclidean distance error;
[0029] The initial registration matrix is adjusted according to the correction value that minimizes the Euclidean distance error to obtain a corrected registration matrix.
[0030] In one possible design, the initial registration matrix includes an initial translation matrix and an initial rotation matrix, and the corrected registration matrix includes a corrected translation matrix and a corrected rotation matrix; correspondingly, the correction value range includes a translation correction value range corresponding to the initial translation matrix and a rotation angle correction range corresponding to the initial rotation matrix, and the correction value that minimizes the Euclidean distance error includes a translation correction value and a rotation angle correction value that minimize the Euclidean distance error.
[0031] In one possible design, the Euclidean distance error adopts the average Euclidean distance.
[0032] In a second aspect, the present invention provides a rail head profile registration system, comprising:
[0033] a measured profile acquisition module, configured to acquire the measured rail head profile of the rail head to be inspected, and extract the profile of the unworn area in the measured rail head profile as the profile segment to be registered;
[0034] a reference profile acquisition module, configured to acquire a standard rail head profile, and extract a profile of a profile area corresponding to the unworn area in the standard rail head profile as a reference profile segment;
[0035] a primary registration module, respectively connected to the measured profile acquisition module and the reference profile acquisition module, for performing a primary registration on the profile segment to be registered and the reference profile segment, and obtaining an initial registration matrix for matching the profile segment to be registered to the reference profile segment;
[0036] A secondary registration module is communicatively connected to the primary registration module and is used to correct the initial registration matrix to obtain a corrected registration matrix; and is also used to translate and / or rotate the measured rail head profile where the profile segment to be registered is located according to the corrected registration matrix, thereby achieving registration between the measured rail head profile and the standard rail head profile.
[0037] In a third aspect, the present invention provides an electronic device, comprising:
[0038] a memory for storing computer program instructions; and
[0039] A processor is configured to execute the computer program instructions to thereby complete the operation of a rail head profile registration method as described in any one of the above.
[0040] In a fourth aspect, the present invention provides a computer program product, comprising a computer program or instructions, which, when executed by a computer, implements a rail head profile registration method as described in any one of the above.
[0041] The beneficial effects of the present invention are:
[0042] The present invention discloses a rail head profile registration method, system, electronic device and program product, which can independently perform rail head profile registration, can be applied to scenes without rail waist data, and have high registration accuracy and efficiency. During the implementation of the present invention, the profile of the unworn area in the measured rail head profile of the rail head to be detected is selected as the profile segment to be registered, and the profile of the profile area corresponding to the unworn area in the standard rail head profile is selected as the reference profile segment; then, the profile segment to be registered and the reference profile segment are registered once, and an initial registration matrix is obtained for matching the profile segment to be registered to the reference profile segment; then, the initial registration matrix is corrected to obtain a corrected registration matrix, and then, according to the corrected registration matrix, the measured rail head profile where the profile segment to be registered is located is translated and / or rotated according to the corrected registration matrix, thereby achieving registration between the measured rail head profile and the standard rail head profile. Based on this, the present invention can realize automatic alignment of the rail head profile without relying on rail waist data, and can be applied to scenarios where there is no rail waist data, avoiding the calculation of rail waist alignment and the error accumulation caused by rail waist data, thereby improving the efficiency and accuracy of rail head profile alignment.
[0043] Other beneficial effects of the present invention will be further described in the detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 is a flow chart of the rail head profile registration method in Example 1;
[0045] Figure 2 It is a schematic diagram of the standard rail head profile and the reference profile segment;
[0046] Figure 3 It is a schematic diagram of the reference profile segment after rotation;
[0047] Figure 4 Schematic diagram of extracting a set of feature points to be registered from the contour segment to be registered;
[0048] Figure 5is a schematic diagram of extracting the best candidate point set from the rotated reference silhouette segment;
[0049] Figure 6 is a schematic diagram of an exemplary profile segment to be registered and a reference profile segment;
[0050] Figure 7 It is a schematic diagram of the registration between the measured rail head profile and the standard rail head profile;
[0051] Figure 8 yes Figure 7 A magnified schematic diagram of the red frame area;
[0052] Figure 9 This is a module block diagram of the rail head profile registration system in Example 2. DETAILED DESCRIPTION
[0053] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the present invention will be briefly introduced below in conjunction with the drawings and the description of the embodiments or the prior art. Obviously, the following description of the structure of the drawings is only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work. It should be noted that the description of these embodiments is used to help understand the present invention, but does not constitute a limitation of the present invention.
[0054] Example 1:
[0055] This embodiment discloses a rail head profile registration method, which can be executed by, but is not limited to, a computer device or a virtual machine with certain computing resources, such as a personal computer, a smart phone, a personal digital assistant, or a wearable device, or by a virtual machine.
[0056] like Figure 1 As shown, a rail head profile registration method may include, but is not limited to, the following steps:
[0057] S1. Obtain the measured rail head profile of the rail head to be detected, and extract the profile of the unworn area in the measured rail head profile as the profile segment to be aligned. Specifically, in this embodiment, the measured rail head profile can be, but is not limited to, acquired through a 2D laser sensor, wherein the unworn area is obtained based on the contact relationship analysis between the wheel and the rail head to be detected. During the operation of the locomotive vehicle, one side of the top of the rail head to be detected will directly contact the wheel of the locomotive vehicle and wear, while the degree of wear on the other side of the top of the rail head to be detected is relatively small. Therefore, in this embodiment, the profile area corresponding to the other side of the top of the rail head to be detected is set as the unworn area, and the profile segment to be aligned is extracted from the measured rail head profile accordingly.
[0058] In this embodiment, in the process of obtaining the measured rail head profile, some abnormal values or outliers may appear. These points deviate from the distribution of normal data and may affect the accuracy of alignment and analysis. Therefore, preprocessing such as data outlier removal is required.
[0059] S2. Obtain a standard rail head profile, and extract a profile of a profile area corresponding to the unworn area in the standard rail head profile as a reference profile segment.
[0060] It should be understood that the standard rail head profile is the profile of an unused rail head that is consistent with the shape of the unused rail head, which is the matching reference for performing rail head profile registration on the rail head to be inspected in this embodiment.
[0061] As an example, in this embodiment, according to the contact relationship analysis between the wheel and the rail head to be tested, it can be known that about 50% of the area on the top of the rail head is not worn. The profile of the corresponding profile area in the standard rail head profile can be selected as the alignment reference. To ensure the accuracy of the alignment, the range is slightly expanded and 75% of the points in the standard rail head profile are selected as the reference profile segment. As an example, Figure 2 Shown is a schematic diagram of the standard rail head profile, wherein the solid line segment is the reference profile segment obtained by screening.
[0062] S3. Performing a registration on the silhouette segment to be registered and the reference silhouette segment, and obtaining an initial registration matrix for matching the silhouette segment to be registered to the reference silhouette segment.
[0063] In step S3, the profile segment to be registered is registered with the reference profile segment, and an initial registration matrix is obtained for matching the profile segment to be registered with the reference profile segment, including:
[0064] S301. With the initial point of the reference profile segment as the center of the circle, the reference profile segment is rotated to obtain a rotated reference profile segment; wherein the rotated reference profile segment shows a monotonically increasing and / or monotonically decreasing trend. It should be noted that the rotated reference profile segment shows a monotonically increasing and / or monotonically decreasing trend, which means that the vertical coordinates corresponding to the various curved segments in the rotated reference profile segment in the horizontal coordinate direction show a trend of continuous increase or continuous decrease as a whole. Figure 3 Shown is a schematic diagram of the reference profile segment after rotation;
[0065] In this embodiment, in order to facilitate subsequent registration processing, after obtaining the rotated reference profile segment, it is pre-processed in advance. The pre-processing process is as follows:
[0066] S3011. Sort the data points of the rotated reference profile segment to obtain a set of sorted data points; specifically, in this embodiment, the data points are arranged in ascending or descending order according to the horizontal coordinates (x-axis coordinates) of each data point on the curve of the rotated reference profile segment, so that the data points are numerically distributed in an orderly manner to ensure the orderliness of the independent variables of the interpolation function, avoid anomalies caused by horizontal coordinate jumps during subsequent interpolation processing, and provide a continuous and monotonic input sequence for subsequent interpolation calculations.
[0067] S3012. Deduplication processing is performed on the data point set after sorting to obtain a normalized data point set; specifically, in this embodiment, deduplication processing is performed on the data point set after sorting, that is, data points with repeated horizontal coordinate values in the data point set after sorting are deleted, and only one representative point is retained (such as retaining the first one or taking the average value) to ensure that the horizontal coordinate is the independent variable of a single-valued function, avoiding the situation where there are multiple vertical coordinate values at a certain horizontal coordinate position; the obtained normalized data point set is also a data point set that meets the orderliness and uniqueness requirements of interpolation.
[0068] S3013. Perform cubic spline interpolation processing on the normalized data point set to obtain a smooth registration reference curve, that is, a pre-processed reference profile segment, for subsequent primary registration and secondary registration processes.
[0069] Specifically, cubic spline interpolation is a commonly used interpolation method used to fit a smooth curve through a series of data points. Its basic idea is to divide the interpolation between data points into segments, and each segment is represented by a cubic polynomial to ensure that the interpolation curve is not only continuous at each data point, but also has continuous first-order derivatives and second-order derivatives, thereby ensuring the smoothness of the interpolation curve.
[0070] In this embodiment, the steps of performing cubic spline interpolation processing on the normalized data point set are as follows:
[0071] a1. Piecewise polynomial: The interpolation between each segment of the normalized data point set is expressed as a cubic polynomial. Assume that there are n+1 data points (x0, y0), (x1, y1), ..., (x n ,y n ), we need to use the cubic polynomial S i (x) to describe each [x i ,x i+1 ] interpolation relationship between:
[0072] S i (x) = a i (xx i ) 3 +b i (xx i )2 +c i (xx i )+d i ;
[0073] Among them, a i 、b i 、c i and d i is the undetermined coefficient.
[0074] a2. Boundary conditions: In order to solve the coefficients of each polynomial, it is necessary to set appropriate boundary conditions to ensure the smoothness of the curve.
[0075] a3. Continuity conditions: To ensure that the interpolation curve is smooth at each data point, the following continuity conditions must also be met:
[0076] Function value continuity: Each segment of the polynomial at the data point x i The values at must be equal, that is:
[0077] S i (x i )=y i , and s i+1 (x i )=y i ;
[0078] First-order derivative continuity: The first-order derivative of each polynomial at the data point (that is, the slope of the curve) must be equal, that is:
[0079] S′ i (x i )=S′ i+1 (x i );
[0080] Second-order derivative continuity: The second-order derivative of each polynomial at the data point (that is, the curvature of the curve) must be equal, that is:
[0081] S″ i (x i )=S″ i+1 (x i );
[0082] a4. Coefficient solution: For each interval between data points, the cubic spline interpolation method will generate a linear equation system containing the coefficients a i 、b i 、c i and d i These equations are constructed based on the values of the data points and the continuity conditions. Solving these equations can obtain the interpolation polynomial for each interval. By setting the continuity conditions of the second-order derivative, the second-order derivative is usually taken as the unknown quantity (i.e. the coefficient ci ), which gives a tridiagonal matrix equation that can be solved using numerical methods such as Gaussian elimination or LU decomposition.
[0083] a5. Final interpolation function: After solving all the coefficients, we can obtain the cubic polynomial in each interval, thereby constructing the entire interpolation curve function.
[0084] S302. Extract a set of feature points to be registered from the silhouette segment to be registered, and construct shape-preserving invariant constraints based on the set of feature points to be registered.
[0085] In step S302, the set of feature points to be registered includes the starting point to be registered and the end point to be registered, as well as the farthest point to be registered in the profile segment to be registered that is farthest from the section line containing the starting point to be registered and the end point to be registered; the shape-preserving invariant constraint conditions include: the distance between any two endpoints in the rotated reference profile segment is consistent with the length of the line connecting the starting point to be registered and the end point to be registered, and the area of the figure enclosed by the section line containing the two endpoints and the rotated reference profile segment has the smallest error with the area of the figure enclosed by the section line containing the starting point to be registered and the end point to be registered and the profile segment to be registered. The starting point to be registered and the end point to be registered serve as contour boundaries, and the farthest point to be registered can be used to construct a triangulation relationship. By setting the shape-preserving invariant constraint conditions, a stable shape-preserving reference frame can be provided for subsequent transformations.
[0086] As an example, Figure 4 The figure shows a schematic diagram of extracting the feature point set to be registered from the profile segment to be registered. Assume that 75% of the points in the measured rail head profile constitute the profile segment to be registered, that is, the solid line segment in the figure, whose endpoints are point P1 (x1, y1) and point Q1 (x2, y2) respectively. By calculating the distance from each point of the profile segment to be registered to the section where point P1 and point Q1 are located, the point with the largest distance to the section is found and recorded as the farthest point M1 (x i ,y i ); The distance between the farthest point M1 and the intersection of points P1 and Q1 is also the maximum distance, and its calculation formula is:
[0087]
[0088] In order to ensure that the final selected starting point and end point to be registered avoid the worn area as much as possible, in this embodiment, a secant line with a distance to the farthest point M1 equal to 70% of the maximum distance is taken, and the two points where the secant line intersects with the contour segment to be registered are used as the starting point and end point to be registered, that is, the starting point to be registered is point P2 (x1', y1'), and the end point to be registered is point Q2 (x2', y2').
[0089] S303. Use the conformal transformation method to sequentially map the feature point set to be registered to different candidate point sets of the rotated reference profile segment, traverse all candidate point sets of the rotated reference profile segment, and select the best candidate point set that satisfies the conformal invariant constraint. It should be noted that if the initial position is far or the error is large, it may not converge to the global optimal solution, and may even fall into a local minimum. For this reason, in this embodiment, the conformal transformation method is used for point-by-point registration, and the best registration situation is obtained with the conformal invariant constraint. By traversing the global point cloud, the global optimal solution, that is, the best candidate point set, can be found. Through the conformal transformation method, this embodiment fully considers the geometric constraint of the original shape remaining unchanged during the registration process, ensuring the rationality and accuracy of the registration results.
[0090] In step S303, any candidate point set of the rotated reference profile segment includes any endpoint corresponding to the start point to be registered and another endpoint corresponding to the end point to be registered in the rotated reference profile segment, and the distance between the two endpoints is consistent with the length of the line between the start point to be registered and the end point to be registered; correspondingly, in step S303, mapping the feature point set to be registered to any candidate point set of the rotated reference profile segment using a conformal transformation method includes:
[0091] S3031. Mapping the starting point to be registered to any end point of the rotated reference profile segment;
[0092] S3032. Obtain the distance between the rotated reference profile segment and any endpoint, another endpoint having the same length as the line between the start point to be registered and the end point to be registered, and map the end point to be registered to the other endpoint.
[0093] It should be noted that, in this embodiment, based on the two endpoints in the candidate point set, the point in the rotated reference profile segment that is farthest from the transversal line where the two endpoints are located can also be obtained, and a triangular relationship can be constructed based on these three points.
[0094] In this embodiment, the area of the figure enclosed by the transversal line at the two endpoints and the rotated reference profile segment is calculated as follows: First, assume that the equation of the transversal line at the two endpoints is y = mx + b, where m and b are both natural numbers, and the curve equation of the rotated reference profile segment is y = f(x). Find the intersection of the transversal line and the rotated reference profile segment, that is, the intersection points x1 and x2 obtained by solving the equation mx + b = f(x). Calculate by definite integral to obtain the area between the transversal line and the rotated reference profile segment between the intersection points x1 and x2. The area calculation formula is as follows:
[0095]
[0096] Here, |f(x)-(mx+b)| is the vertical distance between the transversal line and the rotated reference profile segment. Integrating it can obtain the area of the figure enclosed by the transversal line where the two endpoints are located and the rotated reference profile segment.
[0097] like Figure 5 , y3) and Q3 (x4, y4), and a second candidate point set consisting of point P4 (x5, y5) and Q4 (x6, y6). The distance between point P3 (x3, y3) and point Q3 (x4, y4), and the distance between point P4 (x5, y5) and point Q4 (x6, y6) are the same as the length of the line between the starting point P2 to be registered and the end point Q2 to be registered. The farthest point corresponding to the first candidate point set is M3 (x3, y3). 3i ,y 3i ), the farthest point corresponding to the first candidate point set is M4(x 4i ,y 4i ); the measured area of the figure P2Q2M1 enclosed by the section where the starting point P2 to be registered and the end point Q2 to be registered are measured as S1. If, among all the candidate points, the area S2 of the section where the point P3(x3, y3) and the point Q3(x4, y4) in the first candidate point set are located and the figure P3Q3M3 enclosed by the rotated reference contour segment is closest to the area S1, that is, the error is the smallest, then the first candidate point set is the best candidate point set. Correspondingly, through the coordinates of the feature point set to be registered and the points in the best candidate point set, the translation matrix and rotation matrix that map the feature point set to be registered to the best candidate point set can be calculated, which is also the initial registration matrix that meets the coarse configuration requirements.
[0098] S304. Obtain a registration matrix that maps the feature point set to be registered to the optimal candidate point set, and use it as an initial registration matrix for matching the silhouette segment to be registered to the reference silhouette segment.
[0099] It should be noted that, based on the above steps S301-S304, this embodiment can achieve approximate rigid registration of the profile segment to be registered and the reference profile segment to ensure that the two are highly consistent in shape features, key length and area relationships. It can globally traverse the matching results while keeping the local structural transformation undistorted, thereby obtaining a more accurate profile registration result.
[0100] S4. Correct the initial registration matrix to obtain a corrected registration matrix.
[0101] Specifically, in step S4, the initial registration matrix is corrected to obtain a corrected registration matrix, including:
[0102] S401. Obtain a preset correction value range, and adjust the initial registration matrix within the correction value range to obtain an adjusted correction matrix.
[0103] S402: Obtain the adjusted silhouette segment to be registered after the silhouette segment to be registered is translated and / or rotated according to the adjusted correction matrix.
[0104] S403. Calculate the Euclidean distance error between the adjusted silhouette segment to be registered and the reference silhouette segment. Specifically, the Euclidean distance error adopts the average Euclidean distance.
[0105] S404. With the goal of minimizing the Euclidean distance error, adjust the initial registration matrix within the correction value range, and obtain a correction value that minimizes the Euclidean distance error.
[0106] S405. Adjust the initial registration matrix according to the correction value that minimizes the Euclidean distance error to obtain a corrected registration matrix.
[0107] Specifically, in this embodiment, the initial registration matrix includes an initial translation matrix and an initial rotation matrix, and the corrected registration matrix includes a corrected translation matrix and a corrected rotation matrix; correspondingly, the correction value range includes a translation correction value range corresponding to the initial translation matrix and a rotation angle correction range corresponding to the initial rotation matrix, and the correction value that minimizes the Euclidean distance error includes a translation correction value and a rotation angle correction value that minimize the Euclidean distance error.
[0108] It should be noted that the translation matrix is used to describe the translation transformation of points or objects in space. In two-dimensional space, the translation matrix is a simple transformation matrix that can be used to implement the translation operation of graphics and points. In two-dimensional space, the translation transformation refers to moving each point of the graphics a fixed distance along a certain direction. This transformation can be represented by the translation matrix. Suppose there are two points A(x a ,y a ) and point B(x b ,y b ), if you want to translate point A to point B, then the translation distance on the x-axis is: t x =x b -x a , the translation distance on the y-axis is: t y =y b -y a , from this we can get the translation matrix:
[0109]
[0110] A rotation transformation is used to rotate an object (such as a line) through a fixed angle to another direction. For example, if you want to rotate line PM1 to PM2, you need to first calculate the rotation angle between them. Assuming that the slope of PM1 is m1 and the slope of PM2 is m2, the rotation angle θ can be calculated by the angle between the two lines. Using the relationship between the slopes of the lines, the angle can be calculated using the following formula:
[0111]
[0112] The rotation transformation in two-dimensional space can be described by the rotation matrix. For a point P(x,y), the rotation matrix of the rotation angle θ is:
[0113]
[0114] It should be noted that, based on the primary registration, in order to find the best registration matrix, it is necessary to fine-tune the initial registration matrix by adjusting the values of the initial translation matrix T and the initial rotation matrix R and minimizing the Euclidean distance error function E(T,R). In this embodiment, the rotation angle correction range is pre-given (-Δθ, Δθ), θ∈[θ-Δθ,θ+Δθ], Δθ is the preset rotation angle correction threshold, and the translation correction value range is T=[t x ,t y ], t x ∈[T x -ΔT x ,T x +ΔT x ], t y ∈[T y -ΔT y ,T y +ΔT y ], ΔT x is the preset x-axis translation threshold, ΔT y is a preset y-axis translation threshold; then, the initial translation matrix and the initial rotation matrix in the initial registration matrix are fine-tuned within this range, and the optimal corrected translation matrix and the corrected rotation matrix are sought by calculating the correction value that minimizes the Euclidean distance error.
[0115] As an example, Figure 6 The figure shows a schematic diagram of an exemplary profile segment to be registered and a reference profile segment, wherein the profile segment to be registered is a curve AB, which includes a point set {A1, A2, ..., A n}, the reference profile segment is the curve CD, which contains the point set {C1,C2,...,C n}, the initial translation matrix is T = [t x ,t y ] T, the initial rotation matrix is:
[0116]
[0117] Point A in the adjusted profile segment to be registered obtained after transforming the profile segment to be registered i ′ can be obtained by the following formula:
[0118]
[0119] Point A i The x-axis and y-axis coordinate values in ′ are as follows:
[0120] x i '=cos(θ)·x i -sin(θ)·y i +t x
[0121] y′ i =sin(θ)·x i +cos(θ)·y i +t y ;
[0122] Where x i 、y i is the point A in the contour segment to be registered i 'The x-axis and y-axis coordinate values of the corresponding point;
[0123] For each transformed point A in the adjusted profile segment to be registered i ′=(x i ′,y i ′), its difference from the reference point C in the reference profile segment can be calculated i =(x i ,y i ). The Euclidean distance is calculated as:
[0124]
[0125] In order to measure the error of the entire curve, the Euclidean distance error between the adjusted profile segment to be registered and the reference profile segment can be obtained, that is, the average Euclidean distance, which is calculated as follows:
[0126]
[0127] Where n is the total number of midpoints of the adjusted silhouette segments to be registered.
[0128] S5. According to the corrected registration matrix, the measured rail head profile where the profile segment to be registered is located is translated and / or rotated according to the corrected registration matrix so that the measured rail head profile overlaps with the standard rail head profile where the reference profile segment is located, thereby achieving registration between the measured rail head profile and the standard rail head profile.
[0129] It should be noted that step S5 is also the secondary registration step. Since the corrected registration matrix includes the corrected translation matrix and the corrected rotation matrix, this embodiment needs to translate and rotate the measured rail head profile where the profile segment to be registered is located according to the corrected registration matrix. Furthermore, to facilitate user viewing, in this embodiment, after translating and / or rotating the measured rail head profile where the profile segment to be registered is located according to the corrected registration matrix, the positions of the rotated reference profile segment and the profile segment to be registered are also adjusted. The final registration result is as follows: Figure 7 and Figure 8 shown.
[0130] This embodiment can independently perform rail head profile registration and can be applied to scenarios where there is no rail waist data, while having high registration accuracy and efficiency. During the implementation of this embodiment, the profile of the unworn area in the measured rail head profile of the rail head to be detected is selected as the profile segment to be registered, and the profile of the profile area corresponding to the unworn area in the standard rail head profile is selected as the reference profile segment; then, the profile segment to be registered and the reference profile segment are registered once, and an initial registration matrix is obtained that matches the profile segment to be registered to the reference profile segment; then, the initial registration matrix is corrected to obtain a corrected registration matrix, and then, based on the corrected registration matrix, the measured rail head profile where the profile segment to be registered is located is translated and / or rotated according to the corrected registration matrix, thereby achieving registration between the measured rail head profile and the standard rail head profile. Based on this, this embodiment can realize automatic alignment of the rail head profile without the need for rail waist data, and can be applied to scenarios where there is no rail waist data, avoiding the calculation of rail waist alignment and the error accumulation caused by rail waist data, thereby improving the efficiency and accuracy of rail head profile alignment.
[0131] Example 2:
[0132] This embodiment discloses a rail head profile registration system for implementing the rail head profile registration method in embodiment 1; Figure 9 As shown, the rail head profile registration system includes:
[0133] a measured profile acquisition module, configured to acquire the measured rail head profile of the rail head to be inspected, and extract the profile of the unworn area in the measured rail head profile as the profile segment to be registered;
[0134] a reference profile acquisition module, configured to acquire a standard rail head profile, and extract a profile of a profile area corresponding to the unworn area in the standard rail head profile as a reference profile segment;
[0135] a primary registration module, respectively connected to the measured profile acquisition module and the reference profile acquisition module, for performing a primary registration on the profile segment to be registered and the reference profile segment, and obtaining an initial registration matrix for matching the profile segment to be registered to the reference profile segment;
[0136] A secondary registration module is communicatively connected to the primary registration module and is used to correct the initial registration matrix to obtain a corrected registration matrix; and is also used to translate and / or rotate the measured rail head profile where the profile segment to be registered is located according to the corrected registration matrix, thereby achieving registration between the measured rail head profile and the standard rail head profile.
[0137] It should be noted that the working process, working details and technical effects of the rail head profile alignment system provided in this embodiment 2 can be found in embodiment 1 and will not be described in detail here.
[0138] Example 3:
[0139] Based on Embodiment 1 or 2, this embodiment discloses an electronic device, which may be a smartphone, tablet computer, laptop computer, or desktop computer. The electronic device may be called a user terminal, portable terminal, desktop terminal, etc. The electronic device includes:
[0140] a memory for storing computer program instructions; and
[0141] A processor is used to execute the computer program instructions to complete the operation of a rail head profile registration method as described in any one of Example 1.
[0142] Example 4:
[0143] Based on any one of Embodiments 1 to 3, this embodiment discloses a computer program product, including a computer program or instructions, which, when executed by a computer, implements the rail head profile registration method described in any one of Embodiment 1. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device.
[0144] Obviously, those skilled in the art will appreciate that the modules or steps of the present invention described above can be implemented using a general-purpose computing device. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Alternatively, they can be implemented using program code executable by a computing device, which can then be stored in a storage device and executed by the computing device. Alternatively, they can be fabricated into separate integrated circuit modules, or multiple modules or steps can be fabricated into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0145] Finally, it should be noted that the above embodiments are intended only to illustrate the technical solutions of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art will appreciate that modifications may be made to the technical solutions described in the above embodiments, or that some of the technical features may be replaced with equivalents. Such modifications or replacements do not deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A rail head profile registration method, characterized in that: include: Acquire a measured rail head profile of the rail head to be inspected, and extract the profile of an unworn area in the measured rail head profile as a profile segment to be registered; Acquiring a standard rail head profile, and extracting a profile of a profile area corresponding to the unworn area in the standard rail head profile as a reference profile segment; Performing a registration on the to-be-registered profile segment and the reference profile segment, and obtaining an initial registration matrix that matches the to-be-registered profile segment to the reference profile segment; Correcting the initial registration matrix to obtain a corrected registration matrix; According to the corrected registration matrix, the measured rail head profile where the profile segment to be registered is located is translated and / or rotated according to the corrected registration matrix, thereby achieving registration between the measured rail head profile and the standard rail head profile.
2. A rail head profile registration method according to claim 1, characterized in that: Performing a registration on the to-be-registered profile segment and the reference profile segment, and obtaining an initial registration matrix that matches the to-be-registered profile segment to the reference profile segment, includes: The reference profile segment is rotated with the initial point of the reference profile segment as the center of the circle to obtain a rotated reference profile segment; wherein the rotated reference profile segment shows a monotonically increasing and / or monotonically decreasing trend; Extracting a set of feature points to be registered from the profile segment to be registered, and constructing a shape-preserving invariant constraint condition based on the set of feature points to be registered; Using a conformal transformation method, the feature point set to be registered is sequentially mapped to different candidate point sets of the rotated reference silhouette segment, all candidate point sets of the rotated reference silhouette segment are traversed, and the best candidate point set that satisfies the conformal invariant constraint is selected; A registration matrix that maps the feature point set to be registered to the optimal candidate point set is obtained, and the registration matrix is used as an initial registration matrix for matching the silhouette segment to be registered to the reference silhouette segment.
3. The rail head profile registration method according to claim 2, characterized in that: The feature point set to be registered includes a starting point to be registered and an end point to be registered; The conformal invariant constraint conditions include: the distance between any two endpoints in the rotated reference profile segment is consistent with the length of the line between the starting point to be registered and the end point to be registered, and the area of the figure enclosed by the section line where the two endpoints are located and the rotated reference profile segment has the smallest error with the area of the figure enclosed by the section line where the starting point to be registered and the end point to be registered and the profile segment to be registered.
4. A rail head profile registration method according to claim 3, characterized in that: Any candidate point set of the rotated reference profile segment includes any endpoint corresponding to the to-be-registered starting point and another endpoint corresponding to the to-be-registered end point in the rotated reference profile segment, and a distance between the two endpoints is consistent with a length of a line connecting the to-be-registered starting point and the to-be-registered end point; Correspondingly, the feature point set to be registered is mapped to any candidate point set of the rotated reference silhouette segment using a conformal transformation method, including: Mapping the starting point to be registered to any end point of the rotated reference profile segment; Obtain the distance between the rotated reference profile segment and any endpoint, another endpoint having the same length as the line between the start point to be registered and the end point to be registered, and map the end point to be registered to the other endpoint.
5. The rail head profile registration method according to claim 1, characterized in that: Correcting the initial registration matrix to obtain a corrected registration matrix includes: Obtaining a preset correction value range, and adjusting the initial registration matrix within the correction value range to obtain an adjusted correction matrix; Obtaining the adjusted silhouette segment to be registered after the silhouette segment to be registered is translated and / or rotated according to the adjusted correction matrix; Calculating the Euclidean distance error between the adjusted silhouette segment to be registered and the reference silhouette segment; With the goal of minimizing the Euclidean distance error, adjusting the initial registration matrix within the correction value range, and obtaining a correction value that minimizes the Euclidean distance error; The initial registration matrix is adjusted according to the correction value that minimizes the Euclidean distance error to obtain a corrected registration matrix.
6. A rail head profile registration method according to claim 5, characterized in that: The initial registration matrix includes an initial translation matrix and an initial rotation matrix, and the corrected registration matrix includes a corrected translation matrix and a corrected rotation matrix; correspondingly, the correction value range includes a translation correction value range corresponding to the initial translation matrix and a rotation angle correction range corresponding to the initial rotation matrix, and the correction value that minimizes the Euclidean distance error includes a translation correction value and a rotation angle correction value that minimize the Euclidean distance error.
7. The rail head profile registration method according to claim 5, characterized in that: The Euclidean distance error adopts the average Euclidean distance.
8. A rail head profile registration system, characterized in that: include: a measured profile acquisition module, configured to acquire the measured rail head profile of the rail head to be inspected, and extract the profile of the unworn area in the measured rail head profile as the profile segment to be registered; a reference profile acquisition module, configured to acquire a standard rail head profile, and extract a profile of a profile area corresponding to the unworn area in the standard rail head profile as a reference profile segment; a primary registration module, respectively connected to the measured profile acquisition module and the reference profile acquisition module, for performing a primary registration on the profile segment to be registered and the reference profile segment, and obtaining an initial registration matrix for matching the profile segment to be registered to the reference profile segment; a secondary registration module, communicating with the primary registration module, and configured to correct the initial registration matrix to obtain a corrected registration matrix; It is also used to translate and / or rotate the measured rail head profile where the profile segment to be registered is located according to the corrected registration matrix, thereby achieving registration between the measured rail head profile and the standard rail head profile.
9. An electronic device, characterized in that: include: a memory for storing computer program instructions; as well as, A processor is configured to execute the computer program instructions to thereby complete the operation of the rail head profile registration method according to any one of claims 1 to 7.
10. A computer program product comprising a computer program or instructions, characterized in that When the computer program or the instruction is executed by a computer, the method for aligning the profile of a rail head according to any one of claims 1 to 7 is implemented.