Pantograph abrasion detection method and device, electronic equipment and storage medium

By performing bilateral filtering of pantograph carbon skateboard images and improving U-Net model processing, combined with Canny model to extract edge curves, the problem of low wear detection accuracy of carbon skateboards under complex background is solved, efficient and accurate wear detection and prompting is achieved, and the safety of train operation is improved.

CN120355681APending Publication Date: 2025-07-22CRRC TANGSHAN CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510440880.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-09
Publication Date
2025-07-22

AI Technical Summary

Technical Problem

The existing pantograph carbon skateboard wear detection methods have reduced accuracy under complex backgrounds, making it difficult to accurately detect the wear of carbon skateboards.

Method used

The initial image is processed using bilateral filtering and denoising technology, combined with the improved U-Net model to extract the masked image, the edge curve is extracted using the improved Canny model, and the wear depth of the edge curve is calculated, and the preset threshold is used to determine whether the carbon skateboard is worn.

Benefits of technology

It improves the accuracy and efficiency of carbon skateboard wear detection, can promptly identify wear abnormalities and output replacement prompts, ensuring the safety and stability of train operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120355681A_ABST
    Figure CN120355681A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a pantograph abrasion detection method and device, electronic equipment and a storage medium, and the method comprises the steps: collecting an initial image of a pantograph carbon slide plate, carrying out the denoising of the initial image through bilateral filtering, and obtaining a denoised initial image; according to an improved neural network U-Net model for biomedical image segmentation, extracting a mask image of the denoised initial image; extracting a foreground image of the initial image based on the mask image; based on an improved Canny model, extracting an edge curve of the carbon slide plate in the foreground image; calculating the abrasion depth of each pixel point in the edge curve; if the abrasion depth of the lowest point in the edge curve is larger than or equal to a preset abrasion threshold value, it is determined that the carbon sliding plate is abraded abnormally, and prompt information that the carbon sliding plate needs to be replaced is output. According to the embodiment of the invention, the wear anomaly detection efficiency and precision of the carbon contact strip are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and particularly to a pantograph wear detection method, device, electronic device and storage medium. Background Art

[0002] The pantograph is a key component for obtaining electric power during the operation of a train, and its performance is directly related to the operation safety and efficiency of the train. As an important part of the pantograph, the carbon slide plate continuously rubs against the catenary, and wear will occur after long-term use, affecting the working state of the pantograph. Therefore, it is necessary to detect the wear condition of the carbon slide plate of the pantograph in a timely and accurate manner, and the wear condition of the carbon slide plate of the pantograph can be realized by detecting the thickness of the carbon slide plate of the pantograph.

[0003] Currently, the relatively common pantograph wear detection method generally is to use image recognition technology to extract the edge contour curve of the carbon slide plate and determine the thickness of the carbon slide plate of the pantograph through the curve. This method can achieve certain results in a simple background, but during the operation of the rail train, the background of the pantograph is complex and changeable, resulting in a decrease in the accuracy of the pantograph carbon slide plate wear detection. Summary of the Invention

[0004] To solve one of the above technical defects, the embodiments of the present application provide a pantograph wear detection method, device, electronic device and storage medium.

[0005] According to the first aspect of the embodiments of the present application, a wear detection method for a carbon slide plate of a pantograph is provided, which is characterized by including:

[0006] Collect an initial image of the carbon slide plate of the pantograph, and perform denoising on the initial image by using bilateral filtering to obtain a denoised initial image;

[0007] Extract a mask image of the denoised initial image according to an improved neural network U-Net model for biomedical image segmentation;

[0008] Extract a foreground image of the initial image based on the mask image of the initial image;

[0009] Extract an edge curve of the carbon slide plate in the foreground image based on an improved Canny edge detection Canny model;

[0010] Calculate the wear depth of each pixel point in the edge curve;

[0011] If the wear depth of the lowest point in the edge curve is greater than or equal to a preset wear threshold, it is determined that the carbon slide plate has abnormal wear.

[0012] Optionally, the improved Canny model includes total variation denoising filtering, a first threshold and a second threshold, and a selection strategy for horizontal edge points; based on the improved Canny model, extracting the edge curve of the carbon skateboard in the foreground image includes:

[0013] Performing total variation denoising filtering on the foreground image to obtain a denoised foreground image;

[0014] Determining a first threshold and a second threshold of the improved Canny model, the first threshold being greater than the second threshold;

[0015] In the denoised foreground image, determining the pixel points with pixel values greater than the first threshold as edge points, the pixel points with pixel values less than the second threshold as non-edge points, and the pixel points with pixel values greater than or equal to the second threshold and less than or equal to the first threshold as edge points;

[0016] Selecting target edge points in the horizontal direction from the determined edge points according to the selection strategy for horizontal edge points;

[0017] Performing curve fitting on the target edge points to obtain the edge curve.

[0018] Optionally, determining the first threshold and the second threshold of the improved Canny model includes:

[0019] Calculating the pixel mean and standard deviation of the denoised foreground image;

[0020] Calculating the product of the standard deviation and the edge point attribute parameter to obtain a first parameter;

[0021] Calculating the product of the first parameter and the standard deviation to obtain a second parameter;

[0022] Determining the sum of the image pixel mean and the second parameter as the first threshold, and determining the difference between the image pixel mean and the second parameter as the second threshold.

[0023] Optionally, selecting target edge points in the horizontal direction from the determined edge points according to the selection strategy for horizontal edge points includes:

[0024] Obtaining the standard deviation of the denoised foreground image;

[0025] Traversing each edge point, if the abscissa of the edge point is greater than or equal to the product of the standard deviation and the ordinate, then determining the edge point as a target edge point, and if the abscissa of the edge point is less than the product of the standard deviation and the ordinate, then rejecting the edge point.

[0026] Optionally, extracting the foreground image of the initial image from the mask image based on the initial image includes:

[0027] Performing a bitwise AND operation on the denoised initial image and the mask image to obtain the foreground image of the initial image.

[0028] Optionally, extracting the mask image of the initial image according to the trained improved U-Net model includes:

[0029] Determining the trained improved U-Net model, where the improved U-Net model includes: a six-level encoder, a five-level decoder, and an attention module. The six-level encoder is connected in series and downsampled level by level, the five-level decoder is connected in series and upsampled level by level, and each level of the encoder is associated with the corresponding level of the decoder;

[0030] Inputting the initial image into the first-level encoder of the six-level encoder, performing downsampling level by level through each level of the encoder of the six-level encoder and using a spatial attention module for feature enhancement to obtain the output features and optimized features of each level of the encoder. The output features and optimized features of each level of the encoder are the input features of the next-level encoder;

[0031] Inputting the output features of the fifth-level encoder and the output features of the sixth-level encoder into the fifth-level decoder, and performing upsampling level by level through each level of the decoder of the five-level decoder to obtain the output features of each level of the decoder. The output features of each level of the decoder and the output features of the same-level encoder are the input features of the next-level decoder;

