Detection Method, System, Electronic Device and Storage Medium for Track Defects

By performing singular value decomposition, significance detection and gradient amplitude calculation on the track image, combined with weighted fusion feature images, the problems of low image quality and high error detection rate in the existing technology are solved, and efficient and stable detection of rail surface defects is achieved.

CN114648520BActive Publication Date: 2025-06-24SHANGHAI ELECTRICGROUP CORP
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210347851.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-01
Publication Date
2025-06-24
Estimated Expiration
2042-04-01

AI Technical Summary

Technical Problem

When using image reconstruction for track defect detection in the prior art, the reconstructed image quality is low and false detection is prone to occur, making it difficult to adapt to different complex imaging backgrounds.

Method used

By performing singular value decomposition, significance detection and gradient amplitude calculation on the track image to be processed, several feature images are obtained and weighted fusion is performed to determine the defect area in the track image.

Benefits of technology

It realizes efficient detection of rail surface defects, overcomes background clutter interference, is suitable for detection of complex track defects of multiple scales and morphologies, and does not require sample training and is low in cost.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114648520B_ABST
    Figure CN114648520B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, system, electronic device and storage medium for detecting rail defects. The method for detecting rail defects includes: performing singular value decomposition, saliency detection and gradient magnitude calculation on a to-be-processed rail image respectively to obtain corresponding several feature images; performing weighted fusion on the several feature images to obtain a weighted fusion feature image; and determining a defect area in the to-be-processed rail image based on the weighted fusion feature image. The method for detecting rail defects provided by the present invention realizes an unsupervised machine vision processing method combining visual multi-feature fusion by performing singular value decomposition, saliency detection and gradient magnitude calculation processing on the to-be-processed rail image respectively, and fusing the obtained several feature images. It can efficiently detect defects on the rail surface and is applicable to the detection of complex defects of various scales and forms.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of rail transit operation and maintenance inspection, and particularly relates to a method, a system, an electronic device, and a storage medium for detecting rail defects. Background Art

[0002] The rapid development of railway construction has led to an increasing total mileage of transportation year by year. However, while enhancing the passenger and freight transportation capacity, it has also brought high costs for line patrol and maintenance. Among them, due to the continuous high-intensity extrusion and friction with the wheels and the long-term erosion of natural factors such as rain, snow, wind, and frost, many pits and defects of varying degrees will appear on the surface of the railway track, which will affect the stability of train operation and pose potential safety hazards to train operation. Therefore, it is very necessary to regularly detect the defects on the railway track surface.

[0003] Traditional detection of railway track surface defects mainly relies on manual visual inspection of the track sections with relatively serious conditions. However, this method not only has low efficiency and long cycle time, but also is prone to human omissions. In contrast, using machine vision technology to automatically detect defects in the scanned and imaged railway track surface images can greatly improve work efficiency, shorten the time cycle, and significantly reduce labor costs.

[0004] The rail defect detection method used in the prior art is to perform image reconstruction on the rail image to obtain its difference image, and obtain the defect area based on the difference information between the original image and the reconstructed image. However, this method has the following defects: (1) Image reconstruction is very sensitive to the selection of the reconstruction algorithm model and its parameters, and the quality of the reconstructed image is very easily interfered by background clutter factors, and its adaptability to different complex imaging backgrounds is poor; and (2) The image difference method is greatly interfered by background noise and texture clutter, it is difficult to distinguish small defects and background clutter, and it is easy to introduce false alarms and cause misdetection. Summary of the Invention

[0005] The technical problem to be solved by the present invention is to overcome the defects of low-quality reconstructed images and easy misdetection when using image reconstruction for rail defect detection in the prior art, and provide a method, a system, an electronic device, and a storage medium for detecting rail defects.

[0006] The present invention solves the above technical problems through the following technical solutions:

[0007] In a first aspect, the present invention provides a method for detecting rail defects, and the method for detecting rail defects includes:

[0008] Performing singular value decomposition, saliency detection, and gradient magnitude calculation on the to-be-processed rail image respectively to obtain corresponding several feature images;

[0009] Perform weighted fusion on the plurality of feature images to obtain a weighted fusion feature image;

[0010] Determine a defect area in the to-be-processed track image based on the weighted fusion feature image.

[0011] Preferably, the plurality of feature images include a singular pixel contrast enhancement feature image;

[0012] The steps of the singular value decomposition specifically include:

[0013] Calculate the difference between the gray values of a plurality of target pixel points and reference pixel points in the to-be-processed track image to obtain a singular pixel contrast enhancement feature image, wherein the distance between the reference pixel point and the target pixel point is less than a first threshold;

[0014] And / or, the plurality of feature images include a singular row contrast enhancement feature image;

[0015] The steps of the singular value decomposition specifically include:

[0016] Calculate the difference between the gray values of a plurality of target pixel rows and reference pixel rows in the to-be-processed track image to obtain a singular row contrast enhancement feature image, wherein the distance between the reference pixel row and the target pixel row is less than a second threshold.

