Rail train part anomaly detection method based on point-surface distance
Through the abnormal detection method of rail train parts based on point-surface distance, the efficiency and accuracy of abnormal detection of spatial vector changes of rail train parts is solved, and the automated and accurate detection of rail parts is realized, and manual inspection errors and fault risks are reduced.
Patent Information
- Application Number
- CN202511079487.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-04
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2045-08-04
AI Technical Summary
The prior art is difficult to effectively detect abnormal changes in space vectors of rail train components, resulting in low patrol efficiency and susceptible to human factors.
The abnormal detection method of track train parts based on point-face distance is adopted. Through the steps of surface recognition, model indexing, vector fitting and point confirmation, the distance deviation is quantified to realize automatic detection of vector anomalies of track parts, and avoid manual inspection errors.
It improves detection efficiency and accuracy, can position geometric abnormalities in real time, reduces the risk of train operation failures, and adapts to detection stability in complex environments.
Smart Images

Figure CN120580233A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of abnormality detection of rail components, and in particular to a method for detecting abnormality of rail train components based on point-to-surface distance. Background Art
[0002] Track inspection is a vital part of the rail transit system, aimed at ensuring the safety and reliability of the track. Traditional inspection methods mainly rely on manual inspection, which is time-consuming, labor-intensive, and easily affected by human factors.
[0003] In related technologies, in order to facilitate the inspection of rail trains, a track component detection system based on YOLOv8 is introduced. The entire system includes five parts: data acquisition, data processing, model training, model optimization and evaluation, real-time detection, and system deployment. A high-definition camera is installed on the inspection vehicle to regularly collect track image data. It can identify foreign objects in areas such as the roadbed and point rails, detect and locate broken and missing components, and further automatically warn and alarm for abnormal situations. It can significantly improve the efficiency and accuracy of inspections and promptly detect and deal with faults and wear of track components.
[0004] Regarding the above-mentioned related technologies, image detection technology is mainly used to build component models and identify abnormal image features of components to analyze whether abnormalities occur. However, it is difficult to detect abnormal spatial vector changes generated by components, and further improvement is needed. Summary of the Invention
[0005] In order to facilitate the detection of abnormal changes in the vectors of components on rail trains, the present application provides a method for detecting abnormalities in rail train components based on point-to-surface distance.
[0006] This application provides a method for detecting abnormalities in rail train components based on point-to-surface distance, which adopts the following technical solutions: A method for detecting abnormalities of rail train components based on point-to-surface distance, comprising: The face recognition step uses a preset face recognition strategy to identify the measured special faces in the target image and generate corresponding special recognition features; Model indexing step: retrieve the target part model from the preset part type database according to the special recognition features, and import the target part model into the spatial coordinate system; A vector fitting step includes a model rendering strategy, wherein the model rendering strategy determines a rendering vector of the target part model in the spatial coordinate system by fitting the measured special surface and the target part model in the spatial coordinate system, and constructs a coordinate mapping relationship between the spatial coordinate system and the target image based on the rendering vector; Point confirmation step, determining the graphic plane coordinates of the datum special point in the target image in the target part model according to the mapping relationship; The deviation calculation step is to calculate the difference between the reference special point and the measured special point image plane coordinates to obtain the special point deviation, and to calculate the corresponding reference distance deviation based on the special point deviation through a preset distance solution algorithm.
[0007] By adopting the above technical solution, the surface recognition step accurately locates the measured special surface, the model indexing step quickly retrieves the target part model, the vector fitting step constructs the spatial coordinate mapping relationship, the point confirmation step determines the plane coordinates of the reference point, and the deviation calculation step quantifies the distance deviation. This can effectively automatically detect vector anomalies of track components, avoid subjective errors in manual inspections, improve detection efficiency and accuracy, and locate geometric anomalies such as loose bolts and pad displacement in real time, providing data support for track safety operation and maintenance, and helping to reduce the risk of train operation failures.
[0008] Optionally, the face recognition strategy includes: A plurality of original expansion points at different image plane coordinates are generated based on a pixel value range determined for the target image, each expansion point corresponding to a different pixel value range, and an image region is expanded in the target image using a preset dynamic expansion algorithm starting from the original expansion point until a preset expansion constraint condition is satisfied; A region with an area larger than a preset reference proportional area is selected as a reference surface extraction region, and a plurality of surface feature points are determined from the reference surface extraction region according to a coordinate positioning algorithm to form the measured special surface.
[0009] By adopting the above technical solution, original expansion points are generated based on the pixel value range, the dynamic expansion algorithm is used to adaptively expand the image area, and the reference surface is screened in combination with the reference proportional area. Finally, the surface feature points are determined. This helps to reduce interference such as uneven lighting and oil coverage, and accurately extract special surfaces such as rail pads and roadbed surfaces. Compared with the traditional threshold segmentation method, the recognition robustness of complex textured surfaces is significantly improved, providing a reliable two-dimensional feature foundation for subsequent three-dimensional modeling, and helping to reduce anomaly omissions caused by feature extraction errors.
[0010] Optionally, the dynamic expansion algorithm is used to calculate a similar expansion value of an adjacent image region, and if the similar expansion value is greater than a dynamic expansion benchmark, the adjacent image region is merged into the current image region to complete the image region expansion; When the adjacent graph areas of the current graph area do not meet the graph area expansion conditions, the screening area of the adjacent graph areas is reduced to re-determine the adjacent graph areas of the current graph area; When the screening area is smaller than the preset reference trigger area, it is considered that the expansion constraint condition is satisfied; The dynamic expansion algorithm is calculated using the following formula: ; Represents the similarity expansion value of adjacent image regions i and j, which is used to measure the similarity of pixel value distribution. represents the pixel value vector of the kth pixel in the image region i, represents the pixel value vector of the kth pixel at the corresponding position in the image region j, and n represents the number of pixels in the feature points involved in the calculation. Represents the Euclidean distance norm between image regions, which is used to calculate the difference in pixel values.
[0011] By adopting the above technical solution, the dynamic expansion algorithm determines the conditions for merging image areas based on similar expansion values. When the similarity of pixel values in adjacent image areas is higher than the dynamic benchmark, they are merged into the current area. If the conditions are not met, the screening area is iteratively reduced until the benchmark area threshold is triggered. This solution can adaptively handle situations such as rust on the rail surface and blurred crack edges, avoiding the excessive merging or segmentation of areas caused by traditional fixed threshold expansion, making the contours of extracted components such as rail heads and splints more consistent with the actual shape, and helping to improve the geometric accuracy of subsequent point-to-surface distance calculations.
[0012] Optionally, a dynamic reference sub-step is further included for determining the dynamic expansion reference, and the dynamic reference sub-step includes: A feature recognition algorithm is used to determine the surface influencing features in the target image, and the feature type weight of each influencing feature is determined according to the type of the surface influencing feature. If a surface influencing feature of the corresponding type exists in an adjacent image area, the corresponding feature type weight value is calculated according to the area of the surface influencing feature. The feature type weight value is used to weight all feature type weights in the adjacent image area to obtain an attenuation expansion factor. The dynamic expansion benchmark is generated based on the attenuation expansion factor.
[0013] By adopting the above technical solution, the dynamic benchmark sub-step determines the feature weight according to the type of surface influencing features, such as cracks and foreign objects, calculates the weight value based on the feature area, and generates a weighted attenuation expansion factor to dynamically adjust the expansion benchmark. This helps to adaptively adjust the detection sensitivity for different types of defects. In complex scenarios such as water accumulation on the roadbed and oil pollution on the rails, it dynamically suppresses the interference of non-critical features, improves the recognition priority of typical faults such as missing bolts and broken gauge blocks, and helps to reduce the false detection rate.
[0014] Optionally, the model presentation strategy is configured with a fitting reliability algorithm, which is used to calculate the comprehensive fitting value of the measured special surface corresponding to the target part model under different fitting vectors, and determine the fitting vector with the highest comprehensive fitting value as the presentation vector.
[0015] By adopting the above technical solution, a reliable fitting algorithm is used to calculate the comprehensive fitting values under different fitting vectors, and the presentation vector corresponding to the optimal value is selected to achieve spatial mapping between the measured special surface and the target part model. This helps to improve the matching degree between the model and the measured data and avoid the coordinate deviation caused by traditional manual calibration. Especially in the inspection of complex components in the turnout area, the three-dimensional models of the point rail and the base rail can be accurately aligned, providing a reliable spatial transformation matrix for subsequent point-to-surface distance calculations, which helps to improve the consistency of geometric parameter measurement.
[0016] Optionally, the reliable fitting algorithm includes: The comprehensive fitting value is calculated based on a shadow compensation outlier value, wherein the shadow compensation value is obtained by a deviation between a shadow vector and a presentation vector, and the shadow vector is generated by extracting a shadow area in a target image; The fitting reliability algorithm is calculated using the following model formula: ; in, Represents the comprehensive fitting value corresponding to the fitting vector v, v represents the fitting vector to be evaluated, Represents the coordinates of the i-th feature point of the measured special surface, represents the coordinates of the i-th corresponding point of the target part model under the fitting vector v, m represents the total number of surface feature points, Indicates the preset shadow compensation coefficient, which is used to balance the impact of shadows. Indicates the shadow intensity of the area where the i-th point is located.
[0017] By adopting the above technical solution, the shadow compensation value and shadow compensation outlier are introduced into the reliable fitting algorithm, and the comprehensive fitting value is corrected based on the shadow intensity to eliminate the interference of uneven illumination on the positioning of feature points. In scenes with sudden changes in illumination, such as tunnels and bridges, the mismatching of feature points in the shadow area of the rail can be reduced. For example, in the desoldering detection of the slide bed, by compensating for the fitting error in the shadow area, the plane coordinate mapping between the three-dimensional model and the measured image is made more accurate, which helps to improve the accuracy of desoldering shift detection.
[0018] Optionally, the vector fitting step further includes a macro correction sub-step: The macro correction sub-step includes retrieving historical presentation vectors from a historical database according to the type of the target part model, screening historical presentation vectors that meet preset similarity conditions according to current environmental information, and classifying the historical presentation vectors into historical presentation vector groups according to a preset vector classification strategy, wherein the environmental information includes shooting position data, shooting device data, track information data, illumination data, and visibility data; The presentation vector is modified according to the mean vector of the historical presentation vector group to generate a new presentation vector.
[0019] By adopting the above technical solution, the macro correction sub-step retrieves the historical presentation vector according to the part type, classifies and generates a vector group based on environmental information such as the shooting position and illumination, and uses the mean vector to correct the current presentation vector. At the same time, the optimal mapping relationship in the historical detection data can be reused. When repeating the detection in the same track section, the coordinate system can be quickly calibrated. This is especially suitable for periodic inspection scenarios. Compared with fitting vectors from scratch, it reduces calculation time and improves real-time detection efficiency.
[0020] Optionally, the vector classification strategy includes: The presentation reliability value of each historical presentation vector is calculated according to the similarity frequency value, the interference abnormality value and the measured deviation value, and the historical presentation vectors whose presentation reliability values are ranked within a preset range are selected to generate the historical presentation vector group.
[0021] By adopting the above technical solution, the vector classification strategy calculates the presentation reliability value based on similar frequency values, interference outliers, and measured deviation values, and selects highly reliable historical vectors to generate groups. This helps to eliminate erroneous mapping relationships caused by abnormal factors such as equipment jitter and sudden strong light. For example, in heavy rain weather detection, noise data in low visibility is automatically filtered to ensure the effectiveness of the historical vector group, so that the corrected presentation vector is more in line with the actual track geometry, which helps to improve detection stability in harsh environments.
[0022] Optionally, the distance solving algorithm generates a corresponding deviation mapping function according to the presentation vector, and substitutes the special point deviation into the deviation mapping function to output a corresponding reference distance deviation; The distance solving algorithm adopts the following model formula for calculation: ; ; in, Indicates the reference distance deviation, represents the scale transformation matrix, represents the optimal rendering vector The corresponding coordinate transformation matrix, Represents the deviation vector of a special point.
[0023] By employing this technical solution, the distance-solving algorithm generates a deviation mapping function based on the optimal rendering vector, converting point deviations in the image plane into actual physical distance deviations. This model integrates the camera's in-camera spatial transformation matrix to achieve precise conversion from pixel coordinates to millimeter units. For rail misalignment detection, it directly outputs the height difference between the upper and lower misaligned teeth and the horizontal distance between the left and right misaligned teeth. Compared to traditional manual measurement, this model meets the high-precision inspection requirements of the railway industry.
[0024] Optionally, a quick identification step is also included, which includes an identification trigger condition. The identification trigger condition is that when the similarity between the target image and the target image in the historical data exceeds a preset similarity threshold, the coordinate mapping relationship of the target image in the historical data is used as the coordinate mapping relationship of the current target image to directly enter the point confirmation step.
[0025] By employing this technical solution, the rapid recognition step reuses the historical coordinate mapping relationship to directly enter the point confirmation step when the similarity between the target image and the historical image exceeds a threshold. This mechanism bypasses time-consuming processes such as surface recognition and vector fitting, shortening the processing time of a single image when repeatedly inspecting the same track section. This facilitates mobile inspection scenarios such as high-speed trains and helps improve the engineering practicality of the track inspection system.
[0026] In summary, this application includes at least one of the following beneficial technical effects: 1. The surface recognition step accurately locates measured special surfaces, the model indexing step quickly retrieves the target part model, the vector fitting step establishes spatial coordinate mapping relationships, the point confirmation step determines the plane coordinates of the reference point, and the deviation calculation step quantifies distance deviations. This enables effective automatic detection of vector anomalies in track components, avoiding subjective errors in manual inspections, improving detection efficiency and accuracy, and locating geometric anomalies such as loose bolts and pad displacement in real time. This provides data support for safe track operation and maintenance, helping to reduce the risk of train failures. 2. Utilizing a dynamic expansion algorithm to adaptively expand the image area, the reference surface is screened based on the reference proportional area, ultimately determining surface feature points. This helps reduce interference from uneven lighting and oil coverage, accurately extracting special surfaces such as the rail pad and roadbed surface, and reducing missed detections due to feature extraction errors. 3. The dynamic benchmark sub-step determines the feature weight through the surface-affecting feature type, such as cracks and foreign matter, calculates the weight value based on the feature area, and generates a weighted attenuation expansion factor to dynamically adjust the expansion benchmark. This helps to adaptively adjust the detection sensitivity for different types of defects. In complex scenarios such as water accumulation on the roadbed and oil pollution on the rails, it dynamically suppresses the interference of non-critical features, improves the recognition priority of typical faults such as missing bolts and broken gauge blocks, and helps to reduce the false detection rate. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 It is a method flow chart of steps S100 to S500 in this application.
[0028] Figure 2 It is a method flow chart of steps S101 to S102 in this application.
[0029] Figure 3 It is a method flow chart of steps S1011 to S1013 in this application.
[0030] Figure 4 It is a method flow chart of steps S1014 to S1015 in this application.
[0031] Figure 5 This is a method step diagram of steps S302 to S3022 in this application. DETAILED DESCRIPTION
[0032] In order to make the purpose, technical solutions and advantages of this application more clear, the following Figure 1-Figure 5 It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application.
[0033] The embodiments of the present invention are described in further detail below with reference to the accompanying drawings.
[0034] The embodiment of the present application discloses a method for detecting anomalies of rail train components based on point-to-surface distance. The method comprises the following steps: a surface recognition step to accurately locate the measured special surface; a model indexing step to quickly retrieve the target part model; a vector fitting step to construct a spatial coordinate mapping relationship; a point confirmation step to determine the plane coordinates of the reference point; and a deviation calculation step to quantify the distance deviation. This method can effectively and automatically detect vector anomalies of rail components, avoid subjective errors in manual inspections, improve detection efficiency and accuracy, and locate geometric anomalies such as loose bolts and pad displacement in real time, thereby providing data support for safe rail operation and maintenance and realizing train operation failure risk control.
[0035] Reference Figure 1 The method flow of the rail train component anomaly detection method based on point-to-surface distance includes the following steps: Face recognition step S100: identifying the measured special faces in the target image using a preset face recognition strategy and generating corresponding special recognition features; In track image inspection, face recognition strategies are essential for accurately extracting component features. This step generates original expansion points at different image plane coordinates using a preset pixel value range. Each expansion point corresponds to an independent pixel value interval. Using a dynamic expansion algorithm, the image region is expanded from the original point until the expansion constraints are met. Specifically, the decision to merge regions is made by calculating similar expansion values for adjacent regions.
[0036] When the similarity expansion value exceeds the dynamic expansion benchmark, the image areas are merged. Otherwise, the selected area is iteratively reduced until it falls below the benchmark trigger area, stopping expansion. For example, in rail surface inspection, this strategy can effectively eliminate interference such as oil stains and rust, and accurately extract special measured surfaces such as rail heads and pads. The specific calculation method of the similarity expansion value will be further explained in the following steps.
[0037] Model indexing step S200: retrieving a target part model from a preset part type database according to special recognition features, and importing the target part model into a spatial coordinate system; Based on the special identification features generated by face recognition, this step retrieves the target part model from the preset part type database and imports it into the spatial coordinate system. The database uses a feature vector indexing mechanism to establish a mapping relationship between the three-dimensional models of components such as bolts and pads and geometric features (such as surface curvature and edge gradient). In specific operations, the similarity between the measured features and the database model is calculated through a feature matching algorithm, and the model with a matching degree greater than 0.8 is selected as the target part model. For example, when the polygonal contour feature of the gauge block is detected, the system automatically retrieves the three-dimensional model of the gauge block of the corresponding model and establishes a spatial coordinate system with the model's center of mass as the origin, providing a benchmark for subsequent three-dimensional fitting.
[0038] Vector fitting step S300: includes a model rendering strategy, which determines the rendering vector of the target part model in the spatial coordinate system by fitting the measured special surface and the target part model in the spatial coordinate system, and constructs a coordinate mapping relationship between the spatial coordinate system and the target image based on the rendering vector; This step uses a model rendering strategy to achieve spatial fitting between the measured special surface and the target part model. A reliable fitting algorithm is used to calculate the comprehensive fitting value for different fitting vectors. The vector with the best comprehensive fitting value is selected as the rendering vector, and a coordinate mapping relationship between the spatial coordinate system and the image is constructed.
[0039] The algorithm incorporates a shadow compensation mechanism, dynamically adjusting fitting parameters based on shadow areas within the image to mitigate the effects of uneven lighting. Furthermore, the macro-correction substep uses a historical database of vectors representing similar parts and uses the mean vector to correct the current vector, further improving fitting accuracy. The specific calculation model for the comprehensive fitting value will be detailed in subsequent steps.
[0040] Point confirmation step S400: determining the graphic plane coordinates of the reference special point in the target image in the target part model according to the mapping relationship; Based on the coordinate mapping relationship established in the vector fitting step, this step accurately locates the graphic plane coordinates of the datum special points in the target image in the target part model. In specific implementation, a bilinear interpolation algorithm is used to perform coordinate transformation in the mapping relationship grid, and the coordinates of the datum special points in the spatial coordinate system are mapped to the image plane. For complex curved surface parts, a curvature compensation factor is introduced to correct the interpolation results to eliminate positioning errors caused by surface projection deformation. For example, when inspecting high-speed rail fasteners, the system accurately projects the datum special points such as the center points of the bolt holes on the fastener model to the image plane through a mapping relationship, providing an accurate reference for subsequent deviation calculations. Among them, the calculation method of the curvature compensation factor will be further explained in the deviation calculation step.
[0041] Deviation calculation step S500: Calculate the difference between the reference special point and the measured special point image plane coordinates to obtain the special point deviation, and calculate the corresponding reference distance deviation based on the special point deviation using a preset distance solution algorithm.
[0042] This step calculates the image plane coordinate difference between the benchmark special points and the measured special points, and combines this with a preset distance calculation algorithm to accurately determine the benchmark distance deviation. First, a weighted Euclidean distance formula is used to calculate the special point deviation, where the weight coefficient is dynamically adjusted based on the importance of the point in the part structure. For example, the center of a bolt hole in a rail fastener has a higher weight coefficient than an edge point to emphasize the inspection accuracy of critical areas. Subsequently, the image plane special point deviation is converted to the benchmark distance deviation in real space using a spatial similarity transformation model that accounts for camera distortion parameters and perspective projection transformations. To improve computational robustness, the RANSAC algorithm is introduced to remove outliers and ensure the reliability of the deviation calculation results. Specifically, when a gauge block installation deviation is detected, the system first calculates the coordinate difference between the benchmark point and the measured point on the image plane. This difference is then converted into the actual installation deviation value using a distance calculation algorithm, providing a quantitative basis for track condition assessment. The specific parameters of the weighted Euclidean distance formula and the spatial similarity transformation model are detailed in the system implementation section.
[0043] Reference Figure 2 ,Face recognition strategies include: Step S101: generating a plurality of original expansion points at different image plane coordinates based on a pixel value range determined for a target image, each expansion point corresponding to a different pixel value range, and performing image expansion in the target image using a preset dynamic expansion algorithm starting from the original expansion point until a preset expansion constraint condition is satisfied; This step generates original expansion points at different image plane coordinates based on the pixel value distribution characteristics of the target image. Each expansion point corresponds to an independent pixel value range (such as a specific interval of the RGB channel). Starting from the original expansion points, the target image is expanded using a preset dynamic expansion algorithm. Specifically, the similarity expansion values of adjacent regions are calculated. When this value is greater than the dynamic expansion benchmark, the adjacent regions are merged into the current region. If all adjacent regions do not meet the conditions, the screening area is iteratively reduced until the screening area is less than the preset benchmark trigger area, at which point the expansion constraint conditions are considered met. For example, when inspecting the surface of a rail head, the algorithm can adaptively exclude areas with abnormal pixel values caused by oil stains and accurately expand to the actual contour boundary of the rail head. The specific calculation methods of the similarity expansion value and the dynamic expansion benchmark will be further explained in subsequent steps.
[0044] Step S102: Filtering a region whose area is larger than a preset reference proportional area as a reference surface extraction region, and determining a number of surface feature points from the reference surface extraction region according to a coordinate positioning algorithm to form a measured special surface.
[0045] After the map area is expanded, this step selects areas larger than the preset baseline ratio as reference surface extraction areas to filter out noisy areas (such as tiny rust spots on the rail surface). The reference surface extraction area is processed using a coordinate positioning algorithm. Using edge detection and corner point recognition techniques, several surface feature points are determined. These points are spatially distributed to form the measured special surface (such as the upper surface contour of the rail pad). For example, for areas with water accumulation on the trackbed, the system prioritizes extracting areas larger than 100 cm² and uses a sub-pixel positioning algorithm to determine the feature points at the edge of the water accumulation, ensuring the geometric accuracy of the measured special surface. The specific implementation of the coordinate positioning algorithm will be detailed in subsequent steps.
[0046] Reference Figure 3 , when the dynamic expansion algorithm calculates similar expansion values of adjacent image regions in step S101, it also includes; Step S1011: if the similarity expansion value is greater than the dynamic expansion reference, the adjacent image region is merged into the current image region to complete the image region expansion; This step compares the similarity expansion values of adjacent regions with a dynamic expansion benchmark to determine whether to merge the regions. If the similarity expansion value is greater than the dynamic expansion benchmark, the pixel value distributions of the adjacent regions are highly similar and belong to the same component feature region. These regions are then merged into the current region to complete the expansion. If the similarity expansion value is less than or equal to the dynamic expansion benchmark, the adjacent regions are deemed to have significant feature differences from the current region and are not merged. The system then continues to examine other adjacent regions. For example, in rail crack detection, if the similarity expansion value between the region at the crack edge and the rail head is less than the benchmark, the system will not mistakenly merge the crack region into the rail head, ensuring the accuracy of the crack boundary.
[0047] Step S1012: when none of the adjacent regions of the current region meet the region expansion condition, reducing the screening area of the adjacent regions to re-determine the adjacent regions of the current region; If all adjacent regions of the current region fail to meet the merging criteria, the system activates a screening area attenuation mechanism—reducing the screening area threshold for adjacent regions by a preset ratio (e.g., 20% at a time) to re-determine the range of adjacent regions that meet the criteria. This adjustment mechanism prevents missed detection of characteristic areas due to an excessively large initial screening area. For example, in scenarios where the rail surface is covered in oil, by gradually reducing the screening area, the rail head contour edge partially obscured by the oil can be accurately located. If, after the adjustment, adjacent regions still meet the criteria, the system returns to step S1011 to continue merging; if no regions still meet the criteria, the system proceeds to the next step.
[0048] Step S1013: When the screening area is smaller than the preset reference trigger area, it is considered that the expansion constraint condition is satisfied.
[0049] The system monitors the screening area in real time. When the screening area is less than a preset baseline trigger area (e.g., 10 pixels), the image details are considered fully traversed, the expansion constraint is satisfied, and image expansion ceases. If the screening area remains greater than or equal to the baseline trigger area, iterative adjustments in step S1012 are continued until the termination condition is triggered. This mechanism balances detection accuracy and computational efficiency. For example, in roadbed foreign object detection, when the screening area shrinks to less than the minimum foreign object detection threshold (e.g., 10 cm² corresponding to the pixel area), the system automatically terminates expansion to avoid inefficient computation. The specific calculation model for similarity expansion values and dynamic expansion benchmarks will be detailed in subsequent steps.
[0050] Furthermore, in this embodiment, the dynamic expansion algorithm is calculated using the following formula: ; Represents the similarity expansion value of adjacent image regions i and j, which is used to measure the similarity of pixel value distribution. represents the pixel value vector of the kth pixel in the image region i, represents the pixel value vector of the kth pixel at the corresponding position in the image region j, and n represents the number of pixels in the feature points involved in the calculation. Represents the Euclidean distance norm between image regions, which is used to calculate the difference in pixel values.
[0051] Reference Figure 4 , further comprising a dynamic benchmark sub-step for determining a dynamic expansion benchmark, the dynamic benchmark sub-step comprising: Step S1014: Determine the surface influencing features in the target image through a feature recognition algorithm, and determine the feature type weight of each influencing feature according to the type of the surface influencing feature. If a surface influencing feature of the corresponding type exists in an adjacent image area, calculate the corresponding feature type weight value according to the area of the surface influencing feature. Weight all feature type weights in the adjacent image area by the feature type weight value to obtain an attenuation expansion factor. The dynamic expansion benchmark is generated based on the attenuation expansion factor.
[0052] This step uses a feature recognition algorithm (such as HOG+SVM) to scan the target image, locate surface-affecting features (such as cracks, foreign matter, and oil stains), and assign initial feature weights based on feature type (crack weight > foreign matter weight > oil stain weight). If a surface-affecting feature of the corresponding type exists in an adjacent image region, a specific weight is calculated based on the feature area; the larger the area, the higher the weight. If no corresponding feature exists, the initial weight is used. The attenuation expansion factor (ADI) is calculated by weighted summing the weights of all feature types in the adjacent image region (for example, if the crack feature area accounts for 60% and the foreign matter area accounts for 40%, the ADI factor = 0.6 × crack weight + 0.4 × foreign matter weight). The dynamic expansion benchmark is dynamically adjusted based on the ADI factor: a larger ADI factor results in a smaller ADI factor, enhancing detection sensitivity for key features; conversely, a smaller ADI factor results in a larger ADI factor, suppressing noise interference. This mechanism adaptively balances detection accuracy in different scenarios. For example, in roadbed crack detection, it automatically increases the weight of crack features to ensure effective identification of even small cracks.
[0053] In addition, step S1015: the model presentation strategy is configured with a fitting reliability algorithm, which is used to calculate the comprehensive fitting value of the measured special surface corresponding to the target part model under different fitting vectors, and determine the fitting vector with the highest comprehensive fitting value as the presentation vector.
[0054] The reliable fitting algorithm calculates the combined fit values for different fitting vectors, selects the presentation vector corresponding to the optimal value, and achieves spatial mapping between the measured special surface and the target part model. This helps improve the matching between the model and the measured data, avoiding the coordinate deviations caused by traditional manual calibration. This is particularly true when inspecting complex components in turnout areas. It can accurately align the 3D models of the point rail and base rail, providing a reliable spatial transformation matrix for subsequent point-to-surface distance calculations, helping to improve the consistency of geometric parameter measurements. The specific calculations of the reliable fitting algorithm are further explained in the subsequent steps.
[0055] Reference Figure 5 , fitting reliable algorithms include: Step S301: obtaining the comprehensive fitting value according to the shadow compensation outlier value, wherein the shadow compensation outlier value is obtained by the deviation between the shadow vector and the presentation vector, and the shadow vector is generated by extracting the shadow area in the target image; This step extracts shadow regions from the target image to generate shadow vectors. A comprehensive fitting value is then calculated based on the shadow compensation value and shadow compensation outliers to eliminate the interference of uneven illumination on model fitting. Specifically, a brightness threshold-based image segmentation algorithm (such as the Otsu threshold method) is first used to identify shadow regions. Pixels with brightness values below 60% of the global mean brightness are considered shadow pixels, while pixels with brightness values below 60% are considered non-shadow pixels. After smoothing the shadow boundaries using a Gaussian filter, a shadow vector is generated containing the shadow position and intensity (e.g., a mask matrix and intensity gradient matrix for the shadow region).
[0056] When calculating the comprehensive fit value, the algorithm applies shadow compensation to the matching error between the measured feature points of the special surface and the corresponding points on the target part model. For feature points located in the shadow area (shadow intensity > 0.5), the matching error is weighted according to the shadow intensity ratio (for example, the error is magnified by 1.2 times when the intensity is 0.8). For feature points in the non-shadow area (shadow intensity ≤ 0.5), the standard error calculation method is used. For example, when inspecting rails at a tunnel entrance, direct sunlight causes half of the rail head to be in shadow. This compensation mechanism can reduce the fitting error of feature points in the shadow area. The specific quantitative model for shadow compensation will be explained in detail in the following steps.
[0057] The fitting reliability algorithm is calculated using the following model formula: ; in, Represents the comprehensive fitting value corresponding to the fitting vector v, v represents the fitting vector to be evaluated, Represents the coordinates of the i-th feature point of the measured special surface, represents the coordinates of the i-th corresponding point of the target part model under the fitting vector v, m represents the total number of surface feature points, Indicates the preset shadow compensation coefficient, which is used to balance the impact of shadows. Indicates the shadow intensity of the area where the i-th point is located.
[0058] The vector fitting step also includes a macro correction sub-step S302: Step S3021: Retrieving historical presentation vectors from a historical database based on the type of the target part model, and classifying the historical presentation vectors into historical presentation vector groups based on a preset vector classification strategy. The environmental information includes shooting location data, shooting device data, track information data, illumination data, and visibility data. This step retrieves historical presentation vectors for target part models (e.g., bolts, pads, switch rails, etc.) from the historical database. This retrieval process also includes corresponding environmental information, including shooting location data (e.g., mileage station number), camera equipment data (e.g., camera model and focal length), track information (e.g., curve radius and gauge), illumination data (e.g., lux), and visibility data (e.g., haze level). Using a pre-defined vector classification strategy, these historical presentation vectors are grouped into different groups based on environmental information similarity.
[0059] For example, historical vectors with an illumination of 500-1000 lux and visibility greater than 100 meters are classified as the "good illumination group." If the environmental information of a historical vector differs from the current detection scene by more than a preset threshold (e.g., an illumination deviation greater than 30%), it is excluded from the classification to ensure environmental matching within the vector group.
[0060] Step S3022: modifying the presentation vector according to the mean vector of the historical presentation vector group to generate a new presentation vector.
[0061] For each historical presentation vector group, the mean vector (the arithmetic mean of each vector parameter) is calculated and used as a benchmark to correct the current presentation vector. The specific correction logic is as follows: if the parameter deviation between the current vector and the mean vector is greater than 15% (e.g., a rotation angle difference greater than 5°), the current vector parameters are gradually adjusted by 50% of the deviation; if the deviation is ≤15%, a new presentation vector is generated by directly taking the weighted average of the mean vector and the current vector (with a weight ratio of 3:1). For example, when inspecting rails at a tunnel entrance, a historical vector group under the same lighting conditions (200-300 lux) is retrieved. The mean vector of this historical vector can correct for fitting deviations caused by sudden changes in lighting, thereby reducing the coordinate mapping error of the new presentation vector.
[0062] Vector classification strategies include: Step S30211: Calculate the presentation reliability value of each historical presentation vector according to the similarity frequency value, the interference anomaly value, and the measured deviation value, and take the historical presentation vectors whose presentation reliability values are within a preset range to generate a historical presentation vector group.
[0063] This step calculates the presentation reliability value of historical presentation vectors through multi-dimensional indicators to screen valid vectors to generate a historical group. Specifically: Similar frequency value: Count the number of times a historical vector is used under the same part type and environmental conditions. Vectors with a frequency of ≥10 times will be given a basic reliability score of +30 points, otherwise the score will be calculated based on the frequency ratio; Interference anomaly value: Checks whether there are any abnormal records such as device jitter and strong light interference when the historical vector is generated. If there is no abnormality, 0 points will be scored, and 10 points will be deducted for each type of abnormality. Measured deviation value: Compare the deviation between the actual test result corresponding to the historical vector and the manual re-test result. If the deviation is ≤0.5mm, +40 points will be given; if it is 0.5-1mm, +20 points will be given; and if it is >1mm, 0 points will be given.
[0064] The three scores are summed to obtain the presentation reliability value. The historical vectors ranked in the top 30% are selected to form the historical presentation vector group. The remaining vectors are marked as "low reliability" and excluded. For example, a historical vector used 15 times in similar scenarios with no anomalies and a measured deviation of 0.3mm has a reliability value of 30 + 0 + 40 = 70 points. If the preset threshold for the top 30% is 65 points, the vector will be selected for inclusion in the vector group, ensuring that the correction process is based on highly reliable historical data. The specific quantitative model for presentation reliability will be detailed in subsequent steps.
[0065] The deviation calculation step S500 further includes: Step S501: The distance solving algorithm generates a corresponding deviation mapping function according to the presentation vector, and substitutes the special point deviation into the deviation mapping function to output the corresponding reference distance deviation; This step generates a deviation mapping function for converting pixel deviations to physical distances based on the optimal rendering vector obtained through vector fitting. Specifically, the algorithm first integrates the spatial transformation parameters (rotation matrix, translation vector) in the rendering vector and combines them with the camera's intrinsic parameter matrix (focal length, principal point coordinates) and the physical pixel ratio (e.g., 0.5 mm / pixel) to construct a coordinate transformation model from the image plane to three-dimensional space. This model uses an interpolation algorithm to generate a continuous deviation mapping function, which directly maps the deviation of a specific point (pixel coordinate difference in the image plane) to the actual physical distance deviation.
[0066] When inputting a specific point deviation vector (such as the coordinate offset of a bolt vertex in an image), the deviation mapping function first performs camera distortion correction on the pixel deviation. Then, using a 3D spatial transformation matrix, the corrected deviation is converted to millimeter-level distance deviation. For example, when inspecting rail misalignment, if the vertical pixel deviation between the reference point in the image and the measured point is 4 pixels, the deviation mapping function can output an actual misalignment height of 2mm (based on a physical scale of 0.5mm / pixel). The specific mathematical model and parameter calibration method of this function will be explained in detail in the following steps.
[0067] The distance solution algorithm uses the following model formula for calculation: ; ; in, Indicates the reference distance deviation, represents the scale transformation matrix, represents the optimal rendering vector The corresponding coordinate transformation matrix, Represents the deviation vector of a special point.
[0068] In addition to step S500, a quick identification step S600 is also included, using the following steps: Identify the trigger condition. When the similarity between the target image and the target image in the historical data exceeds a preset similarity threshold, the coordinate mapping relationship of the target image in the historical data is used as the coordinate mapping relationship of the current target image to directly enter the point confirmation step.
[0069] When the trigger conditions are met, the system retrieves the coordinate mapping relationship (including rendering vectors, scale conversion matrix, and other parameters) corresponding to the historical image with the highest similarity to the current image from the historical database and directly uses it as the coordinate mapping relationship for the current target image, skipping the face recognition and vector fitting steps and directly entering the point confirmation step. This mechanism can significantly shorten the detection time. For example, the conventional process requires 200ms to process a single image, but only 50ms after reusing the historical mapping, making it suitable for high-speed train inspection scenarios with speeds above 200km / h. If there are multiple coordinate mapping relationships for highly similar images in the historical database, the set of parameters with the most matches and the smallest measured deviation is selected as the reuse benchmark to ensure mapping accuracy.
[0070] Those skilled in the art will clearly understand that for the sake of convenience and brevity, the division of the above-mentioned functional modules is only used as an example for illustration. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working processes of the above-mentioned systems, devices, and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0071] An embodiment of the present invention provides a computer-readable storage medium storing a computer program that can be loaded by a processor and executed by a method for detecting abnormalities in rail train components based on point-to-surface distance.
[0072] Computer storage media include, for example, various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical disks.
[0073] Based on the same inventive concept, an embodiment of the present invention provides an intelligent terminal including a memory and a processor, wherein the memory stores a computer program that can be loaded by the processor and execute a method for detecting abnormalities of rail train components based on point-to-surface distance.
[0074] Those skilled in the art will clearly understand that for the sake of convenience and brevity, the division of the above-mentioned functional modules is only used as an example for illustration. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working processes of the above-mentioned systems, devices, and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0075] The above are all preferred embodiments of the present application and are not intended to limit the scope of protection of this application. Unless otherwise specified, any feature disclosed in this specification (including the abstract and drawings) may be replaced by other equivalent or similar features. In other words, unless otherwise specified, each feature is merely an example of a series of equivalent or similar features.
Claims
1. A method for detecting abnormalities of rail train components based on point-to-surface distance, characterized in that: include: The face recognition step uses a preset face recognition strategy to identify the measured special faces in the target image and generate corresponding special recognition features; Model indexing step: retrieve the target part model from the preset part type database according to the special recognition features, and import the target part model into the spatial coordinate system; A vector fitting step includes a model rendering strategy, wherein the model rendering strategy determines a rendering vector of the target part model in the spatial coordinate system by fitting the measured special surface and the target part model in the spatial coordinate system, and constructs a coordinate mapping relationship between the spatial coordinate system and the target image based on the rendering vector; Point confirmation step, determining the graphic plane coordinates of the datum special point in the target image in the target part model according to the mapping relationship; The deviation calculation step is to calculate the difference between the reference special point and the measured special point image plane coordinates to obtain the special point deviation, and to calculate the corresponding reference distance deviation based on the special point deviation through a preset distance solution algorithm.
2. The method for detecting abnormalities of railway train components based on point-to-surface distance according to claim 1, characterized in that: The face recognition strategy includes: A plurality of original expansion points at different image plane coordinates are generated based on a pixel value range determined for the target image, each expansion point corresponding to a different pixel value range, and an image region is expanded in the target image using a preset dynamic expansion algorithm starting from the original expansion point until a preset expansion constraint condition is satisfied; A region with an area larger than a preset reference proportional area is selected as a reference surface extraction region, and a plurality of surface feature points are determined from the reference surface extraction region according to a coordinate positioning algorithm to form the measured special surface.
3. The method for detecting abnormalities of railway train components based on point-to-surface distance according to claim 2, characterized in that: The dynamic expansion algorithm is used to calculate the similarity expansion value of the adjacent image area, and if the similarity expansion value is greater than the dynamic expansion reference, the adjacent image area is merged into the current image area to complete the image area expansion; When the adjacent graph areas of the current graph area do not meet the graph area expansion conditions, the screening area of the adjacent graph areas is reduced to re-determine the adjacent graph areas of the current graph area; When the screening area is smaller than the preset reference trigger area, it is considered that the expansion constraint condition is satisfied; The dynamic expansion algorithm is calculated using the following formula: ; Represents the similarity expansion value of adjacent image regions i and j, which is used to measure the similarity of pixel value distribution. represents the pixel value vector of the kth pixel in the image region i, represents the pixel value vector of the kth pixel at the corresponding position in the image region j, and n represents the number of pixels in the feature points involved in the calculation. Represents the Euclidean distance norm between image regions, which is used to calculate the difference in pixel values.
4. The method for detecting abnormalities of railway train components based on point-to-surface distance according to claim 3, characterized in that: The method further includes a dynamic reference sub-step for determining the dynamic expansion reference, wherein the dynamic reference sub-step includes: A feature recognition algorithm is used to determine the surface influencing features in the target image, and the feature type weight of each influencing feature is determined according to the type of the surface influencing feature. If a surface influencing feature of the corresponding type exists in an adjacent image area, the corresponding feature type weight value is calculated according to the area of the surface influencing feature. The feature type weight value is used to weight all feature type weights in the adjacent image area to obtain an attenuation expansion factor. The dynamic expansion benchmark is generated based on the attenuation expansion factor.
5. The method for detecting abnormalities of railway train components based on point-to-surface distance according to claim 1, characterized in that: The model presentation strategy is configured with a fitting reliability algorithm, which is used to calculate the comprehensive fitting value of the measured special surface corresponding to the target part model under different fitting vectors, and determine the fitting vector with the highest comprehensive fitting value as the presentation vector.
6. The method for detecting abnormalities of railway train components based on point-to-surface distance according to claim 5, characterized in that: The fitting reliable algorithm includes: The comprehensive fitting value is calculated based on a shadow compensation outlier value, wherein the shadow compensation outlier value is obtained by a deviation between a shadow vector and a presentation vector, wherein the shadow vector is generated by extracting a shadow area in a target image; The fitting reliability algorithm is calculated using the following model formula: ; in, Represents the comprehensive fitting value corresponding to the fitting vector v, v represents the fitting vector to be evaluated, Represents the coordinates of the i-th feature point of the measured special surface, represents the coordinates of the i-th corresponding point of the target part model under the fitting vector v, m represents the total number of surface feature points, Indicates the preset shadow compensation coefficient, which is used to balance the impact of shadows. Indicates the shadow intensity of the area where the i-th point is located.
7. The method for detecting abnormalities of railway train components based on point-to-surface distance according to claim 5, characterized in that: The vector fitting step also includes a macro correction sub-step: The macro correction sub-step includes retrieving historical presentation vectors from a historical database according to the type of the target part model, screening historical presentation vectors that meet preset similarity conditions according to current environmental information, and classifying the historical presentation vectors into historical presentation vector groups according to a preset vector classification strategy, wherein the environmental information includes shooting position data, shooting device data, track information data, illumination data, and visibility data; The presentation vector is modified according to the mean vector of the historical presentation vector group to generate a new presentation vector.
8. The method for detecting abnormalities of railway train components based on point-to-surface distance according to claim 7, characterized in that: The vector classification strategy includes: The presentation reliability value of each historical presentation vector is calculated according to the similarity frequency value, the interference abnormality value and the measured deviation value, and the historical presentation vectors whose presentation reliability values are ranked within a preset range are selected to generate the historical presentation vector group.
9. The method for detecting abnormalities of railway train components based on point-to-surface distance according to claim 5, characterized in that: The distance solving algorithm generates a corresponding deviation mapping function according to the presentation vector, and substitutes the special point deviation into the deviation mapping function to output the corresponding reference distance deviation; The distance solving algorithm adopts the following model formula for calculation: ; ; in, Indicates the reference distance deviation, represents the scale transformation matrix, represents the optimal rendering vector The corresponding coordinate transformation matrix, Represents the deviation vector of a special point.
10. The method for detecting abnormalities of railway train components based on point-to-surface distance according to claim 1, characterized in that: It also includes a quick identification step, which includes an identification trigger condition. The identification trigger condition is that when the similarity between the target image and the target image in the historical data exceeds a preset similarity threshold, the coordinate mapping relationship of the target image in the historical data is used as the coordinate mapping relationship of the current target image to directly enter the point confirmation step.
Citation Information
Patent Citations
Point cloud plane segmentation processing method for optimizing region growth
CN117078701A
Part defect monitoring method based on three-dimensional point cloud data
CN118883554A
Three-dimensional part correction method based on 3D camera
CN118898654A
Industrial part registration method based on machine vision
CN119068030A
3D point cloud data intelligent processing method and processing device
CN119992005A
Cited By
Focused ultrasonic transducer for metering hydrogen-doped natural gas
CN121954146A