Train brake pad state detection method and detection device
The method and device use image processing techniques to accurately detect brake pad misinstallation or loss, enhancing maintenance efficiency and ensuring railway safety by automating the detection process.
Patent Information
- Application Number
- CN202011499212.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-17
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2040-12-17
AI Technical Summary
Existing methods for detecting the state of train brake pads, such as manual inspection in maintenance trenches, are inefficient and cannot be used for dynamic detection, posing a risk to driving safety due to potential misinstallation or loss of brake pads.
A method and device for detecting brake pad state using image processing techniques, including edge detection and grayscale analysis to determine if brake pads are correctly installed, using algorithms like YOLOv3-tiny for gap position detection, and pattern recognition to identify brake pad and disc edges, thereby determining if pads are upside down or missing.
Enables accurate, efficient, and automated detection of brake pad misinstallation or loss, improving maintenance efficiency and ensuring railway safety through online detection.
Smart Images

Figure CN112634223B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of train operation safety assurance, and in particular to a method and a device for detecting the state of a train brake shoe. Background Art
[0002] The brake pad is one of the core components of the train's braking system. When the train brakes, it fits tightly with the brake disc under the action of the brake caliper, generating huge friction to slow down the train. During actual train operation, there is a risk of the brake pad being lost or installed upside down, which will seriously threaten driving safety. The existing technology uses a traditional method. After the train is put into storage, it stops in the maintenance trench operation area, and people go down to the trench to roughly observe whether the brake pad is lost or installed upside down. The disadvantages of this method are slow speed, high labor intensity, and cannot be used for dynamic detection. Summary of the invention
[0003] In view of this, the present application provides a method and a device for detecting the status of a train brake pad, which can solve or at least partially solve the above-mentioned problems.
[0004] In order to solve the above technical problems, the technical solution provided by the present invention is a method for detecting the state of a train brake pad, comprising:
[0005] Receiving train brake pad images;
[0006] Extracting a brake pad area image from the train brake pad image according to a preset brake pad area template;
[0007] The gate pad edge line is extracted from the gate pad area image, the position of the extreme point of the gate pad edge line pixel point coordinate change curve is calculated, and the detection result of whether the train brake pad is installed upside down is obtained according to the relationship between the extreme point position of the gate pad edge line pixel point coordinate change curve and the preset extreme point position; or the gate pad edge line and the brake disc edge line are extracted from the gate pad area image, and the detection result of whether the train brake pad is installed upside down is obtained by judging whether there is an overlap between the gate pad edge line and the brake disc edge line; or the gap position of the gate pad in the gate pad area image is obtained, and the detection result of whether the train brake pad is installed upside down is obtained by judging the relationship between the gap position of the gate pad and the preset gap position.
[0008] Preferably, the method of extracting the gate pad edge line from the gate pad area image, calculating the extreme point position of the gate pad edge line pixel point coordinate change curve, and obtaining the detection result of whether the train brake pad is installed upside down according to the relationship between the extreme point position of the gate pad edge line pixel point coordinate change curve and the preset extreme point position comprises:
[0009] In the gate pad area image, the gate pad edge line is extracted based on the gray value of the pixel on the left side of the gate pad being smaller than that on the right side and the monotonic change characteristics of the edge line;
[0010] According to the change characteristics of the horizontal and vertical coordinates of the pixel points on the edge line of the gate piece, the extreme value point position of the horizontal and vertical coordinate change curve of the pixel points on the edge line of the gate piece is obtained;
[0011] It is determined whether the extreme point position of the horizontal and vertical coordinate change curve of the pixel point of the gate edge line is located at the preset extreme point position in the gate area image. If so, a detection result that the gate is not installed upside down is obtained; otherwise, a detection result that the gate is installed upside down is obtained.
[0012] Preferably, the method of finding the gate pad edge line according to the monotonic change of the grayscale value of the gate pad edge line pixel point in the gate pad area image, and obtaining the extreme point position of the horizontal and vertical coordinate change curve of the gate pad edge line pixel point according to the change characteristics of the horizontal and vertical coordinates of the gate pad edge line pixel point comprises:
[0013] Traverse the grayscale values of all pixels in the gate area image, and find the position of the pixel whose left grayscale value is less than the right grayscale value in each row of the gate area image according to the following formula: Where cols is the width of the gate pad area image, rows is the height of the gate pad area image, g(i, j) is the grayscale value of the pixel with coordinates (i, j) in the gate pad area image, and f(i, j) is the grayscale value of the pixel with coordinates (i, j) in another new image. Through this formula, a curve will be obtained on the new image, which is the gate pad edge line;
[0014] By using the changes in the horizontal and vertical coordinate positions of the pixels whose grayscale values in the new image are greater than or equal to 0 and less than or equal to 255, a curve function h(x, y) representing the edge line of the gate pad is obtained. The h(x, y) curve function shows that with the change of the vertical coordinate position, the horizontal coordinate increases monotonically first and then decreases. The points where the first-order derivative h`(x, y) of the curve function h(x, y) is obtained, and the second-order derivative h``(x, y)<0 are recorded as extreme points, that is, the extreme point positions of the horizontal and vertical coordinate change curves of the pixels of the edge line of the gate pad.
[0015] Preferably, the method of extracting the brake pad edge line and the brake disc edge line from the brake pad area image, and obtaining the detection result of whether the train brake pad is installed upside down by judging whether there is an overlap between the brake pad edge line and the brake disc edge line comprises:
[0016] In the gate pad area image, the gate pad edge line is extracted based on the gray value of the pixel on the left side of the gate pad being smaller than that on the right side and the monotonic change characteristics of the edge line;
[0017] In the brake pad area image, the left grayscale value of the brake disc edge line pixel is greater than the right grayscale value, and the brake disc edge line is extracted according to the monotonic change characteristics of its edge line;
[0018] It is determined whether there is an overlap point between the edge line of the brake pad and the edge line of the brake disc. If not, a detection result indicating that the brake pad is not installed upside down is obtained. If yes, a detection result indicating that the brake pad is installed upside down is obtained.
[0019] Preferably, the method of extracting the brake disc edge line according to the gray value on the left side of the brake disc edge line pixel point being greater than the gray value on the right side in the brake pad area image and according to the monotonic change characteristics of the edge line includes:
[0020] Find the area in the gate area image where the grayscale value of the left pixel is greater than the grayscale value of the right pixel;
[0021] A curve is found in the pixel gray value region, in which the horizontal coordinate first increases and then decreases as the vertical coordinate changes. The curve is the edge line of the brake disc.
[0022] Preferably, the method of obtaining the gap position of the brake pad in the brake pad area image and obtaining the detection result of whether the train brake pad is installed upside down by judging the relationship between the gap position of the brake pad and the preset gap position comprises:
[0023] The yolov3-tiny neural network algorithm is used to extract the gap position of the gate piece in the gate piece area image, and locate the specific position of the gap position of the gate piece in the gate piece area image;
[0024] It is determined whether the notch position of the gate piece is located at the preset notch position in the gate piece area image. If so, a detection result indicating that the gate piece is not installed upside down is obtained; otherwise, a detection result indicating that the gate piece is installed upside down is obtained.
[0025] Preferably, the method for detecting the state of a train brake pad further comprises:
[0026] Calculating the image grayscale mean of a preset first area and the image grayscale mean of a preset second area in the gate plate area image;
[0027] Calculating a ratio of a grayscale mean value of an image in a preset first area to a grayscale mean value of an image in a preset second area;
[0028] The obtained ratio is compared with the preset ratio threshold to obtain the detection result of whether the train brake pad is lost.
[0029] Preferably, the method for calculating the image grayscale mean of the preset first area and the image grayscale mean of the preset second area in the gate area image includes:
[0030] Using the formula Calculate, where mean is the pixel mean of the image, cols is the width of the image, rows is the height of the image, and img(i, j) is the grayscale value of the pixel with coordinates (i, j) in the image.
[0031] The present invention also provides a device for detecting the state of a train brake pad, comprising:
[0032] A brake pad image receiving module, used for receiving a train brake pad image;
[0033] A brake pad area extraction module is used to extract a brake pad area image from a train brake pad image according to a preset brake pad area template;
[0034] The gate pad state detection module is used to extract the gate pad edge line in the gate pad area image, calculate the extreme point position of the gate pad edge line pixel point coordinate change curve, and obtain the detection result of whether the train brake pad is installed upside down according to the relationship between the extreme point position of the gate pad edge line pixel point coordinate change curve and the preset extreme point position; or extract the gate pad edge line and the brake disc edge line in the gate pad area image, and obtain the detection result of whether the train brake pad is installed upside down by judging whether there is an overlap between the gate pad edge line and the brake disc edge line; or obtain the gap position of the gate pad in the gate pad area image, and obtain the detection result of whether the train brake pad is installed upside down by judging the relationship between the gap position of the gate pad and the preset gap position.
[0035] The present invention also provides a device for detecting the state of a train brake pad, comprising:
[0036] Memory for storing computer programs;
[0037] A processor is used to execute the computer program to implement the steps of the above-mentioned train brake pad status detection method.
[0038] Compared with the prior art, the beneficial effects of the present application are described in detail as follows: the method for detecting the status of a train brake pad provided by the present application receives a train brake pad image; extracts a brake pad area image from the train brake pad image according to a preset brake pad area template; and determines whether the brake pad is installed upside down by combining edge and grayscale features, thereby realizing accurate detection of reverse installation of the brake pad. Maintenance personnel can determine the next work plan by directly viewing the test results. Compared with the traditional manual observation method, the work efficiency of maintenance personnel is greatly improved, the efficiency of daily train maintenance is improved, and it is suitable for online detection and is more in line with the needs of railway safety detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0040] Figure 1 A schematic flow chart of a method for detecting a reverse state of a train brake pad installation provided by an embodiment of the present invention;
[0041] Figure 2 A schematic flow chart of another method for detecting a reverse state of train brake pad installation provided by an embodiment of the present invention;
[0042] Figure 3 A schematic flow chart of another method for detecting a reverse state of train brake pad installation provided by an embodiment of the present invention;
[0043] Figure 4 A schematic flow chart of a method for detecting a lost state of a train brake pad provided by an embodiment of the present invention;
[0044] Figure 5 A schematic diagram of the structure of a train brake pad status detection device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0045] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0046] In order to enable those skilled in the art to better understand the technical solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments.
[0047] like Figure 1 As shown, an embodiment of the present invention provides a method for detecting the state of a train brake pad, which is used to detect whether the train brake pad is installed upside down, and specifically includes:
[0048] S11: receiving a train brake pad image;
[0049] S12: extracting a brake pad area image from the train brake pad image according to a preset brake pad area template;
[0050] S13: extract the gate pad edge line from the gate pad area image, calculate the extreme point position of the gate pad edge line pixel point coordinate change curve, and obtain the detection result of whether the train brake pad is installed upside down according to the relationship between the extreme point position of the gate pad edge line pixel point coordinate change curve and the preset extreme point position.
[0051] Specifically, after the software finds the edge line of the gate piece, the extreme point can be obtained according to the monotonic change of the coordinates of the gate piece pixel points in the gate piece area image. The extreme point of the gate piece that is not installed upside down is in the middle position of the gate piece area image, and the extreme point of the gate piece that is installed upside down is in the non-middle position (lower position) of the gate piece area image. The position relationship can be used to determine whether the gate piece is installed upside down.
[0052] It should be noted that the train brake pad image received in S11 may be a train brake pad image taken by an array camera plus a fill light. The train brake pad image includes a left train brake pad image and a right train brake pad image. In order to unify the detection algorithms of the left and right brake pads, we use the right train brake pad image as the reference image for the subsequent algorithm processing. Then, for the left train brake pad image, we perform image horizontal mirroring processing, convert the left train brake pad image into the right train brake pad image, and then perform the subsequent algorithm processing, thereby reducing the complexity of the software algorithm processing.
[0053] It should be noted that S12 is a method for extracting a gate pad area image from a train gate pad image according to a preset gate pad area template, including: extracting a gate pad large area image according to a predefined gate pad large area template, and then extracting a gate pad small area image according to a predefined gate pad small area template, and the gate pad small area image is the final gate pad area image.
[0054] Specifically, firstly, a large area template and a small area template of a brake pad are defined, and pattern recognition technology is used to automatically extract a large area image of the brake pad from the original train brake pad image taken. The large area image of the brake pad includes a brake pad clamp and a restraining device, etc. Then, pattern recognition technology is used to automatically extract a small area image of the brake pad from the large area image. Pattern recognition technology includes edge extraction technology and template matching technology.
[0055] It should be noted that S13 extracts the gate pad edge line from the gate pad area image, calculates the extreme point position of the gate pad edge line pixel point coordinate change curve, and obtains the detection result of whether the train gate pad is installed reversely according to the relationship between the extreme point position of the gate pad edge line pixel point coordinate change curve and the preset extreme point position. The method includes:
[0056] S131: extracting the gate pad edge line in the gate pad area image according to the gray value of the pixel point on the left side of the gate pad being smaller than that on the right side and according to the monotonic change characteristic of the edge line;
[0057] S132: Obtaining the extreme point position of the horizontal and vertical coordinate change curve of the pixel points on the edge line of the gate blade according to the change characteristics of the horizontal and vertical coordinates of the pixel points on the edge line of the gate blade;
[0058] S133: Determine whether the extreme point position of the horizontal and vertical coordinate change curve of the gate pad edge line pixel point is located at the preset extreme point position in the gate pad area image. If so, obtain the detection result that the gate pad is not installed upside down; otherwise, obtain the detection result that the gate pad is installed upside down.
[0059] It should be noted that, in the gate pad area image, S131 extracts the gate pad edge line according to the fact that the grayscale value of the pixel point on the left side of the gate pad is smaller than that on the right side, and according to the monotonic change characteristics of the edge line, and S132 obtains the extreme point position of the horizontal and vertical coordinate change curve of the pixel point on the gate pad edge line according to the change characteristics of the horizontal and vertical coordinates of the pixel point on the gate pad edge line, including:
[0060] Traverse the grayscale values of all pixels in the gate area image, and find the position of the pixel whose left grayscale value is less than the right grayscale value in each row of the gate area image according to the following formula: Where cols is the width of the gate pad area image, rows is the height of the gate pad area image, g(i, j) is the grayscale value of the pixel with coordinates (i, j) in the gate pad area image, and f(i, j) is the grayscale value of the pixel with coordinates (i, j) in another new image. Through this formula, many curves (the positions of the pixel points that satisfy the formula) will be obtained on the new image, but only one curve is the gate pad edge line. In order to obtain the gate pad edge curve, it is necessary to further screen the many curves in the new image.
[0061] By using the changes in the horizontal and vertical coordinate positions of the pixels whose grayscale values in the new image are greater than or equal to 0 and less than or equal to 255, a curve function h(x, y) representing the edge line of the gate pad is obtained. The h(x, y) curve function shows that with the change of the vertical coordinate position, the horizontal coordinate increases monotonically first and then decreases. The points where the first-order derivative h`(x, y) of the curve function h(x, y) is obtained, and the second-order derivative h``(x, y)<0 are recorded as extreme points, that is, the extreme point positions of the horizontal and vertical coordinate change curves of the pixels of the edge line of the gate pad.
[0062] like Figure 2 As shown, the embodiment of the present invention also provides a method for detecting the state of a train brake pad, which is used to detect whether the train brake pad is installed in reverse. Figure 1 The difference between the corresponding embodiments is that the method of detecting whether the brake pad is installed upside down is different, which specifically includes:
[0063] S21: receiving a train brake pad image;
[0064] S22: extracting a brake pad area image from the train brake pad image according to a preset brake pad area template;
[0065] S23: extracting the brake pad edge line and the brake disc edge line from the brake pad area image, and obtaining a detection result of whether the train brake pad is installed upside down by judging whether there is an overlap between the brake pad edge line and the brake disc edge line.
[0066] Specifically, when the train brake pad is installed upside down, it will be higher than the brake disc, thus causing some obstruction to the edge of the brake disc. Whether the brake pad is installed upside down can be determined by judging whether the curves of the brake pad edge line and the brake disc edge line intersect. That is, if the brake pad is installed correctly, there will be no intersection between the train brake pad edge line and the brake disc edge line. If the brake pad is installed upside down, there will be an intersection area between the brake pad edge line and the brake disc edge line.
[0067] It should be noted that, in S23, the brake pad edge line and the brake disc edge line are extracted from the brake pad area image, and the method for obtaining the detection result of whether the train brake pad is installed reversely by judging whether there is an overlap between the brake pad edge line and the brake disc edge line includes:
[0068] S231: extracting the gate pad edge line in the gate pad area image based on the grayscale value of the pixel point on the left side of the gate pad being smaller than that on the right side and based on the monotonic change characteristics of the edge line; the edge line can be fitted as a blue line;
[0069] S232: in the brake pad area image, the left grayscale value of the brake disc edge line pixel is greater than the right grayscale value, and the brake disc edge line is extracted according to the monotonic change characteristics of the edge line; it can be fitted as a yellow line;
[0070] S233: Determine whether there are overlapping points between the edge line of the brake pad and the edge line of the brake disc. If not, obtain the detection result that the brake pad is not installed upside down. If yes, obtain the detection result that the brake pad is installed upside down. That is, further determine the overlapping positions of the edge line of the brake pad (blue line) and the edge line of the brake disc (yellow line) on the brake pad area image. If there are overlapping points, it proves that they intersect each other, and further proves that the brake pad is installed upside down. If there are no overlapping points, it is considered that the brake pad is not installed upside down.
[0071] It should be noted that, in S232, the method of extracting the brake disc edge line according to the gray value on the left side of the brake disc edge line pixel point in the brake pad area image being greater than the gray value on the right side and the monotonic change feature of the edge line includes:
[0072] S2321: Find an area in the gate area image where the grayscale value of the left pixel is greater than the grayscale value of the right pixel;
[0073] Specifically, the step of finding, in the gate plate area image, an area where the grayscale value of the left pixel is greater than the grayscale value of the right pixel includes:
[0074] (1) Assume that the original image is g, with a width of cols and a height of rows. Consider the image as a rectangular coordinate system. Now assume that the horizontal coordinate of one pixel is i, the vertical coordinate is j, and the grayscale value of the pixel is g(i, j). At the same time, create a grayscale image f with the same width and height, and set the grayscale values of all its pixels to 0;
[0075] (2) Traverse all the pixels in image g and find the area where the grayscale value of the left pixel is greater than the grayscale value of the right pixel according to the following formula. If a point (i, j) in image g satisfies the condition that the grayscale value of the left pixel is greater than the grayscale value of the right pixel, then the grayscale value of the pixel (i, j) in image f is set to 255. The formula is as follows:
[0076] (3) According to the above formula, an image area with a pixel grayscale value of 255 will be obtained in the grayscale image f, that is, the area where the grayscale value of the left pixel is greater than the grayscale value of the right pixel.
[0077] S2322: Find a curve in the pixel gray value region, where the horizontal coordinate first increases and then decreases as the vertical coordinate changes. The curve is the edge line of the brake disc.
[0078] Specifically, the method of finding a curve in the pixel gray value region, in which the horizontal coordinate first increases and then decreases as the vertical coordinate changes, and the curve is the edge line of the brake disc includes:
[0079] (1) According to the image f obtained in the previous step, there is a pixel with a grayscale value of 255 in the image. Assume that its horizontal and vertical coordinates are x and y respectively. According to the position changes of its horizontal and vertical coordinates, a curve function h(x,y) representing the edge line of the brake pad can be obtained; (2) First, the curve function h(x,y) is differentiated, and its first-order derivative h`(x,y) is obtained, and the second-order derivative h``(x,y) is obtained by continuing to differentiate. On this basis, if h`(x,y) = 0, h``(x,y) ≠ 0, then the extreme value point can be obtained at this point. If h"(x,y) < 0, then h reaches the maximum value point at this point. The entire curve function shows a trend of increasing first and then decreasing, and this curve function is the brake disc edge curve.
[0080] like Figure 3 As shown, the present invention also provides a method for detecting the state of a train brake pad, which is used to detect whether the train brake pad is installed in reverse. Figure 1 , Figure 2 The difference between the corresponding embodiments lies in the different methods for detecting whether the train brake pad is installed upside down, which specifically include:
[0081] S31: receiving a train brake pad image;
[0082] S32: extracting a brake pad area image from the train brake pad image according to a preset brake pad area template;
[0083] S33: Obtain the gap position of the brake pad in the brake pad area image, and obtain a detection result of whether the train brake pad is installed upside down by judging the relationship between the gap position of the brake pad and the preset gap position.
[0084] Specifically, when the train brake pad is installed upside down, the gap position will be far away from the center area of the brake pad. The position relationship can be used to determine whether the brake pad is installed upside down. That is, the gap area on the brake pad is identified using a pattern recognition method. If the gap area is located below the brake pad area image, it proves that the brake pad is installed correctly. If the gap area is located above the brake pad area image, it proves that the brake pad is installed upside down.
[0085] It should be noted that the method of obtaining the gap position of the gate piece in the gate piece area image in S33 and obtaining the detection result of whether the train brake piece is installed upside down by judging the relationship between the gap position of the gate piece and the preset gap position includes:
[0086] S331: extracting the gap position of the gate piece in the gate piece area image by using the yolov3-tiny neural network algorithm, and locating and obtaining the specific position of the gap position of the gate piece in the gate piece area image;
[0087] Specifically, S331 uses the yolov3-tiny neural network algorithm to extract the gap position of the gate piece in the gate piece area image, and locates and obtains the specific position of the gap position of the gate piece in the gate piece area image. The method includes:
[0088] (1) First, a large amount of image data of the gap position in the gate area needs to be collected;
[0089] (2) Then the collected data is labeled and trained using the yolov3-tiny neural network to obtain a weight file;
[0090] (3) Load the weight file and process the input gate plate area image to identify the gate plate gap position in the gate plate area image. S332: Determine whether the gate plate gap position is located at the preset gap position in the gate plate area image. If so, obtain a detection result that the gate plate is not installed upside down. Otherwise, obtain a detection result that the gate plate is installed upside down.
[0091] Specifically, if the gap area exists in the lower position of the gate plate area image, it proves that the gate plate position is installed correctly. If the gap position exists in the upper position of the gate plate area image, it proves that the gate plate position is installed reversely.
[0092] It should be noted that if Figure 4 As shown, the present invention also provides a train brake pad state detection method for detecting whether the train brake pad is lost, specifically comprising:
[0093] S41: Calculating the image grayscale mean of a preset first area and the image grayscale mean of a preset second area in the gate pad area image;
[0094] S42: Calculate the ratio of the image grayscale mean of the preset first area to the image grayscale mean of the preset second area;
[0095] S43: Compare the obtained ratio with a preset ratio threshold value to obtain a detection result of whether the train brake pad is lost.
[0096] It should be noted that after the gate pad is lost, a large area of black will be formed at the gate pad position in the gate pad area image, and the ratio of the grayscale mean of the left 3 / 5 area of the gate pad area image to the grayscale mean of the right 2 / 5 area will be relatively large. Therefore, a threshold is set, and when the ratio of the grayscale mean of the left 3 / 5 area of the gate pad area image to the grayscale mean of the right 2 / 5 area of the gate pad area image is greater than the threshold, it can be directly judged that the gate pad is lost.
[0097] Specifically, the gate pad area image is processed to obtain the left 3 / 5 area image and the right 2 / 5 area image of the gate pad area image, that is, the preset first area in the gate pad area image can be the left three-fifths of the image area, and the preset second area in the gate pad area image can be the right two-fifths of the image area. The grayscale average value of the right two-fifths area is much smaller than the grayscale average value of the left three-fifths. The ratio of the two grayscale average values is calculated, and the ratio is compared with the preset ratio threshold to determine whether the train brake pad is lost.
[0098] It should be noted that the method of calculating the image grayscale mean of the preset first area and the image grayscale mean of the preset second area in the gate plate area image in S41 includes:
[0099] Using the formula Calculate, where mean is the pixel mean of the image, cols is the width of the image, rows is the height of the image, and img(i, j) is the grayscale value of the pixel with coordinates (i, j) in the image.
[0100] Specifically, the grayscale value mean of the left 3 / 5 area image and the grayscale value mean of the right 2 / 5 area image of the gate area image are calculated, and the ratio of the grayscale value mean of the left 3 / 5 area to the grayscale value mean of the right 2 / 5 area is calculated; the calculation method / formula is: Where mean is the mean of the image, cols is the width of the image, rows is the height of the image, and img(i,j) is the grayscale value of the pixel with coordinates (i,j) in the image. Determine whether the ratio of the grayscale value mean of the left 3 / 5 area image of the gate area image to the grayscale value mean of the right 2 / 5 area image is greater than the preset threshold. If so, the detection result of the gate missing is obtained. If not, the detection result of the gate not missing is obtained.
[0101] The inventive principle of the present invention: The present invention is a detection method for gate pad loss and gate pad reverse installation that integrates pattern recognition technology and image feature extraction technology. The processed gate pad image is taken by a planar array camera plus a fill light. First, the gate pad area is located from the image through pattern recognition technology, and then the edge and grayscale features are combined to determine whether the gate pad is lost or installed reversely. This algorithm has been applied in online detection of EMUs with good application effect.
[0102] like Figure 5 As shown, the present invention also provides a device for detecting the state of a train brake pad, comprising:
[0103] A brake pad image receiving module 51 is used to receive a train brake pad image;
[0104] A brake pad area extraction module 52, used to extract a brake pad area image from the train brake pad image according to a preset brake pad area template;
[0105] The gate pad state detection module 53 is used to extract the gate pad edge line in the gate pad area image, calculate the extreme point position of the gate pad edge line pixel point coordinate change curve, and obtain the detection result of whether the train brake pad is installed upside down according to the relationship between the extreme point position of the gate pad edge line pixel point coordinate change curve and the preset extreme point position; or extract the gate pad edge line and the brake disc edge line in the gate pad area image, and obtain the detection result of whether the train brake pad is installed upside down by judging whether there is an overlap between the gate pad edge line and the brake disc edge line; or obtain the gap position of the gate pad in the gate pad area image, and obtain the detection result of whether the train brake pad is installed upside down by judging the relationship between the gap position of the gate pad and the preset gap position.
[0106] The present invention also provides a device for detecting the state of a train brake pad, comprising: a memory for storing a computer program; and a processor for executing the computer program to implement the steps of the above-mentioned method for detecting the state of a train brake pad.
[0107] Figure 5 The description of the features in the corresponding embodiments can be found in Figure 1-Figure 4 The relevant descriptions of the corresponding embodiments will not be repeated here one by one.
[0108] The above is a detailed introduction to a method and device for detecting the lost state of a train brake pad provided in an embodiment of the present invention. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referenced to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principle of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.
[0109] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0110] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
Claims
1. A method for detecting the state of a train brake pad, characterized in that: include: Receiving train brake pad images; According to the preset brake pad area template, a brake pad area image is extracted from the train brake pad image; Calculating the image grayscale mean of a preset first area and the image grayscale mean of a preset second area in the gate plate area image; Calculate the ratio of the image grayscale mean of the preset first area to the image grayscale mean of the preset second area; wherein the preset first area is the left three-fifths of the image area, and the preset second area is the right two-fifths of the image area; compare the obtained ratio with the preset ratio threshold value to obtain the detection result of whether the train brake pad is lost; In the brake pad area image, the brake pad edge line is extracted according to the gray value relationship, the extreme point position of the brake pad edge line pixel point coordinate change curve is calculated according to the coordinate curve, and the detection result of whether the train brake pad is installed upside down is obtained according to the relationship between the extreme point position of the brake pad edge line pixel point coordinate change curve and the preset extreme point position; Alternatively, in the brake pad area image, the brake pad edge line and the brake disc edge line are extracted according to the gray value relationship and the edge line features, and the detection result of whether the train brake pad is installed upside down is obtained by judging whether there is an overlap between the brake pad edge line and the brake disc edge line.
2. The method for detecting the state of a train brake pad according to claim 1, characterized in that: The method of extracting a brake pad edge line according to a gray value relationship in a brake pad area image, calculating an extreme point position of a brake pad edge line pixel point coordinate change curve according to a coordinate curve, and obtaining a detection result of whether a train brake pad is installed reversely according to a relationship between the extreme point position of the brake pad edge line pixel point coordinate change curve and a preset extreme point position includes: In the gate pad area image, the gate pad edge line is extracted based on the gray value of the pixel on the left side of the gate pad being smaller than that on the right side and the monotonic change characteristics of the edge line; According to the change characteristics of the horizontal and vertical coordinates of the pixel points on the edge line of the gate piece, the extreme value point position of the horizontal and vertical coordinate change curve of the pixel points on the edge line of the gate piece is obtained; It is determined whether the extreme point position of the horizontal and vertical coordinate change curve of the pixel point of the gate edge line is located at the preset extreme point position in the gate area image. If so, a detection result that the gate is not installed upside down is obtained; otherwise, a detection result that the gate is installed upside down is obtained.
3. The method for detecting the train brake pad state according to claim 2, characterized in that: The method of finding the gate pad edge line according to the monotonic change of the grayscale value of the gate pad edge line pixel point in the gate pad area image, and obtaining the extreme point position of the horizontal and vertical coordinate change curve of the gate pad edge line pixel point according to the change characteristics of the horizontal and vertical coordinates of the gate pad edge line pixel point comprises: Traverse the grayscale values of all pixels in the gate area image, and find the position of the pixel whose left grayscale value is less than the right grayscale value in each row of the gate area image according to the following formula: Where cols is the width of the gate pad area image, rows is the height of the gate pad area image, g(i, j) is the grayscale value of the pixel with coordinates (i, j) in the gate pad area image, and f(i, j) is the grayscale value of the pixel with coordinates (i, j) in another new image. Through this formula, a curve will be obtained on the new image, which is the gate pad edge line; By using the changes in the horizontal and vertical coordinate positions of the pixels whose grayscale values in the new image are greater than or equal to 0 and less than or equal to 255, a curve function h(x, y) representing the edge line of the gate pad is obtained. The h(x, y) curve function shows that with the change of the vertical coordinate position, the horizontal coordinate increases monotonically first and then decreases. The points where the first-order derivative h`(x, y) of the curve function h(x, y) is obtained, and the second-order derivative h``(x, y)<0 are recorded as extreme points, that is, the extreme point positions of the horizontal and vertical coordinate change curves of the pixels of the edge line of the gate pad.
4. The method for detecting the state of a train brake pad according to claim 1, characterized in that: The method of extracting the brake pad edge line and the brake disc edge line in the brake pad area image according to the gray value relationship and the edge line feature, and obtaining the detection result of whether the train brake pad is installed upside down by judging whether there is an overlap between the brake pad edge line and the brake disc edge line includes: In the gate pad area image, the gate pad edge line is extracted based on the gray value of the pixel on the left side of the gate pad being smaller than that on the right side and the monotonic change characteristics of the edge line; In the brake pad area image, the left grayscale value of the brake disc edge line pixel is greater than the right grayscale value, and the brake disc edge line is extracted according to the monotonic change characteristics of its edge line; It is determined whether there is an overlap point between the edge line of the brake pad and the edge line of the brake disc. If not, a detection result indicating that the brake pad is not installed upside down is obtained. If yes, a detection result indicating that the brake pad is installed upside down is obtained.
5. The method for detecting the state of a train brake pad according to claim 4, characterized in that: The method for extracting the brake disc edge line in the brake pad area image according to the gray value on the left side of the brake disc edge line pixel point being greater than the gray value on the right side and according to the monotonic change characteristics of the edge line includes: Find the area in the gate area image where the grayscale value of the left pixel is greater than the grayscale value of the right pixel; A curve is found in the pixel gray value region, in which the horizontal coordinate first increases and then decreases as the vertical coordinate changes. The curve is the edge line of the brake disc.
6. The method for detecting the state of a train brake pad according to claim 1, characterized in that: The method for calculating the image grayscale mean of the preset first area and the image grayscale mean of the preset second area in the gate plate area image comprises: Using the formula Calculate, where mean is the pixel mean of the image, cols is the width of the image, rows is the height of the image, and img(i, j) is the grayscale value of the pixel with coordinates (i, j) in the image.
7. A train brake pad state detection device, characterized in that: include: A brake pad image receiving module, used for receiving a train brake pad image; A brake pad area extraction module is used to extract a brake pad area image from a train brake pad image according to a preset brake pad area template; The gate pad state detection module is used to extract the gate pad edge line in the gate pad area image according to the gray value relationship, calculate the extreme point position of the gate pad edge line pixel point coordinate change curve according to the coordinate curve, and obtain the detection result of whether the train brake pad is installed upside down according to the relationship between the extreme point position of the gate pad edge line pixel point coordinate change curve and the preset extreme point position; or in the gate pad area image, extract the gate pad edge line and the brake disc edge line according to the gray value relationship and the edge line feature, and obtain the detection result of whether the train brake pad is installed upside down by judging whether there is an overlap between the gate pad edge line and the brake disc edge line.
8. A device for detecting the state of a train brake pad, characterized in that: include: Memory for storing computer programs; A processor, configured to execute the computer program to implement the steps of the method for detecting the state of a train brake pad as claimed in any one of claims 1 to 6.