[0017] Preferably, the plurality of feature images include a visual saliency feature image;

[0018] The steps of the saliency detection specifically include:

[0019] Perform Fourier transform and phase spectrum calculation on the to-be-processed track image to obtain a visual saliency map;

[0020] Perform smoothing filtering on the visual saliency map to obtain a visual saliency feature image.

[0021] Preferably, the plurality of feature images include a probability distribution image for characterizing a non-edge region;

[0022] The steps of the gradient magnitude calculation specifically include:

[0023] Calculate the gradient magnitude of each pixel point in the to-be-processed track image to obtain a gradient magnitude image;

[0024] Perform smoothing filtering and inversion operations on the gradient magnitude image to obtain the probability distribution image.

[0025] Preferably, the step of determining a defect area in the to-be-processed track image based on the weighted fusion feature image includes:

[0026] Perform adaptive threshold segmentation on the weighted fusion feature image to obtain a binary image;

[0027] Perform mathematical morphological opening operation on the binary image to determine the defect area.

[0028] Preferably, the method further includes:

[0029] Obtain an initial track image;

[0030] Perform filtering processing on the initial track image to obtain the track image to be processed.

[0031] Preferably, the filtering processing includes L0 gradient minimization filtering and median filtering.

[0032] In a second aspect, the present invention provides a detection system for track defects, and the detection system for track defects includes:

[0033] An image processing module, configured to perform singular value decomposition, saliency detection, and gradient magnitude calculation on the track image to be processed respectively to obtain corresponding feature images;

[0034] A feature fusion module, configured to perform weighted fusion on the feature images to obtain a weighted fusion feature image;

[0035] A defect detection module, configured to determine the defect area in the track image to be processed based on the weighted fusion feature image.

[0036] In a third aspect, the present invention provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the detection method for track defects as described above is implemented.

[0037] In a fourth aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the detection method for track defects as described above is implemented.

[0038] The positive and progressive effects of the present invention are as follows: The detection method for track defects provided by the present invention performs singular value decomposition, saliency detection, and gradient magnitude calculation processing on the track image to be processed respectively, and performs weighted fusion on the obtained feature images, thereby realizing an unsupervised machine vision processing method combining visual multi-feature fusion. It can efficiently detect defects on the railway track surface, effectively overcome the background clutter interference in the track image under the load environment, has strong environmental adaptability, stable detection effect, and is applicable to the detection of complex track defects of various scales and forms; and it does not need to collect samples for training during actual application, has strong applicability and low application cost. Description of the Drawings

[0039] Figure 1 It is the first process schematic diagram of the detection method for track defects in Embodiment 1 of the present invention.

[0040] Figure 2 It is the initial track image of the scan input in Embodiment 1 of the present invention.

[0041] Figure 3 It is the partial process schematic diagram of the detection method for track defects in Embodiment 1 of the present invention.

[0042] Figure 4 It is the track image to be processed after filtering in Embodiment 1 of the present invention.

[0043] Figure 5 It is the first process schematic diagram of singular value decomposition in step S1 of the detection method for track defects in Embodiment 1 of the present invention.

[0044] Figure 6 It is the singular pixel contrast enhancement feature image obtained by singular value decomposition in Embodiment 1 of the present invention.

[0045] Figure 7 It is the second process schematic diagram of singular value decomposition in step S1 of the detection method for track defects in Embodiment 1 of the present invention.

[0046] Figure 8 It is the singular row contrast enhancement feature image obtained by singular value decomposition in Embodiment 1 of the present invention.

[0047] Figure 9 It is the process schematic diagram of saliency detection in step S1 of the detection method for track defects in Embodiment 1 of the present invention.

[0048] Figure 10 It is the visual saliency feature image obtained by saliency detection in Embodiment 1 of the present invention.

[0049] Figure 11 It is the process schematic diagram of gradient magnitude calculation in step S1 of the detection method for track defects in Embodiment 1 of the present invention.

[0050] Figure 12 It is the probability distribution image of non-edge regions obtained by gradient magnitude calculation in Embodiment 1 of the present invention.

[0051] Figure 13 It is the multi-feature weighted fusion feature image obtained by weighted feature fusion in Embodiment 1 of the present invention.

[0052] Figure 14 It is the sub-step process schematic diagram of step S3 of the detection method for track defects in Embodiment 1 of the present invention.

[0053] Figure 15 Schematic diagram of the defect area obtained after threshold segmentation and morphological processing in Embodiment 1 of the present invention.

[0054] Figure 16 Schematic diagram of the modules of the track defect detection system in Embodiment 2 of the present invention.

[0055] Figure 17 Schematic diagram of the structure of an electronic device for implementing the track defect detection method in Embodiment 3 of the present invention. Detailed implementation manners

[0056] The present invention will be further described below by way of embodiments, but the present invention is not limited to the scope of the described embodiments.

[0057] Embodiment 1

[0058] This embodiment discloses a track defect detection method, which is based on the fusion processing of multiple features of computer vision and can effectively detect the scanned image of the track surface to determine the defect area on the rail surface.