[0032] Performing feature segmentation on the target feature map output by the first-level decoder to obtain the mask image of the initial image.

[0033] Optionally, it further includes:

[0034] Calibrating the camera that collects the initial image based on the black and white checkerboard calibration method to obtain the proportional relationship between the actual distance and 1 pixel of the unit pixel;

[0035] Based on the highest point of the edge curve, establishing a pixel coordinate map and determining the pixel coordinates of each pixel point of the edge curve in the pixel coordinate map. The ordinate of each pixel point in the pixel coordinate map is the wear pixel value of each pixel point;

[0036] Based on the proportional relationship, calculating the wear depth of the wear pixel value of each pixel point in reality.

[0037] According to the second aspect of the embodiments of the present application, a wear detection device for a pantograph carbon slide is provided, including:

[0038] An image acquisition unit for acquiring an initial image of a pantograph carbon slide plate, and performing denoising on the initial image using bilateral filtering to obtain a denoised image;

[0039] A first extraction unit for extracting a mask image of the denoised image according to an improved U-Net model.

[0040] A second extraction unit for extracting a foreground image of the initial image based on the mask image of the initial image;

[0041] A third extraction unit for extracting an edge curve of the carbon slide plate in the foreground image based on an improved Canny model.

[0042] A wear calculation unit for calculating the wear depth of each pixel point in the edge curve.

[0043] An abnormality determination unit for determining that the carbon slide plate has abnormal wear if the wear depth of the lowest point in the edge curve is greater than or equal to a preset wear threshold.

[0044] According to a third aspect of the embodiments of the present application, there is provided an electronic device, including:

[0045] A memory; a processor; and a computer program; wherein, the computer program is stored in the memory and is configured to be executed by the processor to implement any one of the above methods.

[0046] According to a third aspect of the embodiments of the present application, there is provided a computer-readable storage medium, on which a computer program is stored; the computer program is executed by a processor to implement the method as described in any one of the above.

[0047] By using the pantograph wear detection method, device, electronic device and storage medium provided in the embodiments of the present application, after acquiring an initial image of a pantograph carbon slide plate, bilateral filtering is used to perform denoising on the initial image to obtain a denoised initial image, making the edges of the denoised initial image clearer. Therefore, using an improved U-Net model to extract the mask image of the denoised initial image can ensure that the partition between the background part and the carbon slide plate part in the mask image is more obvious. Using a mask image with a clearer partition to extract the foreground image in the initial image can effectively obtain the area where the pantograph carbon slide plate is located in the initial image. Thus, the edge curve in the foreground image is extracted to achieve accurate detection of the edge curve, and the wear depth of each pixel point on the edge curve is calculated. After that, if the wear depth of the lowest point is greater than or equal to the wear threshold, it is determined that there is abnormal wear, and a replacement prompt can be given, effectively improving the wear detection efficiency and accuracy. Description of the Drawings

[0048] The accompanying drawings described herein are used to provide a further understanding of the present application and form a part of the present application. The schematic embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation of the present application. In the drawings:

[0049] Figure 1 It is an example diagram of the wear detection system for the pantograph carbon slide provided by the embodiment of the present application;

[0050] Figure 2 It is a flowchart of a wear detection method for a pantograph carbon slide provided by the embodiment of the present application;

[0051] Figure 3 It is a flowchart of another wear detection method for a pantograph carbon slide provided by the embodiment of the present application;

[0052] Figure 4 It is an example diagram of an image conversion provided by the embodiment of the present application;

[0053] Figure 5 It is a structural example diagram of an improved U-Net model provided by the embodiment of the present application;

[0054] Figure 6 It is a structural example diagram of an attention module provided by the embodiment of the present application;

[0055] Figure 7 It is an example diagram of a pixel coordinate map provided by the embodiment of the present application;

[0056] Figure 8 It is a structural schematic diagram of a wear detection device for a pantograph carbon slide provided by the embodiment of the present application;

[0057] Figure 9 It is a structural schematic diagram of an electronic device provided by the embodiment of the present application. Detailed implementation manners

[0058] In order to make the technical solutions and advantages in the embodiments of the present application clearer and more understandable, the following further details the exemplary embodiments of the present application with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than an exhaustive list of all embodiments. It should be noted that, without conflict, the embodiments in the present application and the features in the embodiments can be combined with each other.

[0059] In view of the above problems, in the embodiments of the present application, a pantograph wear detection method, device, electronic device, and storage medium are provided. After collecting the initial image of the pantograph carbon slide plate, bilateral filtering is used to denoise the initial image, and the denoised initial image is obtained, making the edges of the denoised initial image clearer. Therefore, using an improved U-Net (Convolutional Networks for Biomedical Image Segmentation, a neural network for biomedical image segmentation) model to extract the mask image corresponding to the denoised initial image can ensure that the partition between the background part and the carbon slide plate part in the mask image is more obvious. Using the mask image with a clearer partition to extract the foreground image in the initial image can effectively obtain the area where the pantograph carbon slide plate is located in the initial image. Then, the edge curve in the foreground image is extracted to achieve accurate detection of the edge curve, and the wear depth of each pixel point on the edge curve is calculated. After that, if the wear depth at the lowest point is greater than or equal to the wear threshold, it is determined that wear abnormality occurs, and a replacement prompt can be given, effectively improving the wear detection efficiency and accuracy.

[0060] As Figure 1 shown, it is an example diagram of a pantograph carbon slide plate wear detection system provided by the present application. The system may include: a pantograph 10, a carbon slide plate 20 disposed on the pantograph 10, a camera 30, a server 40, and a display 50.

[0061] Among them, the pantograph 10 may be disposed on the top of a certain train, and the camera 30 may also be disposed on the top of the train and the acquisition direction is directly opposite to the carbon slide plate 20 on the pantograph 10 to perform image acquisition on the carbon slide plate 20 on the pantograph 10 to obtain an initial image. The acquired initial image is sent to the server 40. The server 40 can execute the pantograph carbon slide plate wear detection method to achieve high-precision wear detection, give a replacement prompt for the carbon slide plate in a timely manner, and improve the running safety and stability of the train.

[0062] As Figure 2 shown, it is a flowchart of a pantograph carbon slide plate wear detection method provided by an embodiment of the present application. The wear detection method can be configured as a wear detection device. The wear detection device can be located in an electronic device. The wear detection method may include the following steps:

[0063] S201. Collect the initial image of the pantograph carbon slide plate, and use bilateral filtering to denoise the initial image to obtain the denoised initial image.

[0064] Optionally, the pantograph is located on the roof of the train, and the carbon sliding plate is in contact with the power supply line at the top of the pantograph. An industrial camera is also installed on the roof of the train. The imaging direction of the industrial camera is directly facing the pantograph to collect images of the pantograph during operation. Since the carbon sliding plate is located on the pantograph, the initial image of the carbon sliding plate is thus collected. It can be understood that the initial image of the pantograph carbon sliding plate can be collected by using the industrial camera on the roof of the train during the operation of the train, or at any time in real time.

