Railway track ditch area anomaly detection method and system
The two sets of cameras synchronously acquire and differential mean calculation to generate feature images, which solves the problems of large amount of data and blind spots in the prior art, and realizes the rapid accuracy and efficiency of abnormal detection of railway track ditch areas.
Patent Information
- Application Number
- CN202510637119.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-19
- Publication Date
- 2025-06-20
- Estimated Expiration
- 2045-05-19
AI Technical Summary
In the existing railway track ditch area abnormality detection methods, the data collection and processing volume are large, the operation is complicated, and there are easy blind spots in perspective, which affects the accuracy of the detection.
Two sets of cameras are used to regularly interval settings to collect ditch images synchronously, and feature images are generated through difference and mean operations, reducing data storage and processing volume, enhancing the contrast of abnormal features, and dynamically adjusting feature images to identify irregular defects.
It realizes rapid identification of abnormal features, improves the accuracy and efficiency of detection, reduces the possibility of misjudgment and misjudgment, and provides targeted maintenance basis.
Smart Images

Figure CN120182250A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to anomaly detection, and in particular to a method and system for detecting anomalies in the drain area of railway tracks. Background Art
[0002] In railway tracks, the drain is an important component. By using the drain, the accumulated water in the track can be discharged in time, avoiding the long-term contact between water and these components, which affects the service life of the components. Moreover, when the track foundation is soaked in water for a long time, it is easy to cause the foundation to become soft and sink, affecting the stability of the track. Therefore, it is necessary to detect anomalies in the drain area. Track anomalies mainly include anomalies such as silt, accumulated water, and debris. Currently, the main anomaly detection method adopted is image processing. During the image processing process, a large amount of data of the track is collected, and features of the drain, such as contours, textures, etc., are extracted through algorithms such as edge detection and morphological processing, and compared with the features in the normal state to determine whether there are anomalies. For example, by using the edge detection algorithm to detect the continuity of the drain edge, if the edge is found to be discontinuous, there may be cracks or damage, and a large amount of the collected images need to be stored and processed, resulting in a large storage capacity and cumbersome operations. Summary of the Invention
[0003] Aiming at the deficiencies of the existing technology, the purpose of the present invention is to provide a method and system for detecting anomalies in the drain area of railway tracks to overcome the above-mentioned defects in the existing technology.
[0004] To achieve the above purpose, the present invention provides the following technical solutions: A method for detecting anomalies in the drain area of railway tracks, including an image acquisition step. Two groups of cameras are arranged at the bottom of the train, and the two groups of cameras are regularly spaced to ensure that the two groups of cameras capture drain images at the same time at different positions and continuously shoot as the train moves; an image processing step. According to the drain images captured by the two groups of cameras, a mean image and a difference image are respectively generated, and through a fusion strategy, the difference image and the mean image are superimposed and displayed to generate a feature image; a defect type judgment step. An abnormal feature area in the feature image is obtained, and according to the abnormal feature area, the occurrence frequency and distribution characteristics of the abnormal feature are judged to determine the abnormal feature type, and the abnormal feature type includes regular defects and irregular defects; a regular defect analysis step. When the feature type is a regular defect, there is a preset abnormal feature library, and the abnormal feature is compared with the abnormal feature library, and the regular feature type is output according to the comparison; Irregular defect analysis steps. When the feature type is an irregular defect, initially judge the defect type, then dynamically adjust the feature image to enhance the contrast of abnormal features in the feature image, and obtain the irregular feature type through the recognition strategy.
[0005] Preferably, in the image processing steps, the first water channel image and the second water channel image collected by two cameras are obtained respectively, and the difference image is obtained according to the differential operation strategy. As the train runs, the average image is continuously obtained, and a reference image is preset. The first average image is obtained by performing an average operation on the first water channel image and the second water channel image, and the second average image is obtained by performing an average operation on the second water channel image and the first average image. As the train runs, when the first camera moves to the position where the second camera is located, the second average image is used as the reference image, and a new average image is continuously generated; in the fusion strategy, the difference image of the current water channel is fused with the average image as the background image to generate a feature image.
[0006] Preferably, an image restoration step is further included. According to the inverse operation steps in image processing, the original image is gradually restored through the feature image, and an abnormal verification sub-step is also set to obtain regular abnormal features and verify them again in the original image.
[0007] Preferably, the irregular defect analysis step includes a preliminary judgment sub-step. The preliminary judgment sub-step is used to obtain the difference image, the average image corresponding to the feature area, and the corresponding feature parameters in the image. The feature parameters include the shape feature and the color feature of the foreign object. According to the difference image and the average image, analyze the swinging situation of the foreign object, and according to the swinging situation of the foreign object, analyze the form of the foreign object. The form of the foreign object includes the blocking state and the hanging state.
[0008] Preferably, the irregular defect analysis step includes a dynamic adjustment strategy. When it is recognized that the form of the foreign object is the hanging state, contrast stretching is used to highlight the foreign object features. When it is recognized that the form of the foreign object is the blocking state, histogram equalization is used to highlight the foreign object features.
[0009] Preferably, the image processing step further includes a difference filtering sub-step, which is used to obtain the abnormal feature area in the feature image, and according to the abnormal feature area, obtain the shape feature, the color feature, and the position feature of the abnormal feature. According to the shape feature, the color feature, and the position feature, a feature index is generated through a weight algorithm, and a feature threshold is preset. When the feature index is less than the feature threshold, it is determined that the abnormal feature is a normal difference, and the normal difference is filtered out from the feature image, and a new feature image is generated.
[0010] Preferably, it further includes a camera dynamic adjustment step. The camera includes a first camera and a second camera. The first camera is arranged at the head of the train, and the second camera is slidably arranged at the bottom of the train. After the first camera continuously captures two groups of drainage ditches, the second camera moves to the first group of drainage ditches so that the first camera and the second camera synchronously capture images of two groups of drainage ditches.
[0011] Preferably, it further includes a sensor verification step. Obtain the drainage ditch images captured by the two cameras at the same position, calculate the difference between the two drainage ditch images, and preset an error threshold. When the difference is greater than the error threshold, a correction command is generated to adjust the parameters of the two cameras until the difference is less than the error threshold.
[0012] An abnormal detection system for the drainage ditch area of a railway track includes an image acquisition module. Two cameras are arranged at the bottom of the train. The two cameras are regularly arranged at intervals to ensure that the two cameras simultaneously capture drainage ditch images at different positions and continuously capture images as the train moves. an image processing module. According to the drainage ditch images captured by the two cameras, a mean image and a difference image are respectively generated, and through a fusion strategy, the difference image and the mean image are superimposed and displayed to generate a feature image. a defect type judgment module. Obtain the abnormal feature area in the feature image, and according to the abnormal feature area, judge the occurrence frequency and distribution characteristics of the abnormal feature, and judge the abnormal feature type. The abnormal feature type includes regular defects and irregular defects. a regular defect analysis module. When the feature type is a regular defect, an abnormal feature library is preset, and the abnormal feature is compared with the abnormal feature library, and the regular feature type is output according to the comparison. an irregular defect analysis module. When the feature type is an irregular defect, the defect type is initially judged, then the feature image is dynamically adjusted to enhance the contrast of the abnormal feature in the feature image, and through an identification strategy, the irregular feature type is obtained.
[0013] Advantages of the present invention: By synchronously collecting images with two groups of cameras, and performing difference operation and mean operation to generate feature images, the storage amount and processing amount of data in the abnormal feature recognition process can be reduced, and rapid recognition of abnormal features can be achieved; the two groups of cameras are regularly arranged at intervals, capturing the images of the water channel simultaneously, obtaining more comprehensive water channel information, avoiding the perspective blind area that may exist in a single camera, and improving the detection accuracy; by generating and superimposing the mean image and the difference image, the abnormal features in the water channel are effectively highlighted, making it easier for inspectors or subsequent analysis algorithms to discover and identify abnormalities; by analyzing the occurrence frequency and distribution characteristics of abnormal features and comparing with the abnormal feature library, the type of defect can be accurately judged, providing a basis for targeted maintenance work and improving the maintenance efficiency; the recognition strategy can be based on machine learning or deep learning algorithms, such as support vector machines, convolutional neural networks, etc. Through learning a large number of labeled samples, accurate classification of non-regular defects can be achieved; dynamically adjusting the feature image according to the preliminary judgment result can perform adaptive processing for different types of non-regular defects, improving the flexibility and adaptability of the detection system; by enhancing the image contrast and adopting an effective recognition strategy, the recognition accuracy of non-regular defects is improved, and the possibility of false judgment and missed judgment is reduced. Brief Description of the Drawings
[0014] Figure 1 is the overall flowchart of the present invention; Figure 2 is the flowchart of the processing steps of the present invention; Figure 3 is the water channel image of the present invention; Figure 4 is another water channel image of the present invention. Detailed Embodiments
[0015] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0016] It should be noted that when a component is referred to as being "fixed to" another component, it can be directly on the other component or there may also be an intermediate component. When a component is considered to be "connected" to another component, it can be directly connected to the other component or there may be an intermediate component at the same time. When a component is considered to be "disposed on" another component, it can be directly disposed on the other component or there may be an intermediate component at the same time. The terms "vertical", "horizontal", "left", "right" and similar expressions used herein are only for the purpose of illustration.
[0017] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the technical field to which this invention belongs. The terms used in the specification of this invention are for the purpose of describing specific embodiments only and are not intended to limit the invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.
[0018] The following further details the embodiments of the present invention with reference to the accompanying drawings: As Figures 1-4 shown, the present invention provides a method for detecting anomalies in the drainage ditch area of a railway track, including an image acquisition step. Two sets of cameras are provided at the bottom of the train. The two sets of cameras are regularly spaced to ensure that the two sets of cameras capture drainage ditch images simultaneously at different positions and continuously shoot as the train moves; two sets of cameras are installed at the bottom of the train. According to the surrounding environment of the track and the requirements of detection accuracy, the spacing distance between the two sets of cameras is set to achieve regular spaced arrangement. The two sets of cameras shoot the drainage ditch from different positions at the same moment to obtain image data with spatial complementarity. During the operation of the train, the two sets of cameras continuously work and uninterruptedly capture drainage ditch images, providing a large number of data samples for subsequent analysis.
[0019] an image processing step. According to the drainage ditch images captured by the two sets of cameras, a mean image and a difference image are respectively generated, and through a fusion strategy, the difference image and the mean image are superimposed and displayed to generate a feature image; the mean values of the drainage ditch images collected by the two sets of cameras are respectively calculated with a reference image to generate a mean image, and the images captured by the two sets of cameras at the same moment are subtracted to obtain a difference image. The difference image highlights the differences between the two images, and these differences may correspond to abnormal areas in the drainage ditch, such as cracks, foreign object accumulation, etc.; a fusion strategy is adopted to superimpose the difference image and the mean image. The fusion can be performed according to the gray value or color channel of the image to generate a feature image. The feature image synthesizes the information of the mean image and the difference image, and the generated feature image reflects the abnormal features of the drainage ditch.
[0020] a defect type judgment step. The abnormal feature areas in the feature image are obtained, and according to the abnormal feature areas, the occurrence frequency and distribution characteristics of the abnormal features are judged to determine the abnormal feature type. The abnormal feature types include regular defects and irregular defects; the abnormal feature areas are extracted, the occurrence frequency of the abnormal feature areas in the feature image is counted, and their distribution characteristics are analyzed; if the abnormal features appear at similar positions and in similar forms in multiple images, they may belong to regular defects; if the abnormal features appear randomly and there is no obvious pattern in their distribution, they may be irregular defects; Regular defect analysis steps: When the feature type is a regular defect, there is a preset abnormal feature library. The abnormal features are compared with the abnormal feature library, and the regular feature type is output according to the comparison. When it is determined as a regular defect, the obtained abnormal features are compared with the preset abnormal feature library. A variety of known regular defect features are pre-stored in the abnormal feature library. The feature matching algorithm can be used to calculate the similarity between the abnormal features and the features in the library. According to the comparison result, the regular feature type with the highest similarity to the abnormal features is output to clarify the specific regular defects existing in the water channel. Regular defect features include silt, water accumulation, etc., which are sustainable and observable defects. The two groups of cameras are set at regular intervals to capture the water channel images simultaneously, obtaining more comprehensive water channel information, avoiding the perspective blind spots that may exist in a single camera, and improving the detection accuracy. By generating and superimposing the mean image and the difference image, the abnormal features in the water channel are effectively highlighted, making it easier for the detection personnel or subsequent analysis algorithms to discover and identify the abnormalities. By analyzing the occurrence frequency and distribution characteristics of the abnormal features and combining the comparison with the abnormal feature library, the defect type can be accurately judged, providing a basis for targeted maintenance work and improving the maintenance efficiency.
[0021] Irregular defect analysis steps: When the feature type is an irregular defect, the defect type is initially judged, and then the feature image is dynamically adjusted to enhance the contrast of the abnormal features in the feature image, and through the recognition strategy, the irregular feature type is obtained. Irregular defect types include plastic bags, stones, sundries, etc. When it is judged as an irregular defect, the defect type is roughly judged by initially analyzing the features such as the shape, size, and gray level of the abnormal features. According to the initial judgment result, the feature image is dynamically adjusted to enhance the contrast of the abnormal features in the image. Image enhancement algorithms such as histogram equalization and contrast stretching can be used to highlight the abnormal features and suppress the background information. The recognition strategy is used to process the enhanced feature image to accurately obtain the irregular feature type. The recognition strategy can be based on machine learning or deep learning algorithms such as support vector machines and convolutional neural networks. Through learning a large number of labeled samples, accurate classification of irregular defects is achieved. Dynamically adjusting the feature image according to the initial judgment result can perform adaptive processing for different types of irregular defects, improving the flexibility and adaptability of the detection system. By enhancing the image contrast and adopting an effective recognition strategy, the recognition accuracy of irregular defects is improved, reducing the possibility of misjudgment and missed judgment.
[0022] Image processing steps: respectively obtain the first ditch image and the second ditch image collected by two groups of cameras, and according to the differential operation strategy, obtain the difference image. As the train runs, continuously obtain the mean image, and preset a reference image. The first ditch image and the second ditch image are subjected to mean operation to obtain the first mean image, and the second ditch image and the first mean image are subjected to mean operation to obtain the second mean image. As the train runs, when the first camera moves to the position where the second camera is located, the second mean image is used as the reference image, and new mean images are continuously generated; Fusion strategy: using the mean image as the background image, perform fusion operation on the difference image of the current ditch to generate a feature image; When the train starts to execute the ditch area detection task, the system synchronously triggers the two groups of cameras to start working, and captures the ditch images at the same moment, which are respectively recorded as the first ditch image and the second ditch image. With the help of the differential operation strategy, perform difference calculation on the corresponding pixel points of the two groups of images. During the continuous running of the train, continuously collect and calculate according to the above method to obtain a series of difference images; Perform mean operation on the collected first ditch image and second ditch image to obtain the first mean image. Then, perform mean operation on the second ditch image and the first mean image to obtain the second mean image. As the train continues to run, when the first camera moves to the position where the second camera is located, the system sets the second mean image as the new reference image. Subsequently, based on the new reference image, combined with the newly collected ditch images, according to the above mean operation method, continuously generate new mean images. After obtaining the mean image and the difference image, use the mean image as the background image and perform fusion operation with the difference image of the current ditch to provide data support for subsequent defect type judgment.
[0023] Spatio-temporal alignment function
[0024]
[0025]
[0026] Where is the first ditch image, B is the bilinear difference function, is the dynamic coordinate mapping function, is the train motion speed component, D is the dynamic time planning function, is the time decay factor, is the reference time, is the time offset; Gaussian weighted difference
[0027] is the spatio-temporal domain difference image, is the adaptive Gaussian function, is an integration region centered at (x, y) with a radius of r. is the edge weight coefficient, and erfc is the error compensation function. is the gradient threshold, and N is the number of edge pixels. Recursive mean generation
[0028] is the mean image updated at the nth time. is the recursive decay factor, and T is the time window length. is the historical increment decay rate. is the current moment. is the temporal gradient of the mean image. Reference image update
[0029] is the updated reference image, and H is the step function. Adaptive fusion
[0030] F(x, y) is the feature image. is the mean image. is the reference image, and N is the adaptive normalization function. , is the fusion scale parameter. is the curvature function region. , is the numerical stability term.
[0031] Specific embodiment calculation The first ditch image
[0032]
[0033] The first ditch image
[0034]
[0035] Step 1, spatio-temporal alignment Parameter setting:
[0036]
[0037] Step 2, Gaussian weighted difference Parameter setting:
[0038]
[0039] Step 3, recursive mean generation Parameter setting
[0040]
[0041] When the historical gradient is 0
[0042] Step 4, benchmark update Parameter setting
[0043] Benchmark judgment:
[0044]
[0045] Step 5, adaptive fusion Parameter setting:
[0046]
[0047] The curvature term is 0, F(2, 2) = 13.22 It also includes an image restoration step. According to the inverse operation steps in image processing, the original image is gradually restored through the feature image. An abnormal verification sub-step is also set to obtain regular abnormal features and verify them again in the original image.
[0048] The non - regular defect analysis steps include a preliminary judgment sub - step. The preliminary judgment sub - step is used to obtain the difference image, the mean image corresponding to the feature region, and the corresponding feature parameters in the image. The feature parameters include the shape features and color features of the foreign object. According to the difference image and the mean image, analyze the swinging situation of the foreign object, and based on the swinging situation of the foreign object, analyze the shape of the foreign object. The shape of the foreign object includes a blocked state and a suspended state. After obtaining the feature region, the system extracts the corresponding difference image and mean image of this region. At the same time, with the help of image analysis technology, extract feature parameters such as the shape and color of the foreign object: use contour detection algorithms, such as the Canny edge detection combined with the contour discovery algorithm. First, use the Canny algorithm to detect the edges of the image, and then use the cv2.findContours function to obtain the contour of the foreign object. Based on the contour information, calculate parameters such as perimeter, area, convex hull, etc. Convert the image from the RGB color space to the HSV or Lab color space, which is more in line with human perception when describing colors. Calculate statistics such as the mean and variance of the color components in a specific region to accurately describe the color features of the foreign object. According to the swinging situation of the foreign object, judge whether it is in a blocked state or a suspended state: if the position of the foreign object in the image is relatively fixed and in close contact with the ditch structure without obvious swinging signs, it is determined to be in the blocked state, such as fixed foreign objects like stones. When the foreign object shows obvious swinging, with frequent position changes and not being closely connected to the ditch structure, it is determined to be in the suspended state, such as foreign objects like garbage bags and fabrics.
[0049] The non - regular defect analysis steps include a dynamic adjustment strategy. When it is recognized that the shape of the foreign object is in the suspended state, contrast stretching is adopted to highlight the features of the foreign object. By setting the minimum and maximum gray values of the image, the gray range of the image is stretched to a specified interval to increase the contrast between the two. When it is recognized that the shape of the foreign object is in the blocked state, histogram equalization is adopted to highlight the features of the foreign object; calculate the gray - level histogram of the image, count the frequency of each gray - level occurrence, and according to the cumulative distribution function, map the gray values of the original image to a new gray range to make the gray distribution of the image more uniform and enhance the contrast of the image.
[0050] The image processing steps also include a differential filtering sub-step, which is used to obtain the abnormal feature regions in the feature image, and based on the abnormal feature regions, obtain the shape features, color features, and position features of the abnormal features. According to the shape features, color features, and position features, through a weight algorithm, a feature index is generated, and a feature threshold is preset. When the feature index is less than the feature threshold, it is determined that the abnormal feature is a normal difference, and the normal difference is filtered out from the feature image, and a new feature image is generated; considering that the gray-scale distribution of different regions of the image may vary, the local threshold method calculates the threshold for different sub-regions of the image respectively. For example, the adaptive threshold method dynamically calculates the threshold of each pixel point according to the pixel value distribution in the neighborhood of the pixel point, so as to better adapt to the uneven illumination in the image and accurately extract the abnormal feature regions; to comprehensively describe the shape of the abnormal feature regions, multiple algorithms are used to calculate relevant parameters. By recording the direction codes of adjacent pixel points on the contour, the shape of the contour can be described, which can be used to analyze the trend and change trend of the contour. Geometric parameters such as the perimeter, area, and aspect ratio of the region are calculated. Among them, the perimeter can be obtained by calculating the sum of the distances between adjacent points using the discretized contour points; the area can be obtained by counting the number of pixel points in the region; the aspect ratio is determined by calculating the ratio of the length and width of the circumscribed rectangle of the region; color features are extracted by means of color space conversion and statistical methods. In the RGB color space, statistical quantities such as the mean and variance of the RGB three channels of the pixel points in the region are calculated to reflect the color distribution of the region; by calculating the distance between the region and the image boundary, as well as the relative position relationship with other reference points or regions, the position features are further clarified; the weight algorithm is used to integrate the extracted shape, color, and position features into a feature index; using a large amount of labeled data, through machine learning algorithms such as linear regression and decision trees, the optimal weight values are trained to enable the model to better distinguish normal differences and true abnormal features; the system presets a feature threshold and compares the generated feature index with this threshold. When the feature index is less than the feature threshold, it is determined that the abnormal feature is a normal difference. To filter out the normal difference from the feature image, a masking operation is used. By creating a masking image with the same size as the feature image, in the masking image, the pixel values of the corresponding normal difference regions are set to 0, and the other regions are set to 255. Then, the masking image and the feature image are subjected to a bitwise AND operation to obtain the new feature image after filtering out the normal difference; after the above differential filtering steps, the system can effectively remove the normal differences in the feature image and highlight the true abnormal features, providing more reliable data support for accurately judging the defect types in the railway track gutter area in the subsequent stage.
[0051] It also includes a camera dynamic adjustment step. The camera includes a first camera and a second camera. The first camera is arranged at the head of the train, and the second camera is slidably arranged at the bottom of the train. After the first camera continuously captures two groups of drainage ditches, the second camera moves to the first group of drainage ditches so that the first camera and the second camera synchronously capture images of the two groups of drainage ditches. The first camera at the head of the train continuously collects images of the railway track drainage ditches at a set frequency. Using an image recognition algorithm, the position and characteristics of the drainage ditches are identified from the collected images. Object detection algorithms can be used, such as the YOLO series algorithms based on deep learning. YOLO regards the object detection task as a regression problem and can simultaneously predict the bounding box and class probability of the object in a single neural network, quickly and accurately identifying the drainage ditches in the image; when the first camera continuously captures images of two groups of drainage ditches, the position coordinates of the two groups of drainage ditches in the image are determined through image analysis. Combining parameters such as the train running speed and the shooting time interval, the position of the drainage ditches in the actual track is calculated, and precise marking is achieved by means of an odometer or GPS positioning technology. Based on the actual position information of the two groups of drainage ditches, a moving path is planned for the second camera at the bottom of the train. The A* algorithm is used. This algorithm is a heuristic search algorithm that finds the optimal path from the current position to the target position (the first group of drainage ditches) by calculating the sum of the actual cost and the estimated cost from the starting point to the end point, ensuring that the second camera moves with the shortest path and the fastest speed. According to the planned path, the second camera realizes sliding movement through the motor drive system. When the second camera moves to the first group of drainage ditches, it is necessary to ensure that the first camera and the second camera capture images synchronously. A time synchronization algorithm, such as NTP (Network Time Protocol), is used to obtain a unified time source through the network, calibrate the shooting times of the two cameras, ensure that they capture images at the same moment, and the two groups of drainage ditch images obtained have time consistency; based on the time synchronization signal, a shooting trigger mechanism is designed. When the synchronous shooting signal is received, the first camera and the second camera are triggered simultaneously to capture images, ensuring that the two groups of drainage ditch images collected can reflect the state of the drainage ditches at the same moment, providing reliable data for subsequent image processing and analysis.
[0052] It also includes a sensor verification step, which acquires the images of the drainage ditch taken by two sets of cameras at the same position, calculates the difference between the two sets of drainage ditch images, and presets an error threshold. When the difference is greater than the error threshold, a correction command is generated to adjust the parameters of the two sets of cameras until the difference is less than the error threshold. When the two sets of cameras move to the same position, they simultaneously capture the images of the railway track drainage ditch. To ensure the accuracy of subsequent comparison, it is necessary to accurately pair the acquired images. The image feature matching algorithm, such as the SIFT (Scale-Invariant Feature Transform) algorithm, is used. The SIFT algorithm detects the key points in the image, calculates the descriptors of the regions around the key points, and then matches the corresponding points in different images based on the similarity of the descriptors. Specifically, the SIFT algorithm first constructs the scale space of the image, detects the extreme points as key points in the scale space; then, generates a unique descriptor for each key point, and the descriptor contains the gradient information of the region around the key point; finally, by comparing the Euclidean distances of the key point descriptors in different images, the feature matching between images is realized, so as to determine whether the images taken by the two sets of cameras are of the same drainage ditch scene. For the paired two sets of drainage ditch images, the difference is calculated pixel by pixel. Usually, the absolute difference calculation method is adopted, and the system presets an error threshold, and the calculated image difference is compared with the error threshold. If the difference is greater than the error threshold, it indicates that there are significant differences between the images collected by the two sets of cameras, and the parameters of the cameras need to be corrected. At this time, a correction command is generated. After receiving the correction command, it is necessary to adjust the parameters of the two sets of cameras to reduce the image difference. Common adjustment parameters include focal length, exposure time, gain, etc. An iterative optimization algorithm, such as the gradient descent algorithm, can be used. Taking the focal length adjustment as an example, first define an objective function, which uses the image difference as a measure, and the goal is to minimize the image difference. Then, calculate the gradient of the objective function with respect to the focal length, and adjust the focal length value according to the gradient direction. In each iteration process, change the focal length according to a certain step size, re-take the image and calculate the difference until the image difference is less than the error threshold. Through continuous iteration, the optimal camera parameters are gradually found to ensure that the images collected by the two sets of cameras have high consistency.
[0053] An abnormal detection system for the drainage ditch area of a railway track, comprising an image acquisition module, where two sets of cameras are arranged at the bottom of the train, and the two sets of cameras are regularly arranged at intervals to ensure that the two sets of cameras simultaneously capture the images of the drainage ditch at different positions and continuously shoot as the train moves; an image processing module, which respectively generates a mean image and a difference image based on the images of the drainage ditch taken by the two sets of cameras, and superimposes and displays the difference image and the mean image through a fusion strategy to generate a feature image; The defect type judgment module obtains the abnormal feature area in the feature image, and based on the abnormal feature area, judges the occurrence frequency and distribution characteristics of the abnormal feature, and judges the abnormal feature type. The abnormal feature type includes regular defects and irregular defects; The regular defect analysis module, when the feature type is a regular defect, presets an abnormal feature library, compares the abnormal feature with the abnormal feature library, and outputs the regular feature type according to the comparison; The irregular defect analysis module, when the feature type is an irregular defect, initially judges the defect type, then dynamically adjusts the feature image, enhances the contrast of the abnormal feature in the feature image, and obtains the irregular feature type through the recognition strategy.
[0054] The above is only the preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions falling within the idea of the present invention belong to the protection scope of the present invention. It should be pointed out that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and refinements should also be regarded as the protection scope of the present invention.
Claims
1. A method for detecting abnormalities in a ditch area of a railway track, characterized in that: include In the image acquisition step, two groups of cameras are arranged at the bottom of the train, and the two groups of cameras are arranged at regular intervals to ensure that the two groups of cameras simultaneously capture the ditch images at different positions and continue to shoot as the train moves; An image processing step is to generate a mean image and a difference image respectively according to the ditch images captured by the two groups of cameras, and to superimpose and display the difference image and the mean image through a fusion strategy to generate a feature image; The defect type determination step is to obtain the abnormal feature area in the feature image, and determine the occurrence frequency and distribution characteristics of the abnormal feature according to the abnormal feature area, and determine the abnormal feature type, wherein the abnormal feature type includes regular defects and irregular defects; Regularity defect analysis step: when the feature type is a regularity defect, an abnormality feature library is preset, the abnormal feature is compared with the abnormality feature library, and the regularity feature type is output according to the comparison; In the irregular defect analysis step, when the feature type is an irregular defect, the defect type is preliminarily determined, the feature image is dynamically adjusted to enhance the contrast of the abnormal feature in the feature image, and the irregular feature type is obtained through the recognition strategy.
2. The method for detecting anomalies in a ditch area of a railway track according to claim 1, characterized in that: The image processing step obtains the first ditch image and the second ditch image collected by the two groups of cameras respectively, and obtains the difference image according to the difference operation strategy. As the train runs, the mean image is continuously obtained, and a reference image is preset. The first ditch image and the second ditch image are averaged to obtain a first mean image, and the second ditch image and the first mean image are averaged to obtain a second mean image. As the train runs, when the first camera moves to the location of the second camera, the second mean image is used as the reference image to continuously generate new mean images. The fusion strategy uses the mean image as the background image, performs a fusion operation on the difference image of the current ditch, and generates a feature image.
3. The method for detecting anomalies in a ditch area of a railway track according to claim 2, characterized in that: The method also includes an image restoration step, which gradually restores the original image through the feature image according to the inverse operation step in image processing. An abnormality verification sub-step is also provided to obtain regular abnormal features and verify them again in the original image.
4. The method for detecting anomalies in a ditch area of a railway track according to claim 1, characterized in that: The irregular defect analysis step includes a preliminary judgment sub-step, which is used to obtain a difference image and a mean image corresponding to the feature area and corresponding feature parameters in the image, wherein the feature parameters include shape features and color features of the foreign body, and analyze the swing of the foreign body based on the difference image and the mean image, and analyze the morphology of the foreign body based on the swing of the foreign body, wherein the morphology of the foreign body includes a blocked state and a suspended state.
5. The method for detecting anomalies in a ditch area of a railway track according to claim 4, characterized in that: The irregular defect analysis step includes a dynamic adjustment strategy. When the foreign body is identified as being in a hanging state, contrast stretching is used to highlight the foreign body features. When the foreign body is identified as being in a blocked state, histogram equalization is used to highlight the foreign body features.
6. The method for detecting anomalies in a ditch area of a railway track according to claim 1, characterized in that: The image processing step also includes a difference filtering sub-step, which is used to obtain the abnormal feature area in the feature image, and based on the abnormal feature area, obtain the shape feature, color feature and position feature of the abnormal feature, and generate a feature index through a weighting algorithm based on the shape feature, color feature and position feature, and preset a feature threshold. When the feature index is less than the feature threshold, the abnormal feature is determined to be a normal difference, and the normal difference is filtered out from the feature image, and a new feature image is generated.
7. The method for detecting anomalies in a ditch area of a railway track according to claim 1, characterized in that: It also includes a camera dynamic adjustment step, wherein the camera includes a first camera and a second camera, the first camera is arranged at the head of the train, and the second camera is slidably arranged at the bottom of the train, and after the first camera continuously captures two groups of ditches, the second camera moves to the first group of ditches, so that the first camera and the second camera synchronously capture the two groups of ditch images.
8. The method for detecting anomalies in a ditch area of a railway track according to claim 1, characterized in that: The method also includes a sensor verification step, which obtains the ditch images taken by the two groups of cameras at the same position, calculates the difference between the two groups of ditch images, and presets an error threshold. When the difference is greater than the error threshold, a correction command is generated to adjust the parameters of the two groups of cameras until the difference is less than the error threshold.
9. A railway track ditch area anomaly detection system, characterized in that: include Image acquisition module: two sets of cameras are set at the bottom of the train. The two sets of cameras are regularly spaced to ensure that the two sets of cameras capture the ditch images at different positions at the same time and continue to shoot as the train moves; An image processing module generates a mean image and a difference image according to the ditch images captured by the two groups of cameras, and superimposes the difference image and the mean image to generate a feature image through a fusion strategy; The defect type judgment module obtains the abnormal feature area in the feature image, and judges the occurrence frequency and distribution characteristics of the abnormal feature according to the abnormal feature area, and judges the abnormal feature type, wherein the abnormal feature type includes regular defects and irregular defects; A regular defect analysis module, when the feature type is a regular defect, has a preset abnormal feature library, compares the abnormal feature with the abnormal feature library, and outputs the regular feature type according to the comparison; The irregular defect analysis module preliminarily determines the defect type when the feature type is an irregular defect, dynamically adjusts the feature image, enhances the contrast of the abnormal feature in the feature image, and obtains the irregular feature type through the recognition strategy.
Citation Information
Patent Citations
Mass measuring method and device based on belt conveyor
CN109163775A
Road dust detection method and related equipment
CN118823720A
Aviation transparent part defect collection and detection method based on mixed illumination
CN119310108A
Glass wine bottle surface defect detection method and system
CN119438210A
2.5 D imaging and AI combined safety buckle full-appearance visual detection method and system
CN119715569A