[0059] Specifically, as Figure 1 shown, the track defect detection method includes:

[0060] S1. Perform singular value decomposition, saliency detection, and gradient magnitude calculation on the track image to be processed respectively to obtain corresponding feature images;

[0061] S2. Perform weighted fusion on the multiple feature images to obtain a weighted fusion feature image;

[0062] S3. Determine the defect area in the track image to be processed based on the weighted fusion feature image.

[0063] Generally, the input scanned initial track image I is as Figure 2 shown, which includes many interference factors. If processed directly, the accuracy of the final detection result will be seriously reduced. Therefore, as a preferred implementation manner, as Figure 3 shown, the above method further includes:

[0064] S101. Obtain the initial track image I;

[0065] S102. Perform filtering processing on the initial track image I to obtain the track image I to be processed 0 .

[0066] Preferably, L0 gradient minimization filtering and median filtering are sequentially used for image preprocessing to eliminate background clutter and noise interference, so as to obtain the track image I to be processed as Figure 4 shown0 。

[0067] Specifically, first perform L0 gradient minimization filtering on the directly obtained input scanned image I to obtain the filtered image S, and then perform median filtering on the image S using a w m ×h m window scale to obtain the track image I to be processed 0 , where w m represents the window width of the median filter, and h m represents the window height of the median filter.

[0068] Among them, the calculation method of L0 gradient minimization filtering is: for a certain pixel point p in the image, I p and S p respectively represent the pixel values of the image I and the image S at the point p. The gradient calculates the gray-scale difference between this point and its adjacent pixels in the x-axis and y-axis directions, and defines the gradient measure expression as

[0069]

[0070] Then the objective function expression of L0 gradient minimization filtering is

[0071]

[0072] Among them, represents the partial derivative calculation in the X direction, represents the partial derivative calculation in the Y direction, #{·} represents the number of pixel points that meet the conditions, and λ represents the weight coefficient.

[0073] In this embodiment, the value of the weight coefficient λ is 0.05, and the value of the median filtering window scale is 3×8. It should be noted that the above values are only for illustrative purposes and are not limited thereto. In the specific implementation process, the weight coefficient λ and the median filtering window scale can be arbitrarily valued according to actual needs.

[0074] In this embodiment, the track image I to be processed 0 respectively includes three different track defects a, b, and c. Among them, the direction parallel to the track is taken as the X direction of the track image I to be processed 0 , and the direction perpendicular to the track is taken as the Y direction of the track image I to be processed 0 .

[0075] For step S1, after performing singular value decomposition, saliency detection, and gradient magnitude calculation on the track image I to be processed 0 respectively, a corresponding number of feature images I 1 , I 2 , I3 ……I n 。

[0076] In a preferred embodiment, the above-mentioned several feature images I 1 、I 2 、I 3 ……I n include the singular pixel contrast enhancement feature image I 1 ;

[0077] Step S1, as Figure 5 shown, specifically includes:

[0078] S11. Calculate the difference between the gray values of several target pixel points and reference pixel points in the to-be-processed track image I 0 to obtain the singular pixel contrast enhancement feature image I 1 , where the distance between the reference pixel point and the target pixel point is less than the first threshold.

[0079] Step S11 includes statistically calculating the difference between the gray values of each target pixel point and the reference pixel point in the X direction within its local area to obtain the singular pixel contrast enhancement feature image I 0 of the to-be-processed track image I 1 (as Figure 6 shown). Among them, the local area is determined by the positions of the reference pixel points whose distances from the target pixel point do not exceed the first threshold, and its specific range can be arbitrarily set according to needs.

[0080] Specifically, the calculation method of the singular pixel contrast enhancement feature image I 1 is: Let the coordinates and gray values of the pixel point p in the to-be-processed track image I 0 be (x p , y p ) and then the gray value of the corresponding pixel point p in the singular pixel contrast enhancement feature image I 1 is

[0081]

[0082] where Δ is a positive integer representing the first threshold. In this embodiment, Δ takes the integer value of 0.1 times the X-direction length of the to-be-processed track image I 0 . It should be noted that the value of Δ here is only for illustrative purposes and is not limited thereto. In the specific implementation process, Δ can be arbitrarily taken as a positive integer according to actual needs.

[0083] In a preferred embodiment, the above-mentioned several feature images I 1 、I 2 、I 3……I n including the singular row contrast enhanced feature image I 2 ;

[0084] Step S1, as Figure 7 shown, specifically includes:

[0085] S12. Calculate the difference between the gray values of several target pixel rows and the reference pixel row in the to-be-processed track image I 0 to obtain the singular row contrast enhanced feature image I 2 , where the distance between the reference pixel row and the target pixel row is less than the second threshold.

[0086] Step S12 includes statistically calculating the difference between the gray values of each target pixel row in the X direction and the reference pixel row in the X direction within its local area to obtain the singular pixel row contrast enhanced feature image I 0 of the to-be-processed track image I 2 (as Figure 8 shown). Among them, the local area is determined by the position of the reference pixel row whose distance from the target pixel row does not exceed the second threshold, and its specific range can be set arbitrarily according to needs.