[0065] Optionally, bilateral filtering processing is used to denoise the initial image, which can remove the interference of noise. Bilateral filtering can effectively remove noise and retain edge details, thereby improving the processing accuracy of the pantograph carbon sliding plate image. The value J(p) of the pixel p after bilateral filtering can be expressed as:

[0066]

[0067] where I is the input image, I(p) represents the gray value of pixel p, and I(q) represents the gray value of pixel q.

[0068] N(p) represents the neighborhood of pixel p; f r is a Gaussian kernel function based on pixel value differences, defined as:

[0069]

[0070] f s is a Gaussian kernel function based on spatial distance, defined as:

[0071]

[0072] W p is a normalization coefficient to ensure that the weight sum is 1, defined as:

[0073] W p = ∑ q∈N(p) f r (|I(p) - I(q)|)·f s (||p - q||)

[0074] The initial image is processed by bilateral filtering to obtain a denoised initial image. While removing the noise of the initial image, bilateral filtering can retain the edge information of the image to the greatest extent.

[0075] S202. Extract the mask image of the denoised initial image according to the improved U-Net model.

[0076] Optionally, an improved U-Net model can be trained. For example, the U-Net model to be trained can be constructed first; then, the U-Net model can be trained with multiple training samples, and the improved U-Net model can be obtained at the end of the training.

[0077] It can be understood that the training samples can include the original image and the label of the original image, and the label can be the mask image or binary image corresponding to the original image. The original image can be obtained by image acquisition of one or more pantograph carbon slides, and the mask image or binary image of the original image can be pre-labeled.

[0078] During the training process, the resolution of the input image of the model can be set. For example, the resolution can be set to 500*416, the number of channels can be set to 3, the training batch can be set to 16, the initial learning rate can be set to 0.001, and the StepLR function provided by PyTorch can be used to automatically adjust the learning rate of the model. The Adam optimizer is used to train the model 150 times, and the weighted cross-entropy function is used as the loss function. After the training is completed, the weight parameters of the model are saved. By calling the trained weight parameters and substituting them into the U-Net model, the improved U-Net model can be obtained.

[0079] The improved U-Net model obtained by training can learn the complex feature differences between the foreground (carbon slide area) and the background in the initial image, and then accurately outline the mask image corresponding to the foreground. The denoised initial image and the mask image are subjected to bitwise AND calculation, and the pixel points at the corresponding positions in the white area (representing the foreground, with a value of 255) in the mask image are retained, and the pixel points corresponding to the black area (representing the background, with a value of 0) are set to 0, so as to accurately separate the foreground image.

[0080] S203. Extract the foreground image of the initial image based on the mask image.

[0081] Optionally, the mask image of the initial image can be the binary image of the initial image. In this mask image, the pixel points in the area where the carbon slide is located have a value of 255, and the pixel points of the non-carbon slide, also known as the background points, have a value of 0.

[0082] Optionally, S202 can include: multiplying each pixel point in the mask image by the pixel point at the same position in the initial image to obtain the pixel value of each pixel point.

[0083] For example, assume that the pixel value of the pixel point (12, 15) in the initial image is 12, the value of the mask image at this pixel point is 0, and the pixel value of the foreground image at this pixel coordinate is 12 * 0 = 0. Assume that the pixel value of the pixel point (34, 80) in the initial image is 160, and the value of the mask image at this pixel point is 255, then the pixel value of the foreground image at this pixel coordinate is 160.

[0084] S204. Based on the improved Canny model, extract the edge curve of the carbon skateboard in the foreground image.

[0085] Optionally, the improved Canny (Canny Edge Detection) model refers to the model after improving the Canny model. For example, the improved Canny model includes at least one of the following improvement methods: for the input image (such as the input foreground image), add image denoising (such as using total variation to denoise the foreground image), add a dual-threshold edge point judgment strategy (such as determining the pixel points with pixel values greater than the first threshold in the denoised foreground image as edge points and the pixel points with pixel values less than the second threshold as non-edge points, and the pixel points with pixel values greater than or equal to the second threshold and less than or equal to the first threshold as edge points), or add a direction constraint for edge point selection (such as the selection strategy for horizontal edge points), etc.

[0086] Optionally, S204 may include: based on the improved Canny model, extract the overall curve of the carbon skateboard in the foreground image, and intercept the upper curve from the overall curve as the edge curve.

[0087] It can be understood that the curve of the carbon skateboard in the foreground image is similar to a rectangle, and the contact surface between the carbon skateboard and the catenary is the top plane of the carbon skateboard. Therefore, the upper edge curve of the rectangle in the foreground image is the edge curve of the carbon skateboard. The upper edge curve may refer to the curve corresponding to the side where the carbon skateboard contacts the catenary.

[0088] S205. Calculate the wear depth of each pixel point in the edge curve.

[0089] S206. If the wear depth of the lowest point in the edge curve is greater than or equal to the preset wear threshold, it is determined that the carbon skateboard has abnormal wear.

[0090] Optionally, the wear depth of the lowest point in the edge curve may refer to the actual difference between the lowest point and the highest point in the edge curve. S206 may include: calculating the pixel difference between the lowest point and the highest point in the edge curve in the Y-axis direction, and converting the pixel difference into the actual wear depth based on the proportional relationship between the actual distance in the camera and 1 pixel of the unit pixel. The lowest point may refer to the pixel point with the smallest coordinate value in the Y-axis in the edge curve.

[0091] The wear threshold can be obtained by setting. For example, the wear threshold can be set to 5 millimeters according to the usage experience of the carbon skateboard. If the wear depth at the lowest point of the carbon skateboard exceeds 5 milliseconds, wear abnormality occurs.

[0092] During the use of the carbon skateboard, wear will occur. The more severe the wear, the greater the wear depth. When the wear depth exceeds the wear threshold, it indicates that the wear of the carbon skateboard is relatively severe and affects the use. Then it is determined that the carbon skateboard has abnormal wear. Preferably, when it is determined that the carbon skateboard has abnormal wear, a prompt message indicating that the carbon skateboard has abnormal wear or the carbon skateboard needs to be replaced is output.

[0093] In the embodiment of the present application, preferably during the operation of the train, the initial image of the pantograph carbon skateboard is collected, and bilateral filtering is used to denoise the initial image to obtain the denoised initial image, making the edges of the denoised initial image clearer. Therefore, using the improved U-Net model to extract the mask image of the denoised initial image can ensure that the partition between the background part and the carbon skateboard part in the mask image is more obvious. The foreground image is extracted using the mask image, and the mask image plays a screening role, accurately removing the background information and only retaining the foreground part where the carbon skateboard is located. Then, using the improved Canny model, the edge curve of the carbon skateboard in the foreground image is extracted, which can more accurately outline the edge curve of the carbon skateboard and efficiently identify its contour boundary. Thus, by comparing the wear depth at the lowest point of the edge curve with the preset threshold, the quantitative monitoring of the wear degree of the carbon skateboard is realized. Digitalizing the wear situation, no longer relying on manual subjective judgment, as long as the wear depth at the lowest point breaks through the set limit, the system can immediately determine that the carbon skateboard has abnormal wear, and then output a replacement prompt, ensuring the stability of the train power supply system and preventing power receiving failures caused by excessive wear of the carbon skateboard, greatly enhancing the safety and reliability of train operation. In addition, throughout the process from image acquisition, processing to the final wear determination and prompt output, there is no need for manual intervention to perform complex visual inspections and wear evaluations, which can meet the requirements of quickly and batch detecting the status of carbon skateboards under the high-frequency operation of trains, conform to the modern intelligent operation and maintenance system, reduce labor costs and operation and maintenance time costs, and improve processing efficiency.

