Pantograph abnormal inclination detection method and device
Patent Information
- Application Number
- CN202411324445.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-09-23
AI Technical Summary
The existing pantograph abnormal tilt detection methods have problems such as low detection accuracy, poor real-time performance, and susceptible to environmental interference, which is difficult to meet the safe operation needs of modern urban rail transit.
The pantograph image acquisition device collects video data in real time, and uses the key area detection module, the lower arm pixel segmentation module and the boundary slope extraction module to extract the lower arm boundary segment of the pantograph, calculate the slope value and judge the inclination angle, and combine it with YOLOV8 Accurate detection with PIDNet algorithm to reduce interference from environmental factors.
It realizes accurate detection of abnormal inclination of pantographs, improves detection accuracy and speed, meets the needs of real-time and accuracy, and provides strong technical support for the safe operation of rail transit.
Smart Images

Figure CN119251177A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of pantographs, and in particular to a method and device for detecting abnormal inclination of a pantograph. Background Art
[0002] The pantograph is a power supply device installed on the roof of a rail transit train to collect current from the contact wire. It is a key component of the train's power supply. The operating status of the pantograph directly affects the safe operation of the vehicle. During the high-speed operation of the train, the pantograph undergoes frequent raising and lowering actions, and is continuously subjected to the vibration and impact of the contact network. The unevenness of the contact network and the inclination of the train itself may cause the pantograph to tilt. The inclination of the bow head will not only affect the contact stability between the pantograph and the contact network, resulting in a decrease in power transmission efficiency, but may also cause pantograph-network failures and even endanger driving safety. Therefore, it is of great significance to detect the inclination of the pantograph in real time.
[0003] At present, one method for detecting abnormal tilt of a pantograph in the prior art is an image-based detection method. This detection method uses a high-speed camera to take a pantograph image, and uses an image processing algorithm to analyze and process it to determine whether it is tilted. The disadvantages of this detection method include: it is greatly affected by environmental factors such as lighting and weather.
[0004] Another method for detecting abnormal pantograph tilt in the prior art is a sensor-based detection method. This detection method directly measures the tilt angle of the pantograph head through a sensor installed on the pantograph. The disadvantages of this method include high cost and complex installation and maintenance.
[0005] In short, the existing methods for detecting abnormal pantograph tilt have problems such as low detection accuracy, poor real-time performance, and susceptibility to environmental interference, which are difficult to meet the safe operation requirements of modern urban rail transit. Summary of the invention
[0006] The embodiments of the present invention provide a method and device for detecting abnormal tilt of a pantograph, so as to effectively detect whether the pantograph is abnormally tilted.
[0007] In order to achieve the above object, the present invention adopts the following technical scheme.
[0008] According to one aspect of the present invention, a method for detecting abnormal pantograph tilt is provided, comprising:
[0009] The current pantograph video data is collected in real time by a pantograph image acquisition device, and a frame operation is performed on the current pantograph video data to obtain a current pantograph image;
[0010] Determine whether the current pantograph image belongs to the dirty lens category or the clean pantograph category, and extract the pantograph two-dimensional rectangular coordinate frame information of the current pantograph image belonging to the clean pantograph category through the pantograph key area detection module;
[0011] The pantograph lower arm pixel segmentation module is used to perform pixel segmentation on the pantograph lower arm in the current pantograph image.
[0012] Obtaining a lower arm mask image;
[0013] The four boundary contour line segments of the lower arm of the pantograph are extracted by the lower arm boundary slope extraction module, and the two boundary lines of the lower arm of the pantograph are obtained according to the four boundary contour line segments by using parameter restrictions, and the slope values of the two boundary lines are calculated; the relative inclination angle of the lower arm of the current pantograph is calculated according to the slope values of the two boundary lines of the lower arm of the pantograph, and the relative inclination angle of the lower arm of the current pantograph is compared with the set inclination angle threshold value, and it is judged whether the current pantograph has abnormal pantograph inclination according to the comparison result;
[0014] When the judgment result is tilt, the pantograph is marked with a tilt label on the current pantograph image using the pantograph two-dimensional rectangular coordinate frame information.
[0015] Preferably, the pantograph key area detection module is used to determine whether the current pantograph image belongs to the dirty lens category or the clean pantograph category, and extract the pantograph two-dimensional rectangular coordinate frame information of the current pantograph image belonging to the clean pantograph category, including:
[0016] The category information of the pantograph images is annotated at the image level. The category information includes two categories: dirty pantographs and clean pantographs. The pantograph recognition dataset is constructed using pantograph images of all categories.
[0017] The real-time target detection algorithm is trained and verified using the pantograph recognition data set through the pantograph key area detection module, and the trained target detection algorithm is used to determine the category information of the current pantograph image. If the category information of the current pantograph image belongs to the dirty lens category, the algorithm terminates; if the category information of the current pantograph image belongs to the clean pantograph category, the two-dimensional rectangular coordinate frame information of the pantograph is extracted and saved.
[0018] Preferably, the pantograph lower arm pixel segmentation module is used to perform pixel segmentation on the pantograph lower arm in the current pantograph image to obtain a lower arm mask image, including:
[0019] Annotate the content information of the pantograph image at the pixel level, which includes the lower arm and the background, and construct a pantograph segmentation dataset using the content information of all pantograph images;
[0020] The pantograph segmentation dataset is used to train and verify the fast semantic segmentation algorithm through the pantograph lower arm pixel segmentation module, and the trained fast semantic segmentation algorithm is used to perform pixel segmentation on the lower arm in the current pantograph image to obtain an RGB color lower arm mask image; the RGB color lower arm mask image is converted into a grayscale lower arm mask image.
[0021] Preferably, the extracting four boundary contour line segments of the lower arm of the pantograph by the lower arm boundary slope extraction module, obtaining two boundary lines of the lower arm of the pantograph by parameter restriction according to the four boundary contour line segments, and calculating the slope values of the two boundary lines include:
[0022] The lower arm boundary slope extraction module uses the edge detection operator and the Hough linear transformation algorithm to extract the four boundary contour line segments of the lower arm in the grayscale lower arm mask image, where Edges is the edge detection result, and Lines is the four boundary contour line segments, which are the left, right, upper and lower edge contour line segments respectively;
[0023] Edges = cv2.Canny(Image gray ,50,150)
[0024] Lines=cv2.HoughLines(Edges,1,Π / 180)
[0025] Using the straight line parameter r = 130, the line segment length threshold is set, and the line segment length is used to filter out two longer boundary contour line segments on the left and right sides, and the corresponding key fitting parameter pairs (ρ, θ) are obtained respectively, where ρ is the polar diameter and θ is the polar angle;
[0026] Lines=cv2.HoughLines(Edges,1,Π / 180,r=130)
[0027] (ρ,θ)=Lines[0]
[0028] Use the key fitting parameters to obtain the coordinates of the two endpoints corresponding to the two boundary contour segments. is the coordinate of the first endpoint of the i-th line segment, is the coordinate of the second endpoint of the i-th line segment, (ρ i ,θ i ) is the parameter pair of the i-th line segment, i = 1, 2;
[0029]
[0030] The slopes k of the two boundary lines of the lower arm are calculated using the coordinates of the two end points of the two line segments;
[0031]
[0032] Preferably, the method of calculating the relative inclination angle of the lower arm of the current pantograph according to the slope values of the two boundary lines of the lower arm of the pantograph, comparing the relative inclination angle of the lower arm of the current pantograph with a set inclination angle threshold, and judging whether the current pantograph has abnormal pantograph inclination according to the comparison result includes:
[0033] The angle α of the lower arm in the pantograph image is calculated by weighting the slope values of the two boundary lines of the lower arm;
[0034]
[0035] Set the tilt angle threshold δ=3, and calculate the relative tilt angle β between the angle α of the lower arm and 90 degrees in the vertical direction;
[0036] β=|α-90|
[0037] If the relative tilt angle β is greater than or equal to the set tilt angle threshold δ, it is determined that the pantograph is abnormally tilted; if the relative tilt angle β is less than the set threshold range δ, it is determined that the pantograph is not abnormally tilted.
[0038] According to another aspect of the present invention, a pantograph abnormal tilt detection device is provided, comprising: a pantograph video data acquisition module, a pantograph key area detection module, a pantograph lower arm pixel segmentation module, a lower arm boundary slope extraction module, a pantograph abnormal tilt judgment module and a tilt label marking module;
[0039] The pantograph video data acquisition module is used to acquire the current pantograph video data in real time through the pantograph image acquisition device, perform frame extraction operation on the current pantograph video data, and obtain the current pantograph image;
[0040] The pantograph key area detection module is used to determine whether the current pantograph image belongs to the dirty lens category or the clean pantograph category, and extract the pantograph two-dimensional rectangular coordinate frame information of the current pantograph image belonging to the clean pantograph category;
[0041] The pantograph lower arm pixel segmentation module is used to perform pixel segmentation on the pantograph lower arm in the current pantograph image to obtain a lower arm mask image;
[0042] The lower arm boundary slope extraction module is used to extract four boundary contour line segments of the lower arm of the pantograph, obtain two boundary lines of the lower arm of the pantograph based on the four boundary contour line segments using parameter restrictions, and calculate the slope values of the two boundary lines; the pantograph abnormal tilt judgment module is used to calculate the relative tilt angle of the lower arm of the current pantograph based on the slope values of the two boundary lines of the lower arm of the pantograph, compare the relative tilt angle of the lower arm of the current pantograph with the set tilt angle threshold, and judge whether the current pantograph has abnormal tilt according to the comparison result;
[0043] The tilt label marking module is used to mark the pantograph with a tilt label on the current pantograph image using the pantograph two-dimensional rectangular coordinate frame information when the judgment result is tilt, so as to achieve accurate detection of abnormal tilt of the pantograph.
[0044] Preferably, the pantograph key area detection module is used to annotate the category information of the pantograph image at the image level, and the category information includes two categories: dirty lens and clean pantograph, and a pantograph recognition data set is constructed using pantograph images of all categories;
[0045] The real-time target detection algorithm is trained and verified using the pantograph recognition dataset. The trained target detection algorithm is used to determine the category information of the current pantograph image. If the category information of the current pantograph image belongs to the dirty lens category, the algorithm terminates; if the category information of the current pantograph image belongs to the clean pantograph category, the two-dimensional rectangular coordinate frame information of the pantograph is extracted and saved.
[0046] Preferably, the pantograph lower arm pixel segmentation module is used to annotate the content information of the pantograph image at the pixel level, the content information including the lower arm and the background, and construct a pantograph segmentation dataset using the content information of all pantograph images;
[0047] The pantograph segmentation dataset is used to train and verify the fast semantic segmentation algorithm. The trained fast semantic segmentation algorithm is used to perform pixel segmentation on the lower arm in the current pantograph image to obtain an RGB color lower arm mask image; the RGB color lower arm mask image is converted into a grayscale lower arm mask image.
[0048] Preferably, the lower arm boundary slope extraction module is used to extract four boundary contour line segments of the lower arm of the pantograph, obtain two boundary lines of the lower arm of the pantograph according to the four boundary contour line segments by using parameter restrictions, and calculate the slope values of the two boundary lines, including:
[0049] The lower arm boundary slope extraction module uses the edge detection operator and the Hough linear transformation algorithm to extract the four boundary contour line segments of the lower arm in the grayscale lower arm mask image, where Edges is the edge detection result, and Lines is the four boundary contour line segments, which are the left, right, upper and lower edge contour line segments respectively;
[0050] Edges = cv2.Canny(Image gray ,50,150)
[0051] Lines=cv2.HoughLines(Edges,1,Π / 180)
[0052] Using the straight line parameter r = 130, the line segment length threshold is set, and the line segment length is used to filter out two longer boundary contour line segments on the left and right sides, and the corresponding key fitting parameter pairs (ρ, θ) are obtained respectively, where ρ is the polar diameter and θ is the polar angle;
[0053] Lines=cv2.GoughLines(Edges,1,Π / 180,r=130)
[0054] (ρ,θ)=Lines[0]
[0055] Use the key fitting parameters to obtain the coordinates of the two endpoints corresponding to the two boundary contour segments. is the coordinate of the first endpoint of the i-th line segment, is the coordinate of the second endpoint of the i-th line segment, (ρ i ,θ i ) is the parameter pair of the i-th line segment, i = 1, 2;
[0056]
[0057] The slopes k of the two boundary lines of the lower arm are calculated using the coordinates of the two end points of the two line segments;
[0058]
[0059] Preferably, the pantograph abnormal tilt judgment module is used to calculate the angle α of the lower arm in the pantograph image by weighted calculation using the slope values of the two boundary lines of the lower arm;
[0060]
[0061] Set the tilt angle threshold δ=3, and calculate the relative tilt angle β between the angle α of the lower arm and 90 degrees in the vertical direction;
[0062] β=|α-90|
[0063] If the relative tilt angle β is greater than or equal to the set tilt angle threshold δ, it is determined that the pantograph is abnormally tilted; if the relative tilt angle β is less than the set threshold range δ, it is determined that the pantograph is not abnormally tilted.
[0064] A non-transitory computer-readable storage medium is used to store computer instructions. When the computer instructions are executed by a processor, the method for detecting abnormal tilt of a pantograph is implemented.
[0065] A computer program product includes a computer program, and when the computer program is run on one or more processors, it is used to implement the rail transit tunnel intrusion detection method.
[0066] An electronic device comprises: a processor, a memory and a computer program; wherein the processor is connected to the memory, the computer program is stored in the memory, and when the electronic device is running, the processor executes the computer program stored in the memory so that the electronic device executes the method for detecting abnormal pantograph tilt.
[0067] It can be seen from the technical solution provided by the above-mentioned embodiments of the present invention that the method of the embodiment of the present invention can effectively detect whether the pantograph is abnormally tilted, provide strong technical support for real-time monitoring and maintenance of the pantograph status, and meet the safe operation requirements of modern urban rail transit.
[0068] Additional aspects and advantages of the present invention will be given in part in the following description, which will become obvious from the following description, or may be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0070] Figure 1 A processing flow chart of a pantograph abnormal tilt detection method provided by an embodiment of the present invention;
[0071] Figure 2 A structural diagram of a pantograph provided in an embodiment of the present invention;
[0072] Figure 3 A mask diagram of a pantograph lower arm provided by an embodiment of the present invention;
[0073] Figure 4 A structural diagram of a pantograph abnormal tilt detection device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0074] The embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be interpreted as limiting the present invention.
[0075] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present invention refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be intermediate elements. In addition, the "connection" or "coupling" used herein may include wireless connection or coupling. The term "and / or" used herein includes any unit and all combinations of one or more associated listed items.
[0076] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as those generally understood by those skilled in the art in the art to which the present invention belongs. It should also be understood that terms such as those defined in common dictionaries should be understood to have meanings consistent with the meanings in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless defined as herein.
[0077] To facilitate understanding of the embodiments of the present invention, several specific embodiments will be further explained below with reference to the accompanying drawings, and each embodiment does not constitute a limitation on the embodiments of the present invention.
[0078] Example 1
[0079] The processing flow of a pantograph abnormal tilt detection method provided by an embodiment of the present invention is as follows: Figure 1 As shown, the following processing steps are included:
[0080] Step S1, using a pantograph image acquisition device installed on the roof of the train to collect the current pantograph video data from an upward shooting perspective in real time, most of the pixels in the picture are pantographs, and performing a frame-up operation on the video data to obtain the current pantograph image;
[0081] Step S2, determining whether the current pantograph image belongs to the dirty lens category or the normal pantograph category, extracting the pantograph two-dimensional rectangular coordinate frame information of the current pantograph image belonging to the normal pantograph category through the pantograph key area detection module, and continuing the detection;
[0082] Step S3, using the pantograph lower arm pixel segmentation module to perform pixel segmentation on the pantograph lower arm in the current pantograph image according to the pantograph two-dimensional rectangular coordinate frame information of the current pantograph image using the PIDNet algorithm to obtain a lower arm mask image;
[0083] Step S4, extracting four boundary contour line segments of the lower arm of the pantograph by a lower arm boundary slope extraction module, obtaining two boundary lines of the lower arm of the pantograph by parameter restriction according to the four boundary contour line segments, and calculating the slope values of the two boundary lines;
[0084] Step S5, calculating the relative tilt angle of the lower arm of the current pantograph according to the slope values of the two boundary lines of the lower arm of the pantograph, comparing the relative tilt angle of the lower arm of the current pantograph with the set tilt angle threshold, and judging whether the current pantograph has abnormal tilt according to the comparison result;
[0085] Step S6, when the judgment result is tilt, the pantograph is labeled with a tilt label on the current pantograph image using the pantograph two-dimensional rectangular coordinate frame information, so as to achieve accurate detection of abnormal tilt of the pantograph.
[0086] Specifically, the step S2 specifically includes the following steps:
[0087] Step 2.1, use LabelImg software to annotate the category information of the pantograph image at the image level. The specific categories include dirty lens and normal pantograph, and build a pantograph recognition dataset;
[0088] Step 2.2, the YOLOV8 target detection algorithm is trained and verified using the pantograph recognition data set through the pantograph key area detection module to obtain a trained YOLOV8 target detection algorithm. The trained YOLOV8 target detection algorithm is used to determine the category information of the current pantograph image. If the category information of the current pantograph image belongs to the dirty lens category, the subsequent detection is skipped and the algorithm terminates; if the category information of the current pantograph image belongs to the normal pantograph category, the pantograph two-dimensional rectangular coordinate frame information is extracted and saved for subsequent detection.
[0089] Specifically, step S3 specifically includes the following steps:
[0090] Step 3.1, use Labelme software to annotate the content information of the pantograph image at the pixel level, the content information includes the lower arm and the background, and use the content information of all pantograph images to build a pantograph segmentation dataset; Figure 2 The structure diagram of a pantograph provided by an embodiment of the present invention. Figure 2 As shown, the structure of the pantograph is complex and precise, and the lower arm is directly connected to the carbon slide plate, so the service status of the pantograph can be observed more clearly.
[0091] Step 3.2, the pantograph lower arm pixel segmentation module uses the pantograph segmentation data set to train and verify the PIDNet algorithm to obtain a trained PIDNet algorithm. The trained PIDNet algorithm is used to perform pixel segmentation on the lower arm in the current pantograph image to obtain an RGB color lower arm mask image. Figure 3 A mask diagram of a pantograph lower arm provided in an embodiment of the present invention.
[0092] Step 3.3, the RGB color lower arm mask image is converted into a grayscale lower arm mask image through the pantograph lower arm pixel segmentation module. RGB is the color lower arm mask image, Image gray is the gray lower arm mask image;
[0093] Image gray =cv2.cvtColor(Image RGB ,cv2.COLOR_RGB2GRAY)
[0094] Specifically, the step S4 specifically includes the following steps:
[0095] Step 4.1, using the Canny edge detection operator and the Hough line transform algorithm to extract four boundary contour line segments of the lower arm in the grayscale lower arm mask image through the lower arm boundary slope extraction module, where Edges is the edge detection result, and Lines is the four boundary contour line segments; they are the left, right, top and bottom edge contour line segments respectively;
[0096] Edges = cv2.Canny(Image gray ,50,150)
[0097] Lines=cv2.HoughLines(Edges,1,Π / 180)
[0098] Step 4.2, using the lower arm boundary slope extraction module to set the line segment length threshold using the straight line parameter r, and using the line segment length to filter out two longer boundary contour line segments on the left and right sides, and obtain the corresponding key fitting parameter pairs (ρ, θ), where ρ is the polar diameter and θ is the polar angle;
[0099] Lines=cv2.HoughLines(Edges,1,Π / 180,r=130)
[0100] (ρ,θ)=Lines[0]
[0101] Using the straight line parameter r = 130, two relatively long and vertical boundary contour segments were selected, and the corresponding key fitting parameter pairs (ρ, θ) were obtained respectively;
[0102] Lines=cv2.HoughLines(Edges,1,Π / 180,r=130)
[0103] (ρ,θ)=Lines[0]
[0104] Step 4.3, use the key fitting parameters to obtain the coordinates of the two endpoints corresponding to the two boundary contour segments, is the coordinate of the first endpoint of the i-th line segment, is the coordinate of the second endpoint of the i-th line segment, (ρ i ,θ i ) is the parameter pair of the i-th line segment, i = 1, 2;
[0105]
[0106] Step 4.4, using the coordinates of the two end points of the two line segments, calculate the slopes k of the two boundary lines of the lower arm;
[0107]
[0108] Specifically, the step S5 specifically includes the following steps:
[0109] Step 5.1, calculating the angle α of the lower arm in the pantograph image by weighting the slope values of the two boundary lines of the lower arm;
[0110]
[0111] Step 5.2, set the tilt angle threshold δ=3, and calculate the relative tilt angle β of the lower arm angle and the vertical direction of 90 degrees;
[0112] β=|α-90|
[0113] Step 5.3, if the relative tilt angle β is greater than or equal to the set tilt angle threshold δ, it is determined that the pantograph is abnormally tilted; if the relative tilt angle β is less than the set threshold range δ, it is determined that the pantograph is not abnormally tilted.
[0114] Step 6, when the judgment result is tilt, the above coordinate frame information is used to finally mark the pantograph with a tilt label on the image, so as to achieve accurate detection of abnormal tilt of the pantograph and perform alarm processing.
[0115] The pantograph abnormal tilt detection algorithm proposed in the present invention can achieve a detection accuracy of 100% in the pantograph data set, and a detection speed of 66FPS, meeting the needs of real-time and accurate detection.
[0116] Example 2
[0117] The structure of a pantograph abnormal tilt detection device provided in this embodiment is as follows Figure 4 As shown, the following modules are included: a pantograph video data acquisition module 1, a pantograph key area detection module 2, a pantograph lower arm pixel segmentation module 3, a lower arm boundary slope extraction module 4, a pantograph abnormal tilt judgment module 5 and a tilt label marking module 6.
[0118] The pantograph video data acquisition module is used to acquire the current pantograph video data in real time through the pantograph image acquisition device, perform frame extraction operation on the current pantograph video data, and obtain the current pantograph image;
[0119] The pantograph key area detection module is used to determine whether the current pantograph image belongs to the dirty lens category or the clean pantograph category, and extract the pantograph two-dimensional rectangular coordinate frame information of the current pantograph image belonging to the clean pantograph category;
[0120] The pantograph lower arm pixel segmentation module is used to perform pixel segmentation on the pantograph lower arm in the current pantograph image to obtain a lower arm mask image;
[0121] The lower arm boundary slope extraction module is used to extract four boundary contour line segments of the lower arm of the pantograph, obtain two boundary lines of the lower arm of the pantograph based on the four boundary contour line segments using parameter restrictions, and calculate the slope values of the two boundary lines; the pantograph abnormal tilt judgment module is used to calculate the relative tilt angle of the lower arm of the current pantograph based on the slope values of the two boundary lines of the lower arm of the pantograph, compare the relative tilt angle of the lower arm of the current pantograph with the set tilt angle threshold, and judge whether the current pantograph has abnormal tilt according to the comparison result;
[0122] The tilt label marking module is used to mark the pantograph with a tilt label on the current pantograph image using the pantograph two-dimensional rectangular coordinate frame information when the judgment result is tilt, so as to achieve accurate detection of abnormal tilt of the pantograph.
[0123] Preferably, the pantograph key area detection module is used to annotate the category information of the pantograph image at the image level, and the category information includes two categories: dirty lens and clean pantograph, and a pantograph recognition data set is constructed using pantograph images of all categories;
[0124] The real-time target detection algorithm is trained and verified using the pantograph recognition dataset. The trained target detection algorithm is used to determine the category information of the current pantograph image. If the category information of the current pantograph image belongs to the dirty lens category, the algorithm terminates; if the category information of the current pantograph image belongs to the clean pantograph category, the two-dimensional rectangular coordinate frame information of the pantograph is extracted and saved.
[0125] Preferably, the pantograph lower arm pixel segmentation module is used to annotate the content information of the pantograph image at the pixel level, the content information including the lower arm and the background, and construct a pantograph segmentation dataset using the content information of all pantograph images;
[0126] The pantograph segmentation dataset is used to train and verify the fast semantic segmentation algorithm. The trained fast semantic segmentation algorithm is used to perform pixel segmentation on the lower arm in the current pantograph image to obtain an RGB color lower arm mask image; the RGB color lower arm mask image is converted into a grayscale lower arm mask image.
[0127] Preferably, the lower arm boundary slope extraction module is used to extract four boundary contour line segments of the lower arm of the pantograph, obtain two boundary lines of the lower arm of the pantograph according to the four boundary contour line segments by using parameter restrictions, and calculate the slope values of the two boundary lines, including:
[0128] The lower arm boundary slope extraction module uses the edge detection operator and the Hough linear transformation algorithm to extract the four boundary contour line segments of the lower arm in the grayscale lower arm mask image, where Edges is the edge detection result, and Lines is the four boundary contour line segments, which are the left, right, upper and lower edge contour line segments respectively;
[0129] Edges = cv2.Canny(Image gray ,50,150)
[0130] Lines=cv2.HoughLines(Edges,1,Π / 180)
[0131] Using the straight line parameter r = 130, the line segment length threshold is set, and the line segment length is used to filter out two longer boundary contour line segments on the left and right sides, and the corresponding key fitting parameter pairs (ρ, θ) are obtained respectively, where ρ is the polar diameter and θ is the polar angle;
[0132] Lines=cv2.GoughLines(Edges,1,Π / 180,r=130)
[0133] (ρ,θ)=Lines[0]
[0134] Use the key fitting parameters to obtain the coordinates of the two endpoints corresponding to the two boundary contour segments. is the coordinate of the first endpoint of the i-th line segment, is the coordinate of the second endpoint of the i-th line segment, (ρ i ,θ i ) is the parameter pair of the i-th line segment, i = 1, 2;
[0135]
[0136] The slopes k of the two boundary lines of the lower arm are calculated using the coordinates of the two end points of the two line segments;
[0137]
[0138] Preferably, the pantograph abnormal tilt judgment module is used to calculate the angle α of the lower arm in the pantograph image by weighted calculation using the slope values of the two boundary lines of the lower arm;
[0139]
[0140] Set the tilt angle threshold δ=3, and calculate the relative tilt angle β between the angle α of the lower arm and 90 degrees in the vertical direction;
[0141] β=|α-90|
[0142] If the relative tilt angle β is greater than or equal to the set tilt angle threshold δ, it is determined that the pantograph is abnormally tilted; if the relative tilt angle β is less than the set threshold range δ, it is determined that the pantograph is not abnormally tilted.
[0143] The processing procedure for detecting abnormal pantograph tilt using the device of the present invention is the same as and similar to the above method embodiment, and will not be repeated here.
[0144] Example 3
[0145] A non-transitory computer-readable storage medium is used to store computer instructions. When the computer instructions are executed by a processor, the pantograph abnormal tilt detection method as described in Example 1 is implemented.
[0146] A computer program product includes a computer program, which, when running on one or more processors, is used to implement the rail transit tunnel intrusion detection method as described in Example 1.
[0147] An electronic device comprises: a processor, a memory and a computer program; wherein the processor is connected to the memory, the computer program is stored in the memory, and when the electronic device is running, the processor executes the computer program stored in the memory so that the electronic device executes the pantograph abnormal tilt detection method described in Example 1.
[0148] In summary, the method of the embodiment of the present invention extracts the two-dimensional rectangular coordinate frame information of the pantograph through the YOLOV8 target detection algorithm, obtains the RGB color lower arm mask image through the PIDNet algorithm, and uses the Canny edge detection operator and the Hough line transformation algorithm to extract the four boundary contour segments of the lower arm in the grayscale lower arm mask image. It closely combines the method based on deep learning and traditional image processing, reduces the interference of environmental factors on detection, significantly improves the accuracy and speed of pantograph abnormal tilt detection, solves the problems of low pantograph abnormal tilt detection accuracy, slow detection speed and low detection efficiency that are common in traditional methods, and provides strong technical support for real-time monitoring and maintenance of pantograph status.
[0149] Those skilled in the art can understand that the accompanying drawings are only schematic diagrams of an embodiment, and the modules or processes in the accompanying drawings are not necessarily required to implement the present invention.
[0150] It can be known from the description of the above implementation methods that those skilled in the art can clearly understand that the present invention can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present invention or certain parts of the embodiments.
[0151] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The device and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0152] The above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A method for detecting abnormal pantograph tilt, characterized in that: include: The current pantograph video data is collected in real time by a pantograph image acquisition device, and a frame operation is performed on the current pantograph video data to obtain a current pantograph image; Determine whether the current pantograph image belongs to the dirty lens category or the clean pantograph category, and extract the pantograph two-dimensional rectangular coordinate frame information of the current pantograph image belonging to the clean pantograph category through the pantograph key area detection module; The pantograph lower arm pixel segmentation module is used to perform pixel segmentation on the pantograph lower arm in the current pantograph image to obtain a lower arm mask image; The four boundary contour line segments of the lower arm of the pantograph are extracted by the lower arm boundary slope extraction module, and the two boundary lines of the lower arm of the pantograph are obtained according to the four boundary contour line segments by using parameter restrictions, and the slope values of the two boundary lines are calculated; the relative inclination angle of the lower arm of the current pantograph is calculated according to the slope values of the two boundary lines of the lower arm of the pantograph, and the relative inclination angle of the lower arm of the current pantograph is compared with the set inclination angle threshold value, and it is judged whether the current pantograph has abnormal pantograph inclination according to the comparison result; When the judgment result is tilt, the pantograph is marked with a tilt label on the current pantograph image using the pantograph two-dimensional rectangular coordinate frame information.
2. The method according to claim 1, characterized in that: The pantograph key area detection module determines whether the current pantograph image belongs to the dirty lens category or the clean pantograph category, and extracts the pantograph two-dimensional rectangular coordinate frame information of the current pantograph image belonging to the clean pantograph category, including: The category information of the pantograph images is annotated at the image level. The category information includes two categories: dirty pantographs and clean pantographs. The pantograph recognition dataset is constructed using pantograph images of all categories. The real-time target detection algorithm is trained and verified using the pantograph recognition data set through the pantograph key area detection module, and the trained target detection algorithm is used to determine the category information of the current pantograph image. If the category information of the current pantograph image belongs to the dirty lens category, the algorithm terminates; if the category information of the current pantograph image belongs to the clean pantograph category, the two-dimensional rectangular coordinate frame information of the pantograph is extracted and saved.
3. The method according to claim 2, characterized in that The method of performing pixel segmentation on the pantograph lower arm in the current pantograph image by the pantograph lower arm pixel segmentation module to obtain a lower arm mask image includes: Annotate the content information of the pantograph image at the pixel level, which includes the lower arm and the background, and construct a pantograph segmentation dataset using the content information of all pantograph images; The semantic segmentation algorithm is trained and verified by using the pantograph segmentation dataset through the pantograph lower arm pixel segmentation module, and the trained semantic segmentation algorithm is used to perform pixel segmentation on the lower arm in the current pantograph image to obtain an RGB color lower arm mask image; the RGB color lower arm mask image is converted into a grayscale lower arm mask image.
4. The method according to claim 3, characterized in that The method of extracting four boundary contour line segments of the lower arm of the pantograph by the lower arm boundary slope extraction module, obtaining two boundary lines of the lower arm of the pantograph by parameter restriction according to the four boundary contour line segments, and calculating the slope values of the two boundary lines includes: The lower arm boundary slope extraction module uses the edge detection operator and the Hough linear transformation algorithm to extract the four boundary contour line segments of the lower arm in the grayscale lower arm mask image, where Edges is the edge detection result, and Lines is the four boundary contour line segments, which are the left, right, upper and lower edge contour line segments respectively; Edges=cv2.Canny(Image gray ,50,150) Lines=cv2.HoughLines(Edges,1,Π / 180) Using the straight line parameter r = 130, the line segment length threshold is set, and the line segment length is used to filter out two longer boundary contour line segments on the left and right sides, and the corresponding key fitting parameter pairs (ρ, θ) are obtained respectively, where ρ is the polar diameter and θ is the polar angle; Lines=cv2.HoughLines(Edges,1,Π / 180,r=130) (ρ,θ)=Lines[0] Use the key fitting parameters to obtain the coordinates of the two endpoints corresponding to the two boundary contour segments. is the coordinate of the first endpoint of the i-th line segment, is the coordinate of the second endpoint of the i-th line segment, (ρ i ,θ i ) is the parameter pair of the i-th line segment, i = 1, 2; The slopes k of the two boundary lines of the lower arm are calculated using the coordinates of the two end points of the two line segments; 5. The method according to claim 4, characterized in that The method of calculating the relative tilt angle of the lower arm of the current pantograph according to the slope values of the two boundary lines of the lower arm of the pantograph, comparing the relative tilt angle of the lower arm of the current pantograph with a set tilt angle threshold, and judging whether the current pantograph has abnormal tilt according to the comparison result includes: The angle α of the lower arm in the pantograph image is calculated by weighting the slope values of the two boundary lines of the lower arm; Set the tilt angle threshold δ=3, and calculate the relative tilt angle β between the angle α of the lower arm and 90 degrees in the vertical direction; β=|α-90| If the relative tilt angle β is greater than or equal to the set tilt angle threshold δ, it is determined that the pantograph is abnormally tilted; if the relative tilt angle β is less than the set threshold range δ, it is determined that the pantograph is not abnormally tilted.
6. A pantograph abnormal tilt detection device, characterized in that: include: Pantograph video data acquisition module, pantograph key area detection module, pantograph lower arm pixel segmentation module, lower arm boundary slope extraction module, pantograph abnormal tilt judgment module and tilt label marking module; The pantograph video data acquisition module is used to acquire the current pantograph video data in real time through the pantograph image acquisition device, perform frame extraction operation on the current pantograph video data, and obtain the current pantograph image; The pantograph key area detection module is used to determine whether the current pantograph image belongs to the dirty lens category or the clean pantograph category, and extract the pantograph two-dimensional rectangular coordinate frame information of the current pantograph image belonging to the clean pantograph category; The pantograph lower arm pixel segmentation module is used to perform pixel segmentation on the pantograph lower arm in the current pantograph image to obtain a lower arm mask image; The lower arm boundary slope extraction module is used to extract four boundary contour line segments of the lower arm of the pantograph, obtain two boundary lines of the lower arm of the pantograph based on the four boundary contour line segments using parameter restrictions, and calculate the slope values of the two boundary lines; the pantograph abnormal tilt judgment module is used to calculate the relative tilt angle of the lower arm of the current pantograph based on the slope values of the two boundary lines of the lower arm of the pantograph, compare the relative tilt angle of the lower arm of the current pantograph with the set tilt angle threshold, and judge whether the current pantograph has abnormal tilt according to the comparison result; The tilt label marking module is used to mark the pantograph with a tilt label on the current pantograph image using the pantograph two-dimensional rectangular coordinate frame information when the judgment result is tilt.
7. A non-transitory computer-readable storage medium, characterized in that: The non-transitory computer-readable storage medium is used to store computer instructions, and when the computer instructions are executed by the processor, the pantograph abnormal tilt detection method as described in any one of claims 1-5 is implemented.
8. A computer program product, characterized in that It comprises a computer program, which, when running on one or more processors, is used to implement the rail transit tunnel intrusion detection method as described in any one of claims 1-5.
9. An electronic device, characterized in that: include: A processor, a memory and a computer program; wherein the processor is connected to the memory, the computer program is stored in the memory, and when the electronic device is running, the processor executes the computer program stored in the memory so that the electronic device executes the pantograph abnormal tilt detection method as described in any one of claims 1-5.
Citation Information
Patent Citations
Pantograph online detection device and method based on cascaded neural network
CN112132789A
Urban road signal lamp pole inclination fault detection method
CN112686956A
High-speed rail pantograph anomaly detection method
CN113989666A
Pantograph slide plate detection method and device
CN114066895A
Intelligent detection method based on computer vision
CN116309516A