[0087] Specifically, the calculation method of the singular pixel row contrast enhanced feature image I 2 is: Let the feature vector f 0 consist of all the gray values of the target pixel row x in the to-be-processed track image I x ∈R Y , then the gray value of each pixel point corresponding to the target pixel row x in the singular pixel row contrast enhanced feature image I 2 is

[0088]

[0089] where Δ is a positive integer representing the second threshold. In this embodiment, Δ takes the integer value of 0.1 times the length of the to-be-processed track image I 0 in the X direction. It should be noted that the value of Δ here is only for illustrative purposes and is not limited thereto. In the specific implementation process, Δ can be arbitrarily taken as a positive integer according to actual needs.

[0090] In a preferred embodiment, the above-mentioned several feature images I 1 , I 2 , I 3 ……I n include the visual saliency feature image I 3 ;

[0091] Step S1, as Figure 9 shown, specifically includes:

[0092] S131, track image I to be processed 0 Perform Fourier transform and phase spectrum calculation to obtain a visual saliency map;

[0093] S132, smoothing and filtering the visual saliency map to obtain a visual saliency feature image I 3 .

[0094] Figure 10 The above visually significant feature image I is shown 3 , where the visually significant feature image I 3 The specific calculation method is as follows: First, the track image I is processed. 0 Extract Fourier phase spectrum

[0095] P=P{F(I 0 )}

[0096] Where F(·) represents Fourier transform and P(·) represents phase spectrum calculation.

[0097] Then, the inverse Fourier transform is performed according to the phase spectrum P to obtain the visual saliency map

[0098] SF=||F -1 (e i·P )|| 2

[0099] Among them, F -1 (·) represents Fourier transform.

[0100] Finally, Gaussian smoothing filtering is applied to the visual saliency map SF to obtain the visual saliency feature image I 3 .

[0101] In this embodiment, the window size of the Gaussian smoothing filter is the track image to be processed I 0 The Y direction length is 0.2 times the integer value, and the Gaussian kernel σ is 0.25 times the value of the filter window size. It should be noted that the above values ​​are only used for illustration and are not limited thereto. In the specific implementation process, the Gaussian smoothing filter window size and the Gaussian kernel σ can be arbitrarily set according to actual needs.

[0102] In a preferred embodiment, the above-mentioned several characteristic images I 1 ,I 2 ,I 3 ……I n Including the probability distribution image I used to characterize the non-edge area 4 ;

[0103] Step S1, such as Figure 11 As shown, specifically including:

[0104] S141. Calculate the gradient magnitude of each pixel in the to-be-processed orbital image I to obtain a gradient magnitude image; 0 in the middle to obtain a gradient magnitude image;

[0105] S142. Perform smoothing filtering and inversion operations on the gradient magnitude image to obtain a probability distribution image I 4 .

[0106] Figure 12 The above-mentioned probability distribution image I is shown 4 , where the probability distribution image I 4 The specific calculation method is as follows: First, calculate the gradient magnitude of each pixel in the to-be-processed orbital image I 0 in the middle to obtain the gradient magnitude image corresponding to the to-be-processed orbital image I 0 , then perform Gaussian smoothing filtering on the gradient magnitude image, and finally perform an inversion operation to obtain the probability distribution image I representing the non-edge region 4 .

[0107] In this embodiment, the window size of the Gaussian smoothing filter is 5×10, and the Gaussian kernel σ = 3.0. It should be noted that the above values are only for illustrative purposes and are not limited thereto. In the specific implementation process, the window size of the Gaussian smoothing filter and the Gaussian kernel σ can be arbitrarily valued according to actual needs.

[0108] For step S2, for the obtained singular pixel contrast enhancement feature image I 1 , singular row contrast enhancement feature image I 2 , visual saliency feature image I 3 and non-edge probability distribution image I 4 adopt a geometric weighted calculation method to obtain a multi-feature weighted fusion feature image I f , as shown in Figure 13 .

[0109] Specifically, the calculation expression of the multi-feature weighted fusion feature image I f is

[0110]

[0111] where N(·) represents numerical normalization, and α1, α2, α3, and α4 respectively represent the geometric weights corresponding to each feature image.

[0112] In this embodiment, the values of the weights α1, α2, α3, and α4 are 1.1, 1.0, 0.9, and 1.0 respectively. It should be noted that the above values are only for illustrative purposes and are not limited thereto. In the specific implementation process, the geometric weights corresponding to each feature image can be arbitrarily valued according to actual needs.

[0113] For step S3, in a preferred embodiment, as Figure 14 shown, it includes:

[0114] S31. Perform adaptive threshold segmentation on the weighted fusion feature image I f to obtain a binary image;

[0115] S32. Perform mathematical morphological opening operation on the binary image to determine the defect area.

[0116] Specifically, the adaptive threshold expression is