[0094] Further, on the basis of any of the above embodiments, the improved Canny model includes total variation denoising filtering, a first threshold and a second threshold, and a selection strategy for horizontal edge points. As Figure 3 shown, it is a flowchart of another method for detecting the wear of the pantograph carbon skateboard provided by the embodiment of the present application. Different from the foregoing embodiments, based on the improved Canny model, extracting the edge curve of the carbon skateboard in the foreground image may include the following steps:

[0095] S301. Denoise the foreground image using total variation denoising filtering to obtain the denoised foreground image.

[0096] Optionally, the specific formula of the total variation denoising filter algorithm is as follows:

[0097]

[0098] where is the data fidelity term, ensuring that the denoised image u is as close as possible to the original image f;

[0099] λ is the regularization parameter, used to balance the weights of the data fidelity term and the total variation term;

[0100] TV(u) is the total variation of the image u, defined as:

[0101]

[0102] δ x u i,j and δ y u i,j respectively represent the horizontal and vertical gradients of the image u at the (i,j) position. δ x is the horizontal gradient influence parameter, and δ y is the vertical gradient influence parameter.

[0103] Optionally, S301 may include: inputting the foreground image into the formula of the total variation denoising filter for calculation to obtain the denoised foreground image.

[0104] S302. Determine the first threshold and the second threshold of the improved Canny model, where the first threshold is greater than the second threshold.

[0105] Optionally, both the first threshold and the second threshold can be involved in edge point selection. Edge points and non-edge points can be determined from the denoised foreground image according to the first threshold and the second threshold.

[0106] S303. Determine the pixel points with pixel values greater than the first threshold in the denoised foreground image as edge points, the pixel points with pixel values less than the second threshold as non-edge points, and the pixel points with pixel values greater than or equal to the second threshold and less than or equal to the first threshold as edge points.

[0107] Optionally, in S303, for the denoised foreground image, the edge tracing algorithm can be used to determine the tracing starting point (i.e., the first foreground pixel point) from left to right, and the 360-degree search method can be used to trace the wear edge curve.

[0108] It can be understood that traversal can start from the first pixel point of the foreground image. If the pixel value of the pixel point is 0, continue to traverse the next pixel point. If the pixel value of this pixel point is 255, start edge point tracing.

[0109] Among them, the 360-degree search method for tracing the worn edge curve may mean that starting from the first pixel point, with the pixel point as the center, it is detected whether the pixel points above, below, to the left, and to the right of the pixel point are edge pixel points. If so, the edge point is retained; if not, the pixel point is deleted.

[0110] S304. According to the selection strategy of horizontal edge points, select the target edge points in the horizontal direction from the determined edge points.

[0111] Optionally, the selection strategy of horizontal edge points may mean selecting the target edge points from the horizontal direction, that is, the X-axis direction of the pixel coordinate axis. The carbon slide plate is a device horizontally arranged on the pantograph and is horizontal. Therefore, selecting edge points from the horizontal direction can achieve accurate selection of edge points.

[0112] S305. Perform curve fitting on the target edge points to obtain an edge curve.

[0113] Figure 4 An example diagram of image conversion provided by an embodiment of the present application is shown in Figure 4 Picture 401 in it, which is a mask image of the initial image. The mask image is a binary image with only two colors, black and white. The white part represents the carbon slide plate, and the black part represents the background.

[0114] Optionally, a curve fitting algorithm can be used to perform curve fitting on the target edge points to obtain an edge curve. The curve fitting algorithm can be, for example, the least squares fitting, polynomial fitting and other algorithms, and this embodiment does not limit this too much.

[0115] In the embodiment of the present application, total variation denoising filtering is used to denoise the foreground image, which can better retain the edge and detail information of the image. With the improved Canny model, such as the Canny model with double thresholds, that is, the first threshold and the second threshold, directional selection of edge points can be realized, and the real edge points of the pantograph can be accurately identified in a complex environment. The double-threshold method effectively balances the noise resistance and the integrity of edge capture, avoids missing real edge points, and improves the acquisition efficiency and accuracy of edge points. The selection strategy of horizontal edge points specifically selects the target edge points in the horizontal direction from the determined edge points, realizes edge point detection according to the wear direction of the carbon slide plate, and can accurately extract the target edge points of the carbon slide plate. Thus, the edge curve obtained by performing curve fitting on the target edge points is closer to the real wear condition of the carbon slide plate, and more accurate loss anomaly detection can be performed through this edge curve, improving the loss anomaly detection efficiency and accuracy.

[0116] Further, on the basis of any of the above embodiments, determining the first threshold and the second threshold of the improved Canny model includes:

[0117] Calculate the pixel mean and standard deviation of the foreground image after denoising;

[0118] Calculate the product of the standard deviation and the edge point attribute parameter to obtain the first parameter;

[0119] Calculate the product of the first parameter and the standard deviation to obtain the second parameter;

[0120] Determine the first threshold as the sum of the image pixel mean and the second parameter, and determine the second threshold as the difference between the image pixel mean and the second parameter.

[0121] Optionally, if the pixel value matrix of the foreground image is I, its mean is u, and the standard deviation is σ, then the first threshold T hign and the second threshold T low can be expressed by the following formulas respectively:

[0122] T hign = u + k·σ

[0123] T low = u - k·σ

[0124] where: u is the mean of the image and can be calculated using the formula k is an adjustable constant that controls the flexibility of the threshold. Usually, k takes values between 0.5 and 1.5.

[0125] M and N are the number of rows and columns of the image respectively; σ is the standard deviation of the image and can be calculated using the following formula:

[0126]

[0127] In the embodiments of the present application, the double threshold of the Canny model is accurately determined by using the double threshold algorithm based on statistical characteristics to enhance the robustness of edge detection.

[0128] Further, on the basis of any of the above embodiments, according to the selection strategy of horizontal edge points, select the target edge points in the horizontal direction from the determined edge points, including:

[0129] Obtain the standard deviation of the foreground image after denoising;

[0130] Traverse each edge point. If the abscissa of the edge point is greater than or equal to the product of the standard deviation and the ordinate, determine the edge point as the target edge point. If the abscissa of the edge point is less than the product of the standard deviation and the ordinate, eliminate the edge point.

[0131] Optionally, the specific formula of the edge detection selection strategy is as follows:

[0132]

[0133] Where: (x, y) represents the edge point to be screened. When F(x, y) = 1, it means that the edge point is retained. When F(x, y) = 0, it means that the edge point is removed. The parameter σ controls the characteristics of the edge point.

[0134] In the embodiment of the present application, an edge selection algorithm is used to directionally select edges in the horizontal direction and eliminate edges in other directions to ensure the directionality and accuracy of edge detection.

[0135] Further, based on any of the above embodiments, extracting a foreground image of the initial image based on the mask image includes:

[0136] The denoised initial image and the mask image are bitwise ANDed to obtain the foreground image of the initial image.

[0137] Optionally, when the denoised initial image I and the mask image M are subjected to a bitwise AND operation, the calculation formula may be as follows:

[0138] J(x,y)=I(x,y)·M(x,y)

[0139] Among them, I(x,y) represents the pixel value of the original pantograph carbon slide image at position (x,y); M(x,y) represents the pixel value of the pantograph carbon slide binary mask image at position (x,y); J(x,y) represents the pixel value of the image obtained after applying the mask operation at position (x,y).

[0140] In the embodiment of the present application, a bitwise AND calculation method is adopted to obtain the foreground image of the initial image through the mask image calculation. The entire operation process does not require much calculation, but can lock the foreground image of the pantograph carbon slide plate extremely accurately and quickly, effectively dealing with the interference problem of complex background.

[0141] Further, based on any of the above embodiments, according to the improved U-Net model, extracting a mask image of the initial image includes:

[0142] Determine an improved U-Net model obtained through training, the improved U-Net model comprising: a six-level encoder, a five-level decoder and an attention module, the six-level encoder is connected in series and downsampled level by level, the five-level decoder is connected in series and upsampled level by level, and each level of encoder is associated with a decoder of a corresponding level.

[0143] The initial image is input into the first-stage encoder of the six-stage encoder, and is downsampled step by step through the encoders of each stage of the six-stage encoder and feature enhanced using the spatial attention module to obtain the output features and optimized features of each stage of the encoder. The output features and optimized features of each stage of the encoder serve as the input features of the next stage of the encoder.

[0144] Input the output features of the fifth - level encoder and the output features of the sixth - level encoder into the fifth - level decoder. Through the upsampling of each decoder in the five - level decoder level by level, obtain the output features of each decoder. The output features of each decoder and the output features of the same - level encoder are the input features of the next - level decoder.

[0145] Perform feature segmentation on the target feature map output by the first - level decoder to obtain the mask image of the initial image.

[0146] The six - level encoder of the improved U - Net model is connected in series in the order of each encoder level, and the five - level decoder is connected in series in the reverse order of each decoder level. Connecting the six - level encoder in series in order can mean that the first - level encoder is connected to the second - level encoder, the second - level encoder is connected to the third - level encoder, the third - level encoder is connected to the fourth - level encoder, and the fourth - level encoder is connected to the fifth - level encoder. Connecting the five - level decoder in series in reverse order can mean that the fifth - level decoder is connected to the fourth - level decoder, the fourth - level decoder is connected to the third - level decoder, the third - level decoder is connected to the second - level decoder, and the second - level decoder is connected to the first - level decoder.

[0147] In the embodiments of the present application, the six - level encoder is connected in series for step - by - step downsampling, that is, multi - level downsampling is adopted to capture the features of different scales of the initial image, and more abstract and semantically rich deep features can be obtained, which helps to understand the overall layout of the image. Then, each level of the encoder uses a spatial attention module for feature enhancement. Spatial attention can autonomously discover the parts of the image that are important for the segmentation task, weaken the interference of irrelevant backgrounds, improve the feature quality, and make the subsequent segmentation more targeted. Then, the five - level decoder is connected in series for step - by - step upsampling, realizing multi - level upsampling, and gradually restoring the deep abstract features to the resolution size of the original image, so that the finally output feature map can contain both high - level semantics and low - level details such as texture and shape. Thus, perform feature segmentation on the target feature map output by the first - level decoder to obtain a mask image that accurately outlines the contour of the carbon sliding plate.

[0148] The following will be combined with Figures 5 - 6 to elaborate on the improved U - Net model in detail.

[0149] Figure 5 It is a structural schematic diagram of an improved U - Net model provided by the embodiments of the present application. It can include: a six - level encoder, a five - level decoder, and an attention module, and its appearance is similar to the U - shaped network structure.

[0150] As Figure 5As shown, the six - level encoder can include a first - level encoder, a second - level encoder, a third - level encoder, a fourth - level encoder, a fifth - level encoder, and a sixth - level encoder. Attention modules are respectively associated after the first - level encoder to the fifth - level encoder. Different - depth features output by each encoder (such as the first - level encoder to the fifth - level encoder) can be subjected to skip connections to obtain a feature connection result, and the feature connection results of each encoder are input into the decoders of the corresponding levels. Skip connections can directly transfer shallow - layer feature information to deep layers, which helps to solve the problem of gradient disappearance during the training of deep networks. At the same time, it can better retain the detailed information of the image, improving the performance and training effect of the network.

[0151] For example, the feature connection result output by the first - level encoder is input into the first - level decoder, the feature connection result output by the second - level encoder is input into the second - level decoder, the feature connection result output by the third - level encoder is input into the third - level decoder, the feature connection result output by the fourth - level encoder is input into the fourth - level decoder, and the feature connection result output by the fifth - level encoder is input into the fifth - level decoder.

[0152] For example, the five - level decoder can include: a first - level decoder, a second - level decoder, a third - level decoder, a fourth - level decoder, and a fifth - level decoder. Among them, the first - level encoder is associated with the first - level decoder, the second - level encoder is associated with the second - level decoder, the third - level encoder is associated with the third - level decoder, the fourth - level encoder is associated with the fourth - level decoder, and the fifth - level encoder is associated with the fifth - level decoder.

[0153] Optionally, each encoder can include an EfficientNet (Rethinking Model Scaling for Convolutional Neural Networks) network module. Through its unique down - sampling mechanism, EfficientNet can effectively capture all the detailed information of the pantograph image by jointly scaling the depth, width, and resolution of the network. At the same time, EfficientNet significantly reduces the number of parameters and the amount of computation, thus achieving higher computational efficiency.

[0154] For example, the functions of each level of encoder are as follows:

[0155] The first - level encoder: filled with the initial block of EfficientNet, and the size of the feature map is halved.

[0156] The second - level encoder: further down - sampled by EfficientNet.

[0157] The third - level encoder: continue down - sampling to increase the receptive field.

[0158] Fourth - level encoder: Filled with EfficientNet blocks to obtain higher - level spatial information.

[0159] Fifth - level encoder: Uses an improved EfficientNet block to maintain the resolution of the feature map.

[0160] Sixth - level encoder: Continues to use the improved EfficientNet block to finally capture global features.

[0161] For example, the functions of each level of decoder are as follows:

[0162] Fifth - level decoder: Restores the feature map through upsampling and convolution operations, and adds a channel attention mechanism. This stage is mainly used to enhance global features.

[0163] Fourth - level decoder: Continues upsampling, fuses features with higher resolution, and adds a channel attention mechanism. This stage balances global information and local details.

[0164] Third - level decoder: Through upsampling operations, combines skip - connection feature maps, and adds a channel attention mechanism. This stage further refines feature selection.

[0165] Second - level decoder: Continues upsampling, restores a larger resolution, and adds a channel attention mechanism. This stage is mainly used to enhance edge and detail features.

[0166] First - level decoder: Finally, upsamples to the resolution of the input image and adds a channel attention mechanism. This stage ensures accurate segmentation at high resolution.

[0167] Optionally, for the encoder, an attention module can be added. As Figure 6 shown, it is a structural example diagram of an attention module provided by an embodiment of this application. For the feature map input to the attention module, that is, the input feature (InputFeature), a channel attention module (Channel Attention Module) can be used for feature extraction. The obtained feature is weighted and summed with the input feature to obtain a first feature map. The first feature map is input to a spatial attention module (SpatialAttention Module) for feature extraction to obtain a second feature map. Then, the first feature map and the second feature map are weighted to obtain the optimized feature output by the encoder.

[0168] Further, for the channel attention module, global average pooling and global max pooling are used to obtain the global information of each channel, and then a fully connected layer and an activation function are used to generate the importance weights of each channel. These weights are multiplied element-wise with the original feature map by channel to obtain a weighted feature map. The activation function can be, for example, ReLU (Rectified Linear Unit) or Sigmoid.

[0169] Further, for the spatial attention module, the feature map output by the channel attention module is subjected to max pooling and average pooling, compressed along the channel dimension, and two two-dimensional feature maps are generated. These two feature maps are concatenated, and a convolutional layer and a Sigmoid activation function are used to generate spatial attention weights.

[0170] After that, the spatial attention weights are multiplied element-wise with the feature map output by the channel attention module in the spatial dimension to obtain the final optimized feature. This optimized feature is the final feature map weighted by the channel attention module and the spatial attention module, which contains enhanced important features and suppresses unimportant features, thereby effectively enhancing feature expression at different resolutions.

[0171] Further, based on any of the above embodiments, calculating the wear depth of each pixel point in the edge curve includes:

[0172] Based on the black and white checkerboard calibration method, the camera for collecting the initial image is calibrated to obtain the proportional relationship between the actual distance and 1 pixel.

[0173] Based on the highest point of the edge curve, a pixel coordinate map is established, and the pixel coordinates of each pixel point on the edge curve in the pixel coordinate map are determined. The ordinate of each pixel point in the pixel coordinate map is the wear pixel value of each pixel point.

[0174] Based on the proportional relationship, the wear depth of each pixel point's wear pixel value in reality is calculated.

[0175] Optionally, the black and white checkerboard calibration algorithm can be a known algorithm, and this embodiment does not limit it too much. Based on the highest point of the edge curve, establishing a pixel coordinate map and determining the pixel coordinates of each pixel point on the edge curve in the pixel coordinate map may include: constructing a two-dimensional coordinate system including the X-axis and the Y-axis, where the X-axis represents the pixel abscissa and the Y-axis represents the difference in the ordinate between the pixel point and the highest point; mapping each pixel point on the edge curve from the original image coordinate system of the foreground image to this two-dimensional coordinate system to obtain the pixel coordinate map. For ease of understanding, the Y-axis direction is downward and the X-axis direction is to the right.

[0176] Specifically, the mapping steps of each pixel point on the edge curve include:

[0177] A1. Map the ordinate of the highest point of the edge curve to the starting point of the Y-axis of the two-dimensional coordinate system, and keep the abscissa of the highest point unchanged and map it to the X-axis of the two-dimensional coordinate system. Among them, after mapping the ordinate of the highest point of the edge curve to the starting point of the Y-axis of the two-dimensional coordinate system, the Y-axis coordinate of the highest pixel point is 0 pixel. For example, if the coordinate point of the highest point of the edge curve in the foreground image is (920, 100), the ordinate of this highest point is mapped from 100 to the starting point 0 of the Y-axis of the two-dimensional coordinate system, and the abscissa of the highest point remains unchanged, then the coordinate point of the highest point after mapping to the two-dimensional coordinate system is (920, 0). The highest point of the edge curve refers to the pixel point with the largest ordinate value in the image coordinate system of the original foreground image.

[0178] A2. Map the difference between the ordinate of the highest point and the ordinate of each pixel point on the edge curve to the Y-axis to obtain the ordinate of each pixel point in the pixel coordinate map, and keep the abscissa of each pixel point unchanged and map it to the X-axis of the two-dimensional coordinate system. For example, if the coordinate point of a certain pixel point in the foreground image is (100, 80), and the difference between the ordinate 100 of the highest point and the ordinate 80 of this pixel point is 20, then the coordinate point of this pixel point after mapping to the two-dimensional coordinate system is (100, 20).

[0179] A3. Plot each pixel point (including the highest point) into the two-dimensional coordinate system according to its coordinate point in the two-dimensional coordinate system to obtain the pixel coordinate map. The ordinate of each pixel point on the Y-axis of the pixel coordinate map is the wear pixel value of each pixel point. For example, if the Y-axis coordinate of a certain pixel point in the pixel coordinate map is 20 pixel, then the wear pixel value of this pixel point is: 20 pixel.

[0180] Optionally, the proportional relationship can, for example, refer to the actual distance corresponding to 1 pixel. For example, the 20 pixel can be converted into the actual distance according to the proportional relationship, and the converted actual distance is the wear pixel value of the pixel point.

[0181] Figure 7 FIG. is an example diagram of the pixel coordinate map provided by the embodiment of the present application. Refer to Figure 7 , the heights of each pixel point are different. Among them, the coordinate of the highest point 701 is (920, 0), and the coordinate of the lowest point 702 is (0, 20). The highest point can refer to the pixel point with the largest Y-axis value, and the lowest point can refer to the pixel point with the smallest Y-axis value.

[0182] To facilitate the understanding of the technical solution of the present application, the following explains the calculation formula of the wear depth:

[0183] Taking the highest point of the above edge wear curve as a reference, set the ordinate y1 of the highest point of the wear curve to 0, and at the same time find the ordinate of the lowest point of the wear curve, denoted as y2. Combine the black and white checkerboard calibration method to calibrate the industrial camera, and calculate the proportional relationship between the actual distance and 1 pixel of the image unit pixel. This proportional relationship can, for example, refer to the actual distance corresponding to 1 pixel.

[0184] Therefore, the wear depth at the lowest point of the carbon skateboard wear is:

[0185] (y2 - y1) * the actual distance corresponding to 1 pixel

[0186] The lowest point is:

[0187] 40 - [(y2 - y1) * the actual distance corresponding to 1 pixel] (unit: millimeter), where 40 is the initial height of the carbon skateboard.