[0117] T(I f ) = mean(I f ) + k·std(I f )

[0118] where mean(·) represents taking the mean of pixel grayscale, std(·) represents taking the standard deviation of pixel grayscale, and k is the standard deviation weight coefficient, usually with a value range of 3.0 to 5.0.

[0119] The image effect after threshold segmentation and morphological processing is as Figure 15 shown, where the white area is the finally determined defect area.

[0120] In this embodiment, the value of k is 4.0, and in the mathematical morphological opening operation after binary segmentation, first, an erosion operation is performed using a 4×4 scale circular template, and then a dilation operation is performed using a 7×7 scale circular template.

[0121] It should be noted that the rail defect detection method provided by the present invention has been verified by experiments and has a high detection accuracy for rail surface defects. In the performance experiment, 195 rail surface scanning image data containing 326 defects of various forms, scales, and appearances were tested. As a result, a total of 338 defects were detected, including 309 real defects and 29 false detections. Therefore, the detection accuracy rate is 91.4%, and the detection recall rate is 94.8%.

[0122] Therefore, the rail defect detection method provided by the present invention realizes an unsupervised machine vision processing method combining visual multi-feature fusion by respectively performing singular value decomposition, saliency detection, and gradient magnitude calculation on the to-be-processed rail image, and weighting and fusing the obtained several feature images. It can efficiently detect rail surface defects, effectively overcome the background clutter interference in the rail image under the load environment, has strong environmental adaptability, stable detection effect, and is applicable to the detection of complex rail defects of various scales and forms; and it does not require collecting samples for training during actual application, has strong applicability and low application cost.

[0123] Example 2

[0124] This embodiment discloses a detection system for track defects. Based on the fusion processing of multiple features of computer vision, it can effectively detect the scanned image of the track surface to determine the defect area on the rail surface.

[0125] Specifically, as Figure 16 shown, the detection system for track defects includes:

[0126] An image processing module 1, which is used to perform singular value decomposition, saliency detection, and gradient magnitude calculation on the track image to be processed respectively, so as to obtain corresponding several feature images;

[0127] A feature fusion module 2, which is used to perform weighted fusion on several feature images to obtain a weighted fusion feature image;

[0128] A defect detection module 3, which is used to determine the defect area in the track image to be processed based on the weighted fusion feature image.

[0129] Generally, the input scanned initial track image I is as Figure 2 shown, which includes many interference factors. If it is directly processed, the accuracy of the final detection result will be seriously reduced. Therefore, as a preferred implementation method, as Figure 3 shown, the above system further includes a preprocessing module 4, which is used for:

[0130] Obtain the initial track image I;

[0131] Perform filtering processing on the initial track image I to obtain the track image I to be processed 0 .

[0132] Preferably, the preprocessing module 4 sequentially uses L0 gradient minimization filtering and median filtering for image preprocessing to eliminate background clutter and noise interference, so as to obtain the track image I to be processed as Figure 4 shown 0 .

[0133] Specifically, the preprocessing module 4 first performs L0 gradient minimization filtering on the directly obtained input scanned image I to obtain the filtered image S, and then performs median filtering on the image S with a m ×h m window scale to obtain the track image I to be processed 0 , where, w m represents the window width of the median filter, and h m represents the window height of the median filter.

[0134] Among them, the calculation method of L0 gradient minimization filtering is as follows: for a certain pixel point p in the image, I p and S p respectively represent the pixel values of the image I and the image S at the point p, and the gradient represents the gray-scale difference between this point and its adjacent pixels in the x-axis and y-axis directions. The gradient measure expression is defined as

[0135]

[0136] Then the objective function expression of L0 gradient minimization filtering is

[0137]

[0138] Among them, represents the partial derivative calculation in the X direction, represents the partial derivative calculation in the Y direction, #{·} represents obtaining the number of pixel points that meet the conditions, and λ represents the weight coefficient.

[0139] In this embodiment, the value of the weight coefficient λ is 0.05, and the value of the median filtering window scale is 3×8. It should be noted that the above values are only for illustrative purposes and are not limited thereto. In the specific implementation process, the weight coefficient λ and the median filtering window scale can be arbitrarily valued according to actual needs.

[0140] In this embodiment, the track image I to be processed 0 respectively includes three different track defects a, b, and c. Among them, the direction parallel to the track is used as the X direction of the track image I to be processed 0 , and the direction perpendicular to the track is used as the Y direction of the track image I to be processed 0 .

[0141] After the image processing module 1 performs singular value decomposition, saliency detection, and gradient magnitude calculation on the track image I to be processed 0 respectively, a corresponding number of feature images I 1 、I 2 、I 3 ……I n can be obtained.

[0142] In a preferred implementation manner, the above-mentioned several feature images I 1 、I 2 、I 3 ……I n include the singular pixel contrast enhancement feature image I 1 ;

[0143] The image processing module 1 is specifically used for:

[0144] Calculate the track image I to be processed0 the differences between the gray values of several target pixel points and reference pixel points in it to obtain a singular pixel contrast enhancement feature image I 1 , where the distance between the reference pixel point and the target pixel point is less than the first threshold value.

[0145] Specifically, statistically calculate the differences between the gray values of each target pixel point and the reference pixel points in the X direction within its local area to obtain the to-be-processed track image I 0 of the singular pixel contrast enhancement feature image I 1 (as shown in Figure 6 ). Among them, the local area is determined by the positions of the reference pixel points whose distances from the target pixel point do not exceed the first threshold value, and its specific range can be arbitrarily set according to needs.

[0146] Specifically, the calculation method of the singular pixel contrast enhancement feature image I 1 is: Let the coordinates and gray value of the pixel point p in the to-be-processed track image I 0 be (x p , y p ) and then the gray value of the corresponding pixel point p in the singular pixel contrast enhancement feature image I 1 is

[0147]

[0148] where Δ is a positive integer representing the first threshold value. In this embodiment, Δ takes the integer value of 0.1 times the length of the to-be-processed track image I 0 in the X direction. It should be noted that the value of Δ here is only for illustrative purposes and is not limited thereto. In the specific implementation process, Δ can be arbitrarily taken as a positive integer according to actual needs.

[0149] In a preferred implementation manner, the above-mentioned several feature images I 1 , I 2 , I 3 ... I n include the singular row contrast enhancement feature image I 2 ;

[0150] The image processing module 1 is specifically used for:

[0151] Calculate the differences between the gray values of several target pixel rows and reference pixel rows in the to-be-processed track image I 0 to obtain the singular row contrast enhancement feature image I 2 , where the distance between the reference pixel row and the target pixel row is less than the second threshold value.

[0152] Specifically, the differences between the gray values of each target pixel row in the X direction and the reference pixel rows in the X direction within their respective local regions are statistically calculated to obtain the track image I to be processed. 0 The singular pixel row contrast enhancement feature image I 2 (as Figure 8 shown). Among them, the local region is determined by the positions of the reference pixel rows whose distances from the target pixel row do not exceed the second threshold, and its specific range can be arbitrarily set according to needs.

[0153] Specifically, the calculation method of the singular pixel row contrast enhancement feature image I 2 is as follows: Let the feature vector f 0 formed by all the gray values of the target pixel row x in the track image I to be processed x ∈R Y , then the gray value of each pixel point corresponding to the target pixel row x in the singular pixel row contrast enhancement feature image I 2 is

[0154]

[0155] where Δ is a positive integer representing the second threshold. In this embodiment, Δ takes the integer value of 0.1 times the length of the track image I to be processed in the X direction. It should be noted that the value of Δ here is only for illustrative purposes and is not limited thereto. In the specific implementation process, Δ can be arbitrarily set as a positive integer according to actual needs. 0 In a preferred implementation manner, the above-mentioned several feature images I

[0156] , I 1 , I 2 , I 3 ……I n include the visual saliency feature image I 3 ;

[0157] The image processing module 1 is specifically used for:

[0158] Performing Fourier transform and phase spectrum calculation on the track image I to be processed 0 to obtain the visual saliency map;

[0159] Performing smoothing filtering on the visual saliency map to obtain the visual saliency feature image I 3 .

[0160] Figure 10 shows the above-mentioned visual saliency feature image I 3 , where the specific calculation method of the visual saliency feature image I 3 is: First, extract the Fourier phase spectrum 0 from the track image I to be processed

[0161] P=P{F(I 0 )}

[0162] Where F(·) represents Fourier transform and P(·) represents phase spectrum calculation.

[0163] Then, the inverse Fourier transform is performed according to the phase spectrum P to obtain the visual saliency map

[0164] SF=||F -1 (e i·P )|| 2

[0165] Among them, F -1 (·) represents Fourier transform.

[0166] Finally, Gaussian smoothing filtering is applied to the visual saliency map SF to obtain the visual saliency feature image I 3 .

[0167] In this embodiment, the window size of the Gaussian smoothing filter is the track image to be processed I 0 The Y direction length is 0.2 times the integer value, and the Gaussian kernel σ is 0.25 times the value of the filter window size. It should be noted that the above values ​​are only used for illustration and are not limited thereto. In the specific implementation process, the Gaussian smoothing filter window size and the Gaussian kernel σ can be arbitrarily set according to actual needs.

[0168] In a preferred embodiment, the above-mentioned several characteristic images I 1 ,I 2 ,I 3 ……I n Including the probability distribution image I used to characterize the non-edge area 4 ;

[0169] The image processing module 1 is specifically used for:

[0170] Calculate the orbit image I to be processed 0 The gradient magnitude of each pixel in the image is calculated to obtain a gradient magnitude image;

[0171] Perform smoothing and inversion operations on the gradient amplitude image to obtain the probability distribution image I 4 .

[0172] Figure 12 The above probability distribution image I is shown 4 , where the probability distribution image I 4 The specific calculation method is as follows: First, calculate the orbit image to be processed I 0 The gradient amplitude of each pixel in the image is used to obtain the track image I to be processed. 0The corresponding gradient magnitude image is then subjected to Gaussian smoothing filtering on the gradient magnitude image, and finally an inversion operation is performed to obtain a probability distribution image I representing the non-edge region 4 .