[0188] In the embodiment of the present application, the camera is calibrated by using the black and white checkerboard calibration method, which can accurately determine the proportional relationship between the actual distance and the unit pixel. A pixel coordinate map is established based on the edge curve, and the coordinates of each pixel point in this coordinate system are clarified. Thus, taking the highest pixel point of the edge curve as a reference, the wear pixel value of each pixel point is calculated, realizing the preliminary quantification of the wear degree in the image dimension. Then, through the proportional relationship, the wear pixel value is converted into the actual wear depth. The data conversion from the image space to the real world space is realized, and the accurate actual wear depth value is obtained, which is used to judge whether the carbon skateboard reaches the replacement standard to ensure the safe and stable operation of the equipment, and at the same time improve the scientificity and accuracy of the operation and maintenance work.

[0189] Figure 8 FIG. 19 is a schematic structural diagram of a wear detection device for a pantograph carbon skateboard provided by an embodiment of the present application. The wear detection device 800 for the pantograph carbon skateboard may include:

[0190] An image acquisition unit 801, configured to acquire an initial image of the pantograph carbon skateboard, and perform denoising on the initial image by using bilateral filtering to obtain a denoised image. The image acquisition unit 801 preferably performs initial image acquisition during the train operation, or may also perform real-time acquisition.

[0191] A first extraction unit 802, configured to extract a mask image of the denoised image according to an improved U-Net model.

[0192] A second extraction unit 803, configured to extract a foreground image of the initial image based on the mask image of the initial image.

[0193] A third extraction unit 804, configured to extract an edge curve of the carbon skateboard in the foreground image based on an improved Canny model.

[0194] The wear calculation unit 805 is used to calculate the wear depth of each pixel point in the edge curve.

[0195] The abnormality determination unit 806 is used to determine that the carbon skateboard has abnormal wear if the wear depth of the lowest point in the edge curve is greater than or equal to a preset wear threshold.

[0196] Preferably, when it is determined that the carbon skateboard has abnormal wear, the abnormality determination unit 804 can output a prompt message indicating that the carbon skateboard has abnormal wear or the carbon skateboard needs to be replaced.

[0197] As an embodiment, the improved Canny model includes total variation denoising filtering, a first threshold and a second threshold, and a selection strategy for horizontal edge points; the second extraction unit may include:

[0198] The foreground denoising module is used to denoise the foreground image by using total variation denoising filtering to obtain a denoised foreground image.

[0199] The threshold acquisition module is used to determine the first threshold and the second threshold of the improved Canny model, and the first threshold is greater than the second threshold.

[0200] The pixel screening module is used to determine the pixel points with pixel values greater than the first threshold in the denoised foreground image as edge points, the pixel points with pixel values less than the second threshold as non-edge points, and the pixel points with pixel values greater than or equal to the second threshold and less than or equal to the first threshold as edge points.

[0201] The edge selection module is used to select the target edge points in the horizontal direction from the determined edge points according to the selection strategy of horizontal edge points.

[0202] The curve fitting module is used to perform curve fitting on the target edge points to obtain an edge curve.

[0203] As another embodiment, the threshold acquisition module may include:

[0204] The first calculation sub-module is used to calculate the pixel mean and standard deviation of the denoised foreground image.

[0205] The second calculation sub-module is used to calculate the product of the standard deviation and the edge point attribute parameter to obtain a first parameter.

[0206] The third calculation sub-module is used to calculate the product of the first parameter and the standard deviation to obtain a second parameter.

[0207] The threshold determination sub-module is used to determine the sum of the image pixel mean and the second parameter as the first threshold, and the difference between the image pixel mean and the second parameter as the second threshold.

[0208] As another embodiment, the edge selection module may include:

[0209] A standard acquisition sub-module for acquiring the standard deviation of the foreground image after denoising.

[0210] An edge selection sub-module for traversing each edge point. If the abscissa of the edge point is greater than or equal to the product of the standard deviation and the ordinate, the edge point is determined as the target edge point. If the abscissa of the edge point is less than the product of the standard deviation and the ordinate, the edge point is excluded.

[0211] As another embodiment, the first extraction unit may include:

[0212] A foreground extraction module for performing a bitwise AND operation on the initial image after denoising and the mask image to obtain the foreground image of the initial image.

[0213] As another embodiment, the mask extraction module may include:

[0214] A model determination sub-module for determining the improved U-Net model obtained through training. The improved U-Net model includes: a six-level encoder, a five-level decoder, and an attention module. The six-level encoder is connected in series and downsampled level by level, the five-level decoder is connected in series and upsampled level by level, and each level of the encoder is associated with the corresponding level of the decoder.

[0215] A first input sub-module for inputting the initial image into the first-level encoder of the six-level encoder, performing downsampling level by level through each level of the encoder of the six-level encoder, and using the spatial attention module for feature enhancement to obtain the output features and optimized features of each level of the encoder. The output features and optimized features of each level of the encoder are the input features of the next-level encoder.

[0216] A second input sub-module for inputting the output features of the fifth-level encoder and the output features of the sixth-level encoder into the fifth-level decoder, and performing upsampling level by level through each level of the decoder of the five-level decoder to obtain the output features of each level of the decoder. The output features of each level of the decoder and the output features of the same-level encoder are the input features of the next-level decoder.

[0217] A feature segmentation sub-module for performing feature segmentation on the target feature map output by the first-level decoder to obtain the mask image of the initial image.

[0218] As another embodiment, the wear calculation unit includes:

[0219] A camera calibration module for calibrating the camera that acquires the initial image based on the black and white checkerboard calibration method to obtain the proportional relationship between the actual distance and 1 pixel of the unit pixel.

[0220] A coordinate establishment module, configured to establish a pixel coordinate map based on the highest point of an edge curve, and determine the pixel coordinates of each pixel point of the edge curve in the pixel coordinate map, where the ordinate of each pixel point in the pixel coordinate map is the wear pixel value of each pixel point.

[0221] A wear calculation module, configured to calculate the wear depth in reality of the wear pixel value of each pixel point based on a proportional relationship.

[0222] Figure 9 FIG. shows a schematic structural diagram of an electronic device provided by an embodiment of the present application. The computing device may include a memory 901, a processor 902, and a computer program stored on the memory 901. The processor 902 executes the computer program to implement the wear detection method of any pantograph carbon slide in the above embodiments.

[0223] In addition, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the wear detection method of any pantograph carbon slide in the above embodiments is implemented.

[0224] In addition, an embodiment of the present application further provides a computer program product, including a computer program. When the computer program is executed by a processor, the wear detection method of any pantograph carbon slide in the above embodiments is implemented.

[0225] The train mentioned in the above embodiments of the present application may be an urban rail train or other rail vehicles, and the present application does not limit this.

[0226] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The solutions in the embodiments of the present application can be implemented in various computer languages. For example, C language, VHDL language, Verilog language, object-oriented programming language Java, and interpreted scripting language JavaScript, etc.