[0173] In this embodiment, the window size of the Gaussian smoothing filter is 5×10, and the Gaussian kernel σ = 3.0. It should be noted that the above values are only for illustrative purposes and are not limited thereto. In the specific implementation process, the window size of the Gaussian smoothing filter and the Gaussian kernel σ can be arbitrarily valued according to actual needs.

[0174] The feature fusion module 2 performs weighted fusion on the singular pixel contrast enhancement feature image I obtained from the image processing module 1 1 , the singular row contrast enhancement feature image I 2 , the visual saliency feature image I 3 and the non-edge probability distribution image I 4 using a geometric weighted calculation method to obtain a multi-feature weighted fusion feature image I f , as Figure 13 shown.

[0175] Specifically, the calculation expression of the multi-feature weighted fusion feature image I f is

[0176]

[0177] where N(·) represents numerical normalization, and α1, α2, α3, and α4 respectively represent the geometric weights corresponding to each feature image.

[0178] In this embodiment, the values of the weights α1, α2, α3, and α4 are 1.1, 1.0, 0.9, and 1.0 respectively. It should be noted that the above values are only for illustrative purposes and are not limited thereto. In the specific implementation process, the geometric weights corresponding to each feature image can be arbitrarily valued according to actual needs.

[0179] For the defect detection module 3, in a preferred implementation, it is used for:

[0180] Performing adaptive threshold segmentation on the weighted fusion feature image I f to obtain a binary image;

[0181] Performing a mathematical morphological opening operation on the binary image to determine the defect region.

[0182] Specifically, the adaptive threshold expression is

[0183] T(I f ) = mean(I f ) + k·std(If )

[0184] Among them, mean(·) represents taking the mean of the pixel grayscale, std(·) represents taking the standard deviation of the pixel grayscale, and k is the standard deviation weight coefficient, and its value range is usually 3.0 to 5.0.

[0185] The image effect after threshold segmentation and morphological processing is as Figure 15 shown, where the white area is the finally determined defect area.

[0186] In this embodiment, the value of k is 4.0, and in the morphological opening operation after binary segmentation, first, a 4×4 scale circular template is used for erosion operation, and then a 7×7 scale circular template is used for dilation operation.

[0187] It should be noted that the rail defect detection system provided by the present invention has been experimentally verified to have a high detection accuracy for rail surface defects. In the performance experiment, 195 rail surface scan image data containing 326 defects of various forms, scales and appearances were tested. As a result, a total of 338 defects were detected, including 309 real defects and 29 false detections. Therefore, the detection accuracy rate is 91.4%, and the detection recall rate is 94.8%.

[0188] Therefore, the rail defect detection system provided by the present invention performs singular value decomposition, saliency detection and gradient magnitude calculation processing on the to-be-processed rail image through the image processing module respectively, and performs weighted fusion on the obtained several feature images through the feature fusion module, thereby realizing an unsupervised machine vision processing method combining visual multi-feature fusion. It can efficiently detect rail surface defects, effectively overcome the background clutter interference in the rail image under the load environment, has strong environmental adaptability, stable detection effect, and is applicable to the detection of complex rail defects of various scales and forms; and it does not need to collect samples for training during actual application, has strong applicability and low application cost.

[0189] Embodiment 3

[0190] Figure 17 It is a schematic structural diagram of an electronic device provided in Embodiment 3 of the present invention. The electronic device includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, it implements the rail defect detection method provided in Embodiment 1. Figure 17 The displayed electronic device 40 is only an example and should not bring any restrictions to the functions and usage scopes of the embodiments of the present invention.

[0191] Such as Figure 17As shown, the electronic device 40 may be presented in the form of a general-purpose computing device. For example, it may be a server device. The components of the electronic device 40 may include, but are not limited to: at least one of the above-mentioned processors 41, at least one of the above-mentioned memories 42, and a bus 43 that connects different system components (including the memory 42 and the processor 41).

[0192] The bus 43 includes a data bus, an address bus, and a control bus.

[0193] The memory 42 may include volatile memory, such as random access memory (RAM) 421 and / or cache memory 422, and may further include read-only memory (ROM) 423.

[0194] The memory 42 may also include a program / utility 425 having a set (at least one) of program modules 424. Such program modules 424 include, but are not limited to: an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include the implementation of a network environment.

[0195] The processor 41 executes various functional applications and data processing by running computer programs stored in the memory 42, such as the method for detecting track defects provided in Embodiment 1 of the present invention.

[0196] The electronic device 40 may also communicate with one or more external devices 44 (such as a keyboard, a pointing device, etc.). Such communication may be carried out through an input / output (I / O) interface 45. Moreover, the device 40 for generating a model may also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 46. As shown in the figure, the network adapter 46 communicates with other modules of the device 40 for generating a model through the bus 43. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in combination with the device 40 for generating a model, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (disk array) systems, tape drives, and data backup storage systems, etc.

[0197] It should be noted that although several units / modules or sub-units / modules of the electronic device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present invention, the features and functions of two or more of the above-mentioned units / modules may be embodied in one unit / modules. Conversely, the features and functions of one unit / modules described above may be further divided and embodied by multiple units / modules.

[0198] Embodiment 4

[0199] This embodiment provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, it implements the method for detecting track defects provided in Embodiment 1.

[0200] Among them, more specifically, the readable storage medium may include but is not limited to: portable disks, hard disks, random access memories, read-only memories, erasable programmable read-only memories, optical storage devices, magnetic storage devices, or any suitable combination of the above.

[0201] In a possible implementation manner, the present invention can also be implemented in the form of a program product, which includes program code. When the program product runs on a terminal device, the program code is used to cause the terminal device to execute the method for detecting track defects provided in Embodiment 1.

[0202] Among them, the program code for executing the present invention can be written in any combination of one or more programming languages, and the program code can be executed entirely on the user device, partially on the user device, executed as an independent software package, partially on the user device and partially on a remote device, or entirely on a remote device.

[0203] Although the specific implementation manners of the present invention have been described above, those skilled in the art should understand that this is only an example, and the protection scope of the present invention is defined by the appended claims. Without departing from the principles and essence of the present invention, those skilled in the art can make various changes or modifications to these implementation manners, but these changes and modifications all fall within the protection scope of the present invention.

Claims

1. A method for detecting track defects, characterized in that, The detection method for the track defects includes: Performing singular value decomposition, saliency detection, and gradient magnitude calculation on the track image to be processed respectively to obtain corresponding several feature images; Performing weighted fusion on the several feature images to obtain a weighted fusion feature image; Determining the defect area in the track image to be processed based on the weighted fusion feature image; The several feature images include a singular pixel contrast enhancement feature image; The step of the singular value decomposition specifically includes: Calculating the difference between the gray values of several target pixel points and a reference pixel point in the track image to be processed to obtain a singular pixel contrast enhancement feature image, where the distance between the reference pixel point and the target pixel point is less than a first threshold; The several feature images include a singular row contrast enhancement feature image; The step of the singular value decomposition specifically includes: Calculating the difference between the gray values of several target pixel rows and a reference pixel row in the track image to be processed to obtain a singular row contrast enhancement feature image, where the distance between the reference pixel row and the target pixel row is less than a second threshold.

2. The method for detecting rail defects according to claim 1, characterized in that, The several feature images include a visual saliency feature image; The step of the saliency detection specifically includes: Performing Fourier transform and phase spectrum calculation on the track image to be processed to obtain a visual saliency map; Performing smoothing filtering on the visual saliency map to obtain a visual saliency feature image.

3. The detection method of track defects according to claim 1, characterized in that, The several feature images include a probability distribution image for characterizing non-edge regions; The step of the gradient magnitude calculation specifically includes: Calculating the gradient magnitude of each pixel point in the track image to be processed to obtain a gradient magnitude image; Performing smoothing filtering and inversion operations on the gradient magnitude image to obtain the probability distribution image.

4. The method for detecting track defects according to claim 1, characterized in that, The step of determining the defect area in the track image to be processed based on the weighted fusion feature image includes: Performing adaptive threshold segmentation on the weighted fusion feature image to obtain a binary image; Performing mathematical morphological opening operation on the binary image to determine the defect area.

5. The detection method of track defects according to claim 1, characterized in that, The detection method for the track defects further includes: Obtaining an initial track image; Performing filtering processing on the initial track image to obtain the track image to be processed.

6. The detection method of track defects according to claim 5, characterized in that, The filtering process includes gradient minimization filtering and median filtering.

7. A detection system for track defects, characterized in that, The detection system for the track defects includes: An image processing module, configured to perform singular value decomposition, saliency detection, and gradient magnitude calculation on the track image to be processed respectively to obtain corresponding several feature images; A feature fusion module, configured to perform weighted fusion on the several feature images to obtain a weighted fusion feature image; A defect detection module, configured to determine the defect area in the track image to be processed based on the weighted fusion feature image; The image processing module is further configured to calculate the difference between the gray values of several target pixel points and a reference pixel point in the track image to be processed to obtain a singular pixel contrast enhancement feature image, where the distance between the reference pixel point and the target pixel point is less than a first threshold; The image processing module is further configured to calculate the difference between the gray values of a plurality of target pixel rows and a reference pixel row in the to-be-processed track image, so as to obtain a singular row contrast enhancement feature image, wherein the distance between the reference pixel row and the target pixel row is less than a second threshold.

8. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, the method for detecting track defects according to any one of claims 1 to 6 is implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, the method for detecting track defects according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Leather surface salient defect detection method, system and apparatus

    CN107845086A

  • Image fusion method and device based on saliency detection and singular value decomposition

    CN109242812A

  • Edge detection method based on Canny algorithm

    CN111833366A