[0227] This application is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, as well as the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processors of general-purpose computers, special-purpose computers, embedded processors, or other programmable data processing devices to generate a machine, such that the instructions executed by the processors of the computer or other programmable data processing devices generate means for implementing the functions specified in one flow Figure 1 one flow or multiple flows and / or blocks Figure 1 or in multiple blocks.

[0228] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including instruction means that implement the functions specified in one flow Figure 1 one flow or multiple flows and / or blocks Figure 1 or in multiple blocks.

[0229] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one flow Figure 1 one flow or multiple flows and / or blocks Figure 1 or in multiple blocks.

[0230] In the description of the present application, it should be understood that the orientation or positional relationships indicated by the terms "center", "longitudinal", "transverse", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc. are based on the orientation or positional relationships shown in the drawings, and are only for the convenience of describing the present application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus should not be construed as a limitation of the present application.

[0231] In addition, the terms "first" and "second" are only used for descriptive purposes and should not be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the present application, "a plurality" means at least two, such as two, three, etc., unless otherwise specifically defined.

[0232] In this application, unless otherwise clearly defined and limited, terms such as "install", "connect", "link", "fix", etc. shall be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or integrated; it can be a mechanical connection, an electrical connection, or a connection that allows for mutual communication; it can be directly connected, or indirectly connected through an intermediate medium, and can be the internal communication between two components or the interaction relationship between two components. For those of ordinary skill in the art, the specific meanings of the above terms in this application can be understood according to specific circumstances.

[0233] Although the preferred embodiments of this application have been described, those skilled in the art can make additional changes and modifications once they know the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of this application.

[0234] Obviously, those skilled in the art can make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalent technologies, this application is also intended to include these modifications and variations.

Claims

1. A wear detection method for a pantograph carbon slide, characterized in that, Including: Collect the initial image of the pantograph carbon slide plate, and perform denoising on the initial image using bilateral filtering to obtain the denoised initial image; Extract the mask image of the denoised initial image according to the improved neural network U-Net model for biomedical image segmentation; Extract the foreground image of the initial image based on the mask image; Extract the edge curve of the carbon slide plate in the foreground image based on the improved Canny edge detection Canny model; Calculate the wear depth of each pixel point in the edge curve; If the wear depth of the lowest point in the edge curve is greater than or equal to the preset wear threshold, it is determined that the carbon slide plate has abnormal wear.

2. The method according to claim 1, characterized in that, The improved Canny model includes total variation denoising filtering, a first threshold and a second threshold, and a selection strategy for horizontal edge points; Based on the improved Canny model, extracting the edge curve of the carbon slide plate in the foreground image includes: Perform denoising on the foreground image using total variation denoising filtering to obtain the denoised foreground image; Determine the first threshold and the second threshold of the improved Canny model, where the first threshold is greater than the second threshold; Determine the pixel points with pixel values greater than the first threshold in the denoised foreground image as edge points, the pixel points with pixel values less than the second threshold as non-edge points, and the pixel points with pixel values greater than or equal to the second threshold and less than or equal to the first threshold as edge points; Select the target edge points in the horizontal direction from the determined edge points according to the selection strategy for horizontal edge points; Perform curve fitting on the target edge points to obtain the edge curve.

3. The method according to claim 2, wherein Determining the first threshold and the second threshold of the improved Canny model includes: Calculate the pixel mean and standard deviation of the denoised foreground image; Calculate the product of the standard deviation and the edge point attribute parameter to obtain a first parameter; Calculate the product of the first parameter and the standard deviation to obtain a second parameter; Determine the sum of the image pixel mean and the second parameter as the first threshold, and determine the difference between the image pixel mean and the second parameter as the second threshold.

4. The method according to claim 2, wherein Selecting the target edge points in the horizontal direction from the determined edge points according to the selection strategy for horizontal edge points includes: Obtain the standard deviation of the denoised foreground image; Traverse each edge point. If the abscissa of the edge point is greater than or equal to the product of the standard deviation and the ordinate, determine the edge point as the target edge point. If the abscissa of the edge point is less than the product of the standard deviation and the ordinate, eliminate the edge point.

5. The method according to claim 1, characterized in that, Based on the mask image, extracting the foreground image of the initial image includes: Perform bitwise AND calculation on the denoised initial image and the mask image to obtain the foreground image of the initial image.

6. The method according to claim 1, characterized in that, According to the improved U-Net model, extracting the mask image of the initial image includes: Determine the obtained improved U-Net model through training. The improved U-Net model includes: a six-level encoder, a five-level decoder, and an attention module. The six-level encoder is connected in series and downsamples step by step, the five-level decoder is connected in series and upsamples step by step, and each level of encoder is associated with the corresponding level of decoder; Input the initial image into the first-level encoder of the six-level encoder, and perform downsampling step by step through each level of encoder of the six-level encoder and use the spatial attention module for feature enhancement to obtain the output features and optimized features of each level of encoder. The output features and optimized features of each level of encoder are the input features of the next-level encoder; Input the output features of the fifth-level encoder and the output features of the sixth-level encoder into the fifth-level decoder, and perform upsampling step by step through each level of decoder of the five-level decoder to obtain the output features of each level of decoder. The output features of each level of decoder and the output features of the same-level encoder are the input features of the next-level decoder; Perform feature segmentation on the target feature map output by the first-level decoder to obtain the mask image of the initial image.

7. The method according to claim 1, characterized in that, The calculating the wear depth of each pixel point in the edge curve includes: Based on the black and white checkerboard calibration method, calibrate the camera for collecting the initial image to obtain the proportional relationship between the actual distance and 1 pixel of the unit pixel; Based on the highest point of the edge curve, establish a pixel coordinate map, and determine the pixel coordinates of each pixel point of the edge curve in the pixel coordinate map. The ordinate of each pixel point in the pixel coordinate map is the wear pixel value of each pixel point; Based on the proportional relationship, calculate the wear depth of the wear pixel value of each pixel point in reality.

8. An abrasion detection device for a pantograph carbon sliding plate, characterized in that, It includes: An image acquisition unit, configured to acquire the initial image of the pantograph carbon slide plate, and perform denoising on the initial image by using bilateral filtering to obtain a denoised image; A first extraction unit, configured to extract the mask image of the denoised image according to the improved U-Net model; A second extraction unit, configured to extract the foreground image of the initial image based on the mask image of the initial image; A third extraction unit, configured to extract the edge curve of the carbon slide plate in the foreground image based on the improved Canny model; A wear calculation unit, configured to calculate the wear depth of each pixel point in the edge curve; An abnormality determination unit, configured to determine that the carbon slide plate has abnormal wear if the wear depth of the lowest point in the edge curve is greater than or equal to a preset wear threshold.

9. An electronic device, characterized in that, It includes: A memory; A processor; And A computer program; Wherein, the computer program is stored in the memory and is configured to be executed by the processor to implement the method according to any one of claims 1-8.

10. A computer-readable storage medium, characterized in that, A computer program is stored thereon; the computer program is executed by the processor to implement the method according to any one of claims 1-8.