CN113362330B - Pantograph cavel real-time detection method, device, computer equipment and storage medium - Google Patents

Pantograph cavel real-time detection method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN113362330B
CN113362330B CN202110919528.9A CN202110919528A CN113362330B CN 113362330 B CN113362330 B CN 113362330B CN 202110919528 A CN202110919528 A CN 202110919528A CN 113362330 B CN113362330 B CN 113362330B
Authority
CN
China
Prior art keywords
frame
real
target
value
cavel
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110919528.9A
Other languages
Chinese (zh)
Other versions
CN113362330A (en
Inventor
熊仕勇
董彬
蒋华强
左超华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Changzhou Luhang Railway Transportation Technology Co ltd
Original Assignee
Kunshan High New Track Traffic Intelligent Equipment Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Kunshan High New Track Traffic Intelligent Equipment Co ltd filed Critical Kunshan High New Track Traffic Intelligent Equipment Co ltd
Priority to CN202110919528.9A priority Critical patent/CN113362330B/en
Publication of CN113362330A publication Critical patent/CN113362330A/en
Application granted granted Critical
Publication of CN113362330B publication Critical patent/CN113362330B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0012Biomedical image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning

Abstract

The invention relates to the technical field of rail transit, and discloses a real-time detection method, a device, computer equipment and a storage medium for a pantograph goat horn, which can firstly identify and position a goat horn region of a pantograph goat horn video acquired from a car roof in real time based on a machine vision target detection method, then carry out binarization processing, opening and closing operation processing and contour fitting extraction on an identified goat horn image to obtain a goat horn geometric contour and a real-time value of a goat horn geometric parameter, and finally judge whether the goat horn is qualified in the current state according to the comparison between the real-time value of the goat horn geometric parameter and a design allowable variation range to realize the real-time detection aim of the pantograph goat horn, can simplify a false alarm detection system, facilitate installation and arrangement, reduce the hardware cost, ensure the accuracy of a detection result, reduce the occurrence of alarm conditions and avoid bringing extra rechecking workload to maintainers, the method is particularly suitable for scenes in urban rail transit tunnels.

Description

Pantograph cavel real-time detection method, device, computer equipment and storage medium
Technical Field
The invention belongs to the technical field of rail transit, and particularly relates to a real-time detection method and device for a pantograph goat horn, computer equipment and a storage medium.
Background
In the power failure and outage accidents of the electrified railway system in China, the pantograph-catenary accidents account for 80 percent of the total accidents. The Pantograph-catenary system (english Pantograph-OCS system) is an electric power system composed of a Pantograph and a catenary, and is used for transmitting electric power on the catenary to a train through the Pantograph so as to provide power for driving of a high-speed train. As an important component of the pantograph, the function of the knuckle (i.e. the curved metal on both sides of the pantograph of the power train, the shape of which is similar to that of a natural knuckle, so the knuckle is commonly referred to as a knuckle in the industry) is mainly to ensure that the pantograph smoothly passes through a contact network line fork, so as to prevent the pantograph from entering the contact network line fork to cause a pantograph accident. Therefore, in order to ensure the driving safety of the train, it is necessary to detect the horn of the pantograph.
At present, the detection of the pantograph goat horn mainly comprises a manual detection mode and an automatic detection mode, wherein the detection of the goat horn on a vehicle is mainly carried out by manually climbing the top of the vehicle, and the method has large workload and is relatively complicated; the latter is mainly based on a laser displacement sensor, namely, the profile of the whole pantograph is obtained through laser measurement, and then the abnormality of the goat's horn is obtained through analysis. Although the automatic detection mode can reduce the workload of manpower, the defects of large equipment, complex installation and higher cost exist; meanwhile, the sensor is easily interfered by vibration, sunlight, train speed and the like, so that the conditions of inaccurate detection, false alarm and the like often occur, and extra rechecking work is brought to maintainers. Especially in urban rail transit tunnels, better detection effect cannot be obtained due to poor illumination effect, abrupt change of brightness at the inner and outer junctions of tunnel openings, complex environments in tunnels and laser signal transmitting and receiving ends of sliding plate carbon powder covering sensors and the like.
Disclosure of Invention
In order to solve the problems of huge equipment, complex installation, higher cost and inaccurate detection of the conventional automatic detection mode of the pantograph sheep horn, the invention aims to provide a real-time detection method, a real-time detection device, computer equipment and a storage medium of the pantograph sheep horn, which can simplify a detection system, facilitate installation and arrangement and reduce hardware cost compared with the conventional automatic detection mode, can simultaneously prevent a detection result from being interfered by an external environment, ensure the accuracy of the detection result, reduce the occurrence of false alarm conditions, avoid bringing extra rechecking workload to maintainers, and are particularly suitable for scenes in urban rail transit tunnels.
In a first aspect, the present invention provides a real-time detection method for a pantograph goat's horn, including:
acquiring a video acquired by a monitoring camera in real time, wherein the monitoring camera is arranged on the roof of the vehicle and enables the camera view to cover the area where the pantograph is located;
carrying out histogram equalization processing on the latest image in the video to obtain a sample image to be detected;
importing the sample image to be tested into a trained target detection model, and identifying the position of the goat's horn of the pantograph in the area of the sample image to be tested;
intercepting a goat horn image from the sample image to be detected according to the position of the area;
carrying out binarization processing on the cavel image to obtain a binarized image;
carrying out opening and closing operation processing on the binary image to obtain a new cavel image;
fitting to obtain a real-time geometric outline of the goat horn according to the new goat horn image;
acquiring a real-time value of a goat horn geometric parameter according to the real-time geometric contour, wherein the goat horn geometric parameter comprises goat horn width, goat horn height and/or goat horn area;
and judging whether the goat horn is qualified in the current state according to the comparison result of the real-time value of the goat horn geometric parameter and the design allowable variation range.
Based on the content of the invention, the method can firstly identify and position the cavel area based on the pantograph cavel video acquired by the machine vision target detection method in real time, then carry out binarization processing, opening and closing operation processing and contour fitting extraction on the cavel image obtained by identification to obtain the cavel geometric contour and the real-time value of the cavel geometric parameter, and finally judge whether the cavel is qualified in the current state according to the comparison between the real-time value of the cavel geometric parameter and the allowable variation range of the design, so as to realize the real-time detection aim of the pantograph cavel. The method reduces the occurrence of false alarm, avoids bringing extra rechecking workload to maintainers, and is particularly suitable for scenes in urban rail transit tunnels. In addition, as the geometrical parameters of the cavel can be accurately measured, compared with the existing automatic detection mode, the detection precision is greatly improved; and the source monitoring video (namely the video) can be directly checked while the detection is carried out, so that the detection result can be conveniently rechecked.
In one possible design, before the introducing the sample image to be tested into the trained target detection model, the method further includes:
acquiring a pantograph monitoring video historically acquired by the monitoring camera in one trip;
respectively carrying out histogram equalization processing on each frame of image in the pantograph monitoring video to obtain a plurality of training sample images;
acquiring horn region labeling data corresponding to each training sample image in the plurality of training sample images one to one;
and importing the training sample image and the cavel region labeling data corresponding to the training sample image into the target detection model for training to obtain the trained target detection model.
In one possible design, importing the training sample image and the cavel region labeling data corresponding to the training sample image into the target detection model for training to obtain the trained target detection model, including:
importing the training sample image and the cavel region labeling data corresponding to the training sample image into a YOLO-v4 target detection model, and executing the following training steps in the YOLO-v4 target detection model:
adjusting the training sample image to have a target size and is divided into
Figure 166564DEST_PATH_IMAGE001
A square image of a grid, wherein,
Figure 604629DEST_PATH_IMAGE002
a natural number not less than 5;
judging whether the target center falls on the target center
Figure 932843DEST_PATH_IMAGE003
In a certain grid of the grids, wherein the target center is a center of a horn area of the pantograph;
if so, the grid is responsible for predicting a plurality of target frames and calculating to obtain the predicted value of each target frame in the target frames on frame parameters, wherein the frame parameters comprise a frame center horizontal coordinate, a frame center vertical coordinate, a frame width, a frame height, a frame type and a confidence coefficient corresponding to the frame type;
and performing iterative optimization of a loss function according to the predicted value and the cavel region labeling data to obtain a detection model which is finished with target training.
In one possible design, performing iterative optimization of a loss function according to the predicted value and the cavel region labeling data to obtain a detection model with completed target training, including:
extracting a real value of a real frame on the frame parameter according to the cavel region labeling data, wherein the real frame comprises a cavel labeling frame in the square image;
calculating the frame position loss value according to the following formula according to the predicted value and the real value
Figure 807258DEST_PATH_IMAGE004
Figure 246329DEST_PATH_IMAGE005
In the formula (I), the compound is shown in the specification,
Figure 522590DEST_PATH_IMAGE006
the frame of the target is represented by a frame,
Figure 270972DEST_PATH_IMAGE007
representing the real border of the frame,
Figure 898262DEST_PATH_IMAGE008
representing the intersection ratio of the target bounding box and the real bounding box,
Figure 141025DEST_PATH_IMAGE009
representing a Euclidean distance between a center of the target bounding box and a center of the real bounding box,
Figure 271792DEST_PATH_IMAGE010
representing a diagonal length of a minimum bounding box that bounds the target bounding box and the real bounding box,
Figure 692540DEST_PATH_IMAGE011
it is indicated that the intermediate quantities are calculated,
Figure 338285DEST_PATH_IMAGE012
representing the real value of the bounding box width among the real values,
Figure 650318DEST_PATH_IMAGE013
representing the real values of the bounding box heights among the real values,
Figure 147508DEST_PATH_IMAGE014
representing a bounding box width prediction value of the prediction values,
Figure 254005DEST_PATH_IMAGE015
representing a bounding box height prediction value of the prediction values,
Figure 121466DEST_PATH_IMAGE016
representing the circumferential ratio;
calculating a frame confidence coefficient loss value according to the predicted value and the true value and the following formula
Figure 456764DEST_PATH_IMAGE017
Figure 827702DEST_PATH_IMAGE018
In the formula (I), the compound is shown in the specification,
Figure 839521DEST_PATH_IMAGE019
which represents a pre-set weight parameter that is,
Figure 928700DEST_PATH_IMAGE020
respectively represent a positive integer, and each represents a positive integer,
Figure 300644DEST_PATH_IMAGE021
representing a total number of bounding boxes of the plurality of target bounding boxes,
Figure 526089DEST_PATH_IMAGE022
is shown with
Figure 239967DEST_PATH_IMAGE024
Corresponding to each grid
Figure 301595DEST_PATH_IMAGE025
Whether the logic value of the cavel is predicted by each target frame or not is judged, if yes, the value is 1, and if not, the value is 0,
Figure 227963DEST_PATH_IMAGE026
represents the first
Figure 573493DEST_PATH_IMAGE027
Each target frame contains the probability score of the goat's horn,
Figure 192694DEST_PATH_IMAGE028
represents the first
Figure 508662DEST_PATH_IMAGE027
Each target frame comprises a probability score predicted value of the goat horn;
calculating a class prediction loss value according to the following formula according to the predicted value and the true value
Figure 238720DEST_PATH_IMAGE029
Figure 438758DEST_PATH_IMAGE030
In the formula (I), the compound is shown in the specification,
Figure 714012DEST_PATH_IMAGE031
respectively represent a positive integer, and each represents a positive integer,
Figure 999500DEST_PATH_IMAGE032
representing a total number of bounding boxes of the plurality of target bounding boxes,
Figure 267670DEST_PATH_IMAGE033
is shown with
Figure 587793DEST_PATH_IMAGE034
Corresponding to each grid
Figure 798064DEST_PATH_IMAGE027
Whether the target frame is responsible for predicting the logic value of the cavel or not is judged, if yes, the value is 1, and if not, the value is 0,
Figure 570848DEST_PATH_IMAGE035
a frame class is represented that is a frame class,
Figure 111550DEST_PATH_IMAGE036
a set of bounding box categories is represented,
Figure 286180DEST_PATH_IMAGE037
is represented by the second
Figure 903237DEST_PATH_IMAGE027
The actual code value of the frame class corresponding to the target frame,
Figure 163317DEST_PATH_IMAGE038
is represented by the second
Figure 773290DEST_PATH_IMAGE027
A target frame pairA predictive coding value of a corresponding frame type;
losing the frame position value
Figure 802426DEST_PATH_IMAGE039
The frame confidence loss value
Figure 839652DEST_PATH_IMAGE040
And the class prediction loss value
Figure 591224DEST_PATH_IMAGE041
The sum is used as a loss function calculation result so as to carry out iterative optimization of the loss function and obtain the detection model.
In one possible design, the opening and closing operation processing is performed on the binarized image to obtain a new cavel image, and the method includes:
the open operation processing is performed according to the following formula:
Figure 4888DEST_PATH_IMAGE042
in the formula (I), the compound is shown in the specification,
Figure 622951DEST_PATH_IMAGE043
representing a new cavel image obtained after the opening operation processing,
Figure 96658DEST_PATH_IMAGE044
representing the binarized image before the on operation processing,
Figure 800172DEST_PATH_IMAGE045
the structural elements of the on-operation are represented,
Figure 502680DEST_PATH_IMAGE046
it is shown that the etching treatment is performed,
Figure 506408DEST_PATH_IMAGE047
showing the expansion treatment;
and/or performing closed operation processing according to the following formula:
Figure 885436DEST_PATH_IMAGE048
in the formula (I), the compound is shown in the specification,
Figure 341826DEST_PATH_IMAGE049
representing a new cavel image obtained after the closed operation processing,
Figure 831713DEST_PATH_IMAGE050
representing the binarized image before the closed arithmetic operation processing,
Figure 673636DEST_PATH_IMAGE051
the structural elements of the closed-loop operation are represented,
Figure 489145DEST_PATH_IMAGE052
it is shown that the etching treatment is performed,
Figure 698409DEST_PATH_IMAGE053
showing the expansion process.
In one possible design, after determining whether the cavel is qualified in the current state according to the comparison result between the real-time value of the cavel geometric parameter and the design allowable variation range, the method further includes:
and if the cavel is judged to be unqualified in the current state, calculating the difference between the real-time value of the geometrical parameters of the cavel and the boundary value of the design allowable variation range, and outputting warning information containing the difference.
In one possible design, the target detection model employs a Faster R-CNN target detection model, an SSD target detection module, or a YOLO target detection model.
The invention provides a real-time detection device for a pantograph goat horn, which comprises a video acquisition module, a equalization processing module, a goat horn area identification module, a goat horn image interception module, a binarization processing module, an opening and closing operation processing module, a goat horn contour fitting module, a goat horn parameter acquisition module and a goat horn qualification judgment module which are sequentially in communication connection;
the video acquisition module is used for acquiring videos acquired by the monitoring camera in real time, wherein the monitoring camera is installed on the roof of the vehicle and enables the camera view to cover the area where the pantograph is located;
the equalization processing module is used for carrying out histogram equalization processing on the latest image in the video to obtain a sample image to be detected;
the cavel region identification module is used for guiding the sample image to be detected into the trained target detection model and identifying the region position of the cavel of the pantograph in the sample image to be detected;
the goat horn image intercepting module is used for intercepting a goat horn image from the sample image to be detected according to the position of the area;
the binarization processing module is used for carrying out binarization processing on the cavel image to obtain a binarization image;
the switching operation processing module is used for carrying out switching operation processing on the binary image to obtain a new cavel image;
the cavel contour fitting module is used for fitting to obtain a real-time geometric contour of the cavel according to the new cavel image;
the cavel parameter acquiring module is used for acquiring a real-time value of a cavel geometric parameter according to the real-time geometric contour, wherein the cavel geometric parameter comprises cavel width, cavel height and/or cavel area;
and the horn qualification judging module is used for judging whether the horn is qualified in the current state according to the comparison result of the real-time value of the geometric parameters of the horn and the design allowable variation range.
In a third aspect, the present invention provides a computer device, comprising a memory, a processor and a transceiver, which are sequentially connected in communication, wherein the memory is used for storing a computer program, the transceiver is used for transceiving data, and the processor is used for reading the computer program and executing the method according to the first aspect or any one of the possible designs of the first aspect.
In a fourth aspect, the present invention provides a storage medium having stored thereon instructions for carrying out the method according to the first aspect or any one of the possible designs of the first aspect, when the instructions are run on a computer.
In a fifth aspect, the present invention provides a computer program product comprising instructions which, when run on a computer, cause the computer to perform the method as described above in the first aspect or any one of the possible designs of the first aspect.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flow chart of the real-time detection method for the toe of a pantograph provided by the invention.
Fig. 2 is an exemplary diagram of a video captured by a monitoring camera according to the present invention.
Fig. 3 is an exemplary diagram of a clipped cavel image provided by the present invention.
FIG. 4 is an exemplary graph of a goat's horn profile from a new goat's horn image fitting provided by the present invention.
Fig. 5 is a schematic structural diagram of the real-time detection device for the toe of a pantograph according to the present invention.
Fig. 6 is a schematic structural diagram of a computer device provided by the present invention.
Detailed Description
The invention is further described with reference to the following figures and specific embodiments. It should be noted that the description of the embodiments is provided to help understanding of the present invention, but the present invention is not limited thereto. Specific structural and functional details disclosed herein are merely representative of exemplary embodiments of the invention. This invention may, however, be embodied in many alternate forms and should not be construed as limited to the embodiments set forth herein.
It will be understood that, although the terms first, second, etc. may be used herein to describe various objects, these objects should not be limited by these terms. These terms are only used to distinguish one object from another. For example, a first object may be referred to as a second object, and similarly, a second object may be referred to as a first object, without departing from the scope of example embodiments of the present invention.
It should be understood that, for the term "and/or" as may appear herein, it is merely an associative relationship that describes an associated object, meaning that three relationships may exist, e.g., a and/or B may mean: a exists alone, B exists alone or A and B exist at the same time; for the term "/and" as may appear herein, which describes another associative object relationship, it means that two relationships may exist, e.g., a/and B, may mean: a exists singly or A and B exist simultaneously; in addition, for the character "/" that may appear herein, it generally means that the former and latter associated objects are in an "or" relationship.
As shown in fig. 1 to 4, the real-time detection method for a pantograph claw according to the first aspect of the present embodiment may be, but is not limited to being, executed by a computer device disposed in an interior cabinet of a vehicle and communicatively connected to a roof monitoring camera. The real-time detection method for the pantograph sheep horn can include, but is not limited to, the following steps S1 to S9.
S1, acquiring a video acquired by a monitoring camera in real time, wherein the monitoring camera is installed on the roof of the vehicle and enables the camera view to cover the area where the pantograph is located.
In step S1, since the camera view covers the area where the pantograph is located, a complete pantograph picture can be obtained in the obtained video, as shown in fig. 2. In addition, the computer equipment is in communication connection with the monitoring camera, so that the video can be transmitted in real time after being collected.
And S2, carrying out histogram equalization processing on the latest image in the video to obtain a sample image to be detected.
In step S2, the histogram equalization processing is a conventional Image preprocessing method, which is a method for enhancing Image Contrast (Image Contrast), and the main idea is to change the histogram distribution of one Image into an approximately uniform distribution, so as to enhance the Contrast of the Image.
And S3, importing the sample image to be detected into the trained target detection model, and identifying the area position of the horn of the pantograph in the sample image to be detected.
In the step S3, the target detection model is an existing artificial intelligence recognition model for recognizing objects in the picture and marking the positions of the objects, and specifically, but not limited to, the target detection algorithm proposed in 2015 by using fast R-CNN (fast Regions with conditional Neural Networks, by which he kamin et al, which obtains multiple first target detection models in the ILSVRV and COCO contest in 2015, SSD (Single Shot multiple box Detector, which is one of the currently popular main detection frames proposed by Wei Liu) target detection module or YOLO (youonly lok, which has been recently developed to V4 version, has wide application in the industry, which is based on the principle that firstly, 2 frames are predicted for each 7x7 grid for the input image, and then removing the target window with low possibility according to the threshold, and finally removing the redundant window by using a frame combination mode to obtain a detection result) and the like. Therefore, after the identification training of the target detection model on the goat horn image is completed, the goat horn can be identified in the sample image to be detected, and the goat horn position is marked.
Before the step S3, in order to complete the training of the target detection model, the method further includes, but is not limited to, the following steps S21 to S24.
And S21, acquiring a pantograph monitoring video historically acquired by the monitoring camera in one trip.
In the step S21, since the pantograph monitoring video is historically acquired in one trip, it can be ensured that the cavel images in the subsequent training sample images are non-static, and better meet the real-time detection condition, and the real-time detection accuracy of the target detection model obtained by training is ensured.
And S22, respectively carrying out histogram equalization processing on each frame of image in the pantograph monitoring video to obtain a plurality of training sample images.
And S23, acquiring the horn area labeling data which correspond to the training sample images in the plurality of training sample images one by one.
In the step S23, the cavel region labeling data is obtained by manual labeling.
And S24, importing the training sample image and the cavel region labeling data corresponding to the training sample image into the target detection model for training to obtain the trained target detection model.
In the step S24, the training sample image and the cavel region labeling data corresponding to the training sample image are imported into a YOLO-V4 target detection model (i.e., a V4 version of the YOLO target detection model, which includes an Input layer Input, a BackBone layer back bone, a Neck layer tack, and a Prediction layer Prediction, and finally a target detection result is output by the Prediction layer Prediction, which includes a detection target position and a confidence coefficient, where the detection target position is a coordinate region of a detection target in the whole image, and the confidence coefficient is an accuracy of the detection target), and the following training steps S241 to S244 are performed in the YOLO-V4 target detection model.
S241, adjusting the training sample image to have a target size and be divided into
Figure 8299DEST_PATH_IMAGE054
A square image of a grid, wherein,
Figure 721040DEST_PATH_IMAGE055
a natural number not less than 5 is represented.
In step S241, the adjustment of the image and the division of the mesh are both conventional manners in the YOLO target detection model. In addition to this, the present invention is,
Figure 176292DEST_PATH_IMAGE055
the value of (d) may be, for example, 7.
S242, judging whether the target center falls on the target center
Figure 607274DEST_PATH_IMAGE054
In a certain grid of the grids, wherein the target center is a center of a horn area of the pantograph.
In step S242, the specific determination manner is a conventional manner in the YOLO target detection model.
And S243, if yes, the grid is responsible for predicting a plurality of target frames and calculating the predicted value of each target frame in the target frames on frame parameters, wherein the frame parameters include, but are not limited to, frame center horizontal coordinates, frame center vertical coordinates, frame width, frame height, frame type, confidence degrees corresponding to the frame type and the like.
In the step S243, the prediction of the target frames and the calculation of the predicted values are both conventional in the YOLO target detection model.
And S244, performing iterative optimization of a loss function according to the predicted value and the cavel region labeling data to obtain a detection model which is finished with target training.
In said step S244, the iteration of the loss function is optimized in a conventional manner in the YOLO target detection model. More specifically, the method includes, but is not limited to, the following steps S2441 to S2445.
S2441, extracting a real value of a real frame on the frame parameter according to the cavel region labeling data, wherein the real frame comprises a cavel labeling frame in the square image.
S2442. according to the predicted value and the truthValue, calculating the frame position loss value according to the following formula
Figure 704543DEST_PATH_IMAGE039
Figure 523987DEST_PATH_IMAGE056
In the formula (I), the compound is shown in the specification,
Figure 415720DEST_PATH_IMAGE057
the frame of the target is represented by a frame,
Figure 333998DEST_PATH_IMAGE058
representing the real border of the frame,
Figure 500537DEST_PATH_IMAGE059
representing the intersection ratio of the target bounding box and the real bounding box,
Figure 938602DEST_PATH_IMAGE060
representing a Euclidean distance between a center of the target bounding box and a center of the real bounding box,
Figure 266816DEST_PATH_IMAGE061
representing a diagonal length of a minimum bounding box that bounds the target bounding box and the real bounding box,
Figure 406810DEST_PATH_IMAGE062
it is indicated that the intermediate quantities are calculated,
Figure 360728DEST_PATH_IMAGE063
representing the real value of the bounding box width among the real values,
Figure 636989DEST_PATH_IMAGE064
representing the real values of the bounding box heights among the real values,
Figure 401682DEST_PATH_IMAGE065
represents the aboveA frame width prediction value among the prediction values,
Figure 28973DEST_PATH_IMAGE066
representing a bounding box height prediction value of the prediction values,
Figure 22468DEST_PATH_IMAGE067
indicating the circumferential ratio.
S2443, calculating a frame confidence coefficient loss value according to the predicted value and the true value and the following formula
Figure 153235DEST_PATH_IMAGE068
Figure 823251DEST_PATH_IMAGE069
In the formula (I), the compound is shown in the specification,
Figure 937837DEST_PATH_IMAGE070
which represents a pre-set weight parameter that is,
Figure 718711DEST_PATH_IMAGE031
respectively represent a positive integer, and each represents a positive integer,
Figure 481481DEST_PATH_IMAGE032
representing a total number of bounding boxes of the plurality of target bounding boxes,
Figure 56819DEST_PATH_IMAGE033
is shown with
Figure 658702DEST_PATH_IMAGE071
Corresponding to each grid
Figure 243267DEST_PATH_IMAGE072
Whether the target frame is responsible for predicting the logic value of the cavel or not is judged, if yes, the value is 1, and if not, the value is 0,
Figure 364938DEST_PATH_IMAGE073
represents the first
Figure 376756DEST_PATH_IMAGE072
Each target frame contains the probability score of the goat's horn,
Figure 200356DEST_PATH_IMAGE074
represents the first
Figure 588612DEST_PATH_IMAGE072
Each target frame contains the probability score prediction value of the goat horn.
S2444, calculating a category prediction loss value according to the following formula according to the predicted value and the true value
Figure 328903DEST_PATH_IMAGE075
Figure 511623DEST_PATH_IMAGE076
In the formula (I), the compound is shown in the specification,
Figure 88098DEST_PATH_IMAGE077
respectively represent a positive integer, and each represents a positive integer,
Figure 748886DEST_PATH_IMAGE032
representing a total number of bounding boxes of the plurality of target bounding boxes,
Figure 579570DEST_PATH_IMAGE078
is shown with
Figure 198770DEST_PATH_IMAGE079
Corresponding to each grid
Figure 731383DEST_PATH_IMAGE027
Whether the target frame is responsible for predicting the logic value of the cavel or not is judged, if yes, the value is 1, and if not, the value is 0,
Figure 461442DEST_PATH_IMAGE080
a frame class is represented that is a frame class,
Figure 130320DEST_PATH_IMAGE081
a set of bounding box categories is represented,
Figure 438198DEST_PATH_IMAGE082
is represented by the second
Figure 723686DEST_PATH_IMAGE027
The actual code value of the frame class corresponding to the target frame,
Figure 726277DEST_PATH_IMAGE083
is represented by the second
Figure 780821DEST_PATH_IMAGE027
And the predicted coding value of the frame class corresponding to each target frame.
S2445, calculating the frame position loss value
Figure 476244DEST_PATH_IMAGE039
The frame confidence loss value
Figure 734181DEST_PATH_IMAGE084
And the class prediction loss value
Figure 806043DEST_PATH_IMAGE085
The sum is used as a loss function calculation result so as to carry out iterative optimization of the loss function and obtain the trained target detection model.
The method for training the target detection model described in the foregoing steps S21-S24 may be executed on the computer device, or may be executed on another computer device, and then the trained target detection model is deployed on the computer device, so as to smoothly execute the step S3.
And S4, intercepting the image of the goat horn from the image of the sample to be detected according to the position of the area.
In step S4, since the cavel is identified in the sample image to be tested by the trained target detection model and the cavel position is marked, the cavel image can be easily obtained by clipping, as shown in fig. 3.
And S5, carrying out binarization processing on the cavel image to obtain a binarization image.
In step S5, the binarization processing is a conventional image preprocessing manner, that is, the gray scale value of the pixel points on the image is set to 0 (black) or 255 (white), specifically, the pixel value smaller than 127 is set to 0, and the pixel value greater than or equal to 127 is set to 255, that is, the whole image exhibits a distinct black-and-white effect.
And S6, carrying out opening and closing operation processing on the binary image to obtain a new cavel image.
In step S6, the open/close operation processing includes, but is not limited to, the following modes (a) and/or (B).
(A) The open operation processing is performed according to the following formula:
Figure 715093DEST_PATH_IMAGE086
in the formula (I), the compound is shown in the specification,
Figure 581418DEST_PATH_IMAGE087
representing a new cavel image obtained after the opening operation processing,
Figure 90765DEST_PATH_IMAGE088
representing the binarized image before the on operation processing,
Figure 700738DEST_PATH_IMAGE089
the structural elements of the on-operation are represented,
Figure 729874DEST_PATH_IMAGE052
it is shown that the etching treatment is performed,
Figure 32679DEST_PATH_IMAGE090
showing the expansion process.
(B) And performing closed operation processing according to the following formula:
Figure 530788DEST_PATH_IMAGE091
in the formula (I), the compound is shown in the specification,
Figure 210031DEST_PATH_IMAGE092
representing a new cavel image obtained after the closed operation processing,
Figure 93673DEST_PATH_IMAGE093
representing the binarized image before the closed arithmetic operation processing,
Figure 813718DEST_PATH_IMAGE094
the structural elements of the closed-loop operation are represented,
Figure 782811DEST_PATH_IMAGE052
it is shown that the etching treatment is performed,
Figure 469007DEST_PATH_IMAGE090
showing the expansion process.
And S7, fitting to obtain a real-time geometric outline of the goat horn according to the new goat horn image.
In step S7, since the cavel image is sequentially subjected to binarization processing and opening and closing operation processing, the cavel contour can be obviously represented in the new cavel image, and the real-time geometric contour of the cavel can be accurately obtained by fitting, as shown in fig. 4.
And S8, acquiring a real-time value of the geometrical parameters of the goat horn according to the real-time geometrical outline, wherein the geometrical parameters of the goat horn include but are not limited to goat horn width, goat horn height and/or goat horn area.
In step S8, as shown in fig. 4, since the real-time geometric profile of the cavel has been obtained, the real-time values of the cavel geometric parameters can be obtained based on conventional geometric knowledge.
And S9, judging whether the goat horn is qualified in the current state according to the comparison result of the real-time value of the geometrical parameter of the goat horn and the design allowable variation range.
In the step S9, the allowable design variation range is the design parameter of the cavel, and if the real-time value is within the allowable design variation range, it may be determined that the cavel is qualified in the current state and meets the design requirement, otherwise, it is determined that the cavel is not qualified in the current state, so as to achieve the purpose of real-time detection of the pantograph cavel. In addition, after judging whether the cavel is qualified in the current state according to the comparison result of the real-time value of the cavel geometric parameter and the design allowable variation range, the method may further include: and if the cavel is judged to be unqualified in the current state, calculating the difference between the real-time value of the geometrical parameters of the cavel and the boundary value of the design allowable variation range, and outputting warning information containing the difference. Therefore, the loss amount of the goat horn can be output, early warning is carried out, bow net accidents are avoided, and the running safety of the train is improved.
Therefore, through the real-time detection scheme of the pantograph sheep horn described in detail in the foregoing steps S1 to S9, the real-time detection scheme of the pantograph sheep horn can be firstly based on the machine vision target detection method to identify and position the sheep horn region of the pantograph sheep horn video acquired in real time from the roof, then the binarization processing, the opening and closing operation processing and the contour fitting extraction are performed on the sheep horn image obtained by identification, so as to obtain the geometrical contour of the pantograph horn and the real-time value of the geometrical parameter of the pantograph horn, and finally the real-time value of the geometrical parameter of the pantograph horn is compared with the allowable variation range of design to judge whether the pantograph horn is qualified in the current state, so as to achieve the real-time detection purpose of the pantograph sheep horn, compared with the existing automatic detection scheme, because only a roof camera and in-vehicle computer equipment are required to be configured, the detection system can be simplified, the installation and the hardware cost can be reduced, and the detection result can be prevented from being interfered by the external environment, the accuracy of the detection result is guaranteed, the occurrence of false alarm is reduced, extra rechecking workload brought to maintainers is avoided, and the method is particularly suitable for scenes in urban rail transit tunnels. In addition, as the geometrical parameters of the cavel can be accurately measured, compared with the existing automatic detection mode, the detection precision is greatly improved; and because the horn missing condition can be output and early-warning can be carried out when disqualification is found, the bow net accident can be avoided, and the running safety of the train is improved; and the source monitoring video (namely the video) can be directly checked while the detection is carried out, so that the detection result can be conveniently rechecked.
As shown in fig. 5, a second aspect of this embodiment provides a virtual device for implementing the real-time detection method of a pantograph goat's horn as possible in any one of the first aspect or the first aspect, including a video acquisition module, an equalization processing module, a goat's horn region identification module, a goat's horn image capture module, a binarization processing module, an on-off operation processing module, a goat's horn contour fitting module, a goat's horn parameter acquisition module, and a goat's horn qualification determination module, which are sequentially connected in a communication manner;
the video acquisition module is used for acquiring videos acquired by the monitoring camera in real time, wherein the monitoring camera is installed on the roof of the vehicle and enables the camera view to cover the area where the pantograph is located;
the equalization processing module is used for carrying out histogram equalization processing on the latest image in the video to obtain a sample image to be detected;
the cavel region identification module is used for guiding the sample image to be detected into the trained target detection model and identifying the region position of the cavel of the pantograph in the sample image to be detected;
the goat horn image intercepting module is used for intercepting a goat horn image from the sample image to be detected according to the position of the area;
the binarization processing module is used for carrying out binarization processing on the cavel image to obtain a binarization image;
the switching operation processing module is used for carrying out switching operation processing on the binary image to obtain a new cavel image;
the cavel contour fitting module is used for fitting to obtain a real-time geometric contour of the cavel according to the new cavel image;
the cavel parameter acquiring module is used for acquiring a real-time value of a cavel geometric parameter according to the real-time geometric contour, wherein the cavel geometric parameter comprises cavel width, cavel height and/or cavel area;
and the horn qualification judging module is used for judging whether the horn is qualified in the current state according to the comparison result of the real-time value of the geometric parameters of the horn and the design allowable variation range.
For the working process, working details and technical effects of the foregoing apparatus provided in the second aspect of this embodiment, reference may be made to the method described in the first aspect or any one of the possible designs of the first aspect, which is not described herein again.
As shown in fig. 6, a third aspect of this embodiment provides a computer device for executing the real-time detection method of a pantograph sheep corner as may be designed in any one of the first aspect or the first aspect, including a memory, a processor and a transceiver, which are sequentially and communicatively connected, where the memory is used for storing a computer program, the transceiver is used for transceiving data, and the processor is used for reading the computer program and executing the real-time detection method of a pantograph sheep corner as may be designed in any one of the first aspect or the first aspect. For example, the Memory may include, but is not limited to, a Random-Access Memory (RAM), a Read-Only Memory (ROM), a Flash Memory (Flash Memory), a First-in First-out (FIFO), and/or a First-in Last-out (FILO), and the like; the processor may be, but is not limited to, a microprocessor of the model number STM32F105 family. In addition, the computer device may also include, but is not limited to, a power module, a display screen, and other necessary components.
For the working process, working details, and technical effects of the foregoing computer device provided in the third aspect of this embodiment, reference may be made to the method in the first aspect or any one of the possible designs in the first aspect, which is not described herein again.
A fourth aspect of the present embodiment provides a storage medium storing instructions including any one of the first aspect or any one of the first aspect possible designs of the real-time detection method for a pantograph sheep corner, that is, the storage medium stores instructions that, when executed on a computer, perform the real-time detection method for a pantograph sheep corner as described in any one of the first aspect or any one of the first aspect possible designs. The storage medium refers to a carrier for storing data, and may include, but is not limited to, a computer-readable storage medium such as a floppy disk, an optical disk, a hard disk, a flash Memory, a flash disk and/or a Memory Stick (Memory Stick), and the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
For the working process, the working details and the technical effects of the foregoing readable storage medium provided in the fourth aspect of this embodiment, reference may be made to the method in the first aspect or any one of the possible designs in the first aspect, which is not described herein again.
A fifth aspect of the present embodiment provides a computer program product containing instructions for causing a computer to execute the real-time detection method of the cavum pantograph as described in the first aspect or any one of the possible designs of the first aspect when the instructions are run on the computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable devices.
Finally, it should be noted that the present invention is not limited to the above alternative embodiments, and that various other forms of products can be obtained by anyone in light of the present invention. The above detailed description should not be taken as limiting the scope of the invention, which is defined in the claims, and which the description is intended to be interpreted accordingly.

Claims (6)

1. A real-time detection method for a pantograph goat's horn is characterized by comprising the following steps:
acquiring a video acquired by a monitoring camera in real time, wherein the monitoring camera is arranged on the roof of the vehicle and enables the camera view to cover the area where the pantograph is located;
carrying out histogram equalization processing on the latest image in the video to obtain a sample image to be detected;
importing the sample image to be tested into a trained target detection model, and identifying the position of the goat's horn of the pantograph in the area of the sample image to be tested;
intercepting a goat horn image from the sample image to be detected according to the position of the area;
carrying out binarization processing on the cavel image to obtain a binarized image;
carrying out opening and closing operation processing on the binary image to obtain a new cavel image;
fitting to obtain a real-time geometric outline of the goat horn according to the new goat horn image;
acquiring a real-time value of a goat horn geometric parameter according to the real-time geometric contour, wherein the goat horn geometric parameter comprises goat horn width, goat horn height and/or goat horn area;
judging whether the goat horn is qualified in the current state according to the comparison result of the real-time value of the goat horn geometric parameter and the design allowable variation range;
before the sample image to be tested is imported into the trained target detection model, the method further comprises the following steps: acquiring a pantograph monitoring video historically acquired by the monitoring camera in one trip; respectively carrying out histogram equalization processing on each frame of image in the pantograph monitoring video to obtain a plurality of training sample images; acquiring horn region labeling data corresponding to each training sample image in the plurality of training sample images one to one; importing the training sample image and the cavel region labeling data corresponding to the training sample image into the target detection model for training to obtain the trained target detection model;
importing the training sample image and the cavel region labeling data corresponding to the training sample image into the target detection model for training to obtain the trained target detection model, including: will be described inImporting training sample images and the cavel region labeling data corresponding to the training sample images into a YOLO-v4 target detection model, and executing the following training steps in the YOLO-v4 target detection model: adjusting the training sample image to have a target size and is divided into
Figure 965291DEST_PATH_IMAGE001
A square image of a grid, wherein,
Figure 683104DEST_PATH_IMAGE002
a natural number not less than 5; judging whether the target center falls on the target center
Figure 207626DEST_PATH_IMAGE001
In a certain grid of the grids, wherein the target center is a center of a horn area of the pantograph; if so, the grid is responsible for predicting a plurality of target frames and calculating to obtain the predicted value of each target frame in the target frames on frame parameters, wherein the frame parameters comprise a frame center horizontal coordinate, a frame center vertical coordinate, a frame width, a frame height, a frame type and a confidence coefficient corresponding to the frame type; performing iterative optimization of a loss function according to the predicted value and the cavel region labeling data to obtain a detection model which is finished with target training;
according to the predicted value and the cavel region labeling data, iterative optimization of a loss function is carried out to obtain a detection model which is trained by a target, and the method comprises the following steps: extracting a real value of a real frame on the frame parameter according to the cavel region labeling data, wherein the real frame comprises a cavel labeling frame in the square image; calculating the frame position loss value according to the following formula according to the predicted value and the real value
Figure 227535DEST_PATH_IMAGE003
Figure 43175DEST_PATH_IMAGE004
In the formula (I), the compound is shown in the specification,
Figure 363298DEST_PATH_IMAGE005
the frame of the target is represented by a frame,
Figure 58722DEST_PATH_IMAGE006
representing the real border of the frame,
Figure 80773DEST_PATH_IMAGE007
representing the intersection ratio of the target bounding box and the real bounding box,
Figure 152635DEST_PATH_IMAGE008
representing a Euclidean distance between a center of the target bounding box and a center of the real bounding box,
Figure 61685DEST_PATH_IMAGE009
representing a diagonal length of a minimum bounding box that bounds the target bounding box and the real bounding box,
Figure 193589DEST_PATH_IMAGE010
it is indicated that the intermediate quantities are calculated,
Figure 938822DEST_PATH_IMAGE011
representing the real value of the bounding box width among the real values,
Figure 814374DEST_PATH_IMAGE012
representing the real values of the bounding box heights among the real values,
Figure 843510DEST_PATH_IMAGE013
representing a bounding box width prediction value of the prediction values,
Figure 146315DEST_PATH_IMAGE014
representing a bounding box height prediction value of the prediction values,
Figure 405609DEST_PATH_IMAGE015
representing the circumferential ratio; calculating a frame confidence coefficient loss value according to the predicted value and the true value and the following formula
Figure 819273DEST_PATH_IMAGE016
Figure 702915DEST_PATH_IMAGE017
In the formula (I), the compound is shown in the specification,
Figure 661775DEST_PATH_IMAGE018
which represents a pre-set weight parameter that is,
Figure 630868DEST_PATH_IMAGE019
respectively represent a positive integer, and each represents a positive integer,
Figure 159807DEST_PATH_IMAGE020
representing a total number of bounding boxes of the plurality of target bounding boxes,
Figure 897956DEST_PATH_IMAGE021
is shown with
Figure 808143DEST_PATH_IMAGE022
Corresponding to each grid
Figure 998953DEST_PATH_IMAGE023
Whether the target frame is responsible for predicting the logic value of the cavel or not is judged, if yes, the value is 1, and if not, the value is 0,
Figure 488840DEST_PATH_IMAGE024
represents the first
Figure 97807DEST_PATH_IMAGE023
Each target frame contains the probability of the goat's horn,
Figure 647737DEST_PATH_IMAGE025
represents the first
Figure 325843DEST_PATH_IMAGE023
Each target frame comprises a probability score predicted value of the goat horn; calculating a class prediction loss value according to the following formula according to the predicted value and the true value
Figure 885000DEST_PATH_IMAGE026
Figure 849939DEST_PATH_IMAGE027
In the formula (I), the compound is shown in the specification,
Figure 836349DEST_PATH_IMAGE028
respectively represent a positive integer, and each represents a positive integer,
Figure 267331DEST_PATH_IMAGE020
representing a total number of bounding boxes of the plurality of target bounding boxes,
Figure 630179DEST_PATH_IMAGE029
is shown with
Figure 948159DEST_PATH_IMAGE030
Corresponding to each grid
Figure 167788DEST_PATH_IMAGE031
Whether the target frame is responsible for predicting the logic value of the cavel or not is judged, if yes, the value is 1, and if not, the value is 0,
Figure 69753DEST_PATH_IMAGE032
a frame class is represented that is a frame class,
Figure 970713DEST_PATH_IMAGE033
a set of bounding box categories is represented,
Figure 658047DEST_PATH_IMAGE034
is represented by the second
Figure 720681DEST_PATH_IMAGE031
The actual code value of the frame class corresponding to the target frame,
Figure 611407DEST_PATH_IMAGE035
is represented by the second
Figure 50479DEST_PATH_IMAGE031
The frame type corresponding to each target frame is predicted and coded; losing the frame position value
Figure 592319DEST_PATH_IMAGE003
The frame confidence loss value
Figure 357012DEST_PATH_IMAGE016
And the class prediction loss value
Figure 230641DEST_PATH_IMAGE036
The sum is used as a loss function calculation result so as to carry out iterative optimization of the loss function and obtain the detection model.
2. The real-time detection method for the toe of a pantograph as claimed in claim 1, wherein the step of performing an on-off operation on the binarized image to obtain a new toe image comprises the steps of:
the open operation processing is performed according to the following formula:
Figure 473403DEST_PATH_IMAGE037
in the formula (I), the compound is shown in the specification,
Figure 135329DEST_PATH_IMAGE038
representing a new cavel image obtained after the opening operation processing,
Figure 805344DEST_PATH_IMAGE039
representing the binarized image before the on operation processing,
Figure 405084DEST_PATH_IMAGE040
the structural elements of the on-operation are represented,
Figure 248275DEST_PATH_IMAGE041
it is shown that the etching treatment is performed,
Figure 13975DEST_PATH_IMAGE042
showing the expansion treatment;
and/or performing closed operation processing according to the following formula:
Figure 854892DEST_PATH_IMAGE043
in the formula (I), the compound is shown in the specification,
Figure 191195DEST_PATH_IMAGE044
representing a new cavel image obtained after the closed operation processing,
Figure 775760DEST_PATH_IMAGE045
representing the binarized image before the closed arithmetic operation processing,
Figure 897431DEST_PATH_IMAGE046
the structural elements of the closed-loop operation are represented,
Figure 909250DEST_PATH_IMAGE047
it is shown that the etching treatment is performed,
Figure 264008DEST_PATH_IMAGE042
showing the expansion process.
3. The method for real-time detection of a pantograph sheep horn as claimed in claim 1, wherein after determining whether the sheep horn is qualified in a current state according to a comparison result of the real-time value of the geometrical parameter of the sheep horn and a design allowable variation range, the method further comprises:
and if the cavel is judged to be unqualified in the current state, calculating the difference between the real-time value of the geometrical parameters of the cavel and the boundary value of the design allowable variation range, and outputting warning information containing the difference.
4. A real-time detection device for a pantograph goat horn is characterized by comprising a video acquisition module, a equalization processing module, a goat horn area identification module, a goat horn image intercepting module, a binarization processing module, an opening and closing operation processing module, a goat horn contour fitting module, a goat horn parameter acquisition module and a goat horn qualification judgment module which are sequentially in communication connection;
the video acquisition module is used for acquiring videos acquired by the monitoring camera in real time, wherein the monitoring camera is installed on the roof of the vehicle and enables the camera view to cover the area where the pantograph is located;
the equalization processing module is used for carrying out histogram equalization processing on the latest image in the video to obtain a sample image to be detected;
the cavel region identification module is used for guiding the sample image to be detected into the trained target detection model and identifying the region position of the cavel of the pantograph in the sample image to be detected;
the goat horn image intercepting module is used for intercepting a goat horn image from the sample image to be detected according to the position of the area;
the binarization processing module is used for carrying out binarization processing on the cavel image to obtain a binarization image;
the switching operation processing module is used for carrying out switching operation processing on the binary image to obtain a new cavel image;
the cavel contour fitting module is used for fitting to obtain a real-time geometric contour of the cavel according to the new cavel image;
the cavel parameter acquiring module is used for acquiring a real-time value of a cavel geometric parameter according to the real-time geometric contour, wherein the cavel geometric parameter comprises cavel width, cavel height and/or cavel area;
the horn qualification judging module is used for judging whether the horn is qualified in the current state according to the comparison result of the real-time value of the geometric parameters of the horn and the allowable variation range of the design;
before the sample image to be tested is imported into the trained target detection model, the device further comprises: acquiring a pantograph monitoring video historically acquired by the monitoring camera in one trip; respectively carrying out histogram equalization processing on each frame of image in the pantograph monitoring video to obtain a plurality of training sample images; acquiring horn region labeling data corresponding to each training sample image in the plurality of training sample images one to one; importing the training sample image and the cavel region labeling data corresponding to the training sample image into the target detection model for training to obtain the trained target detection model;
importing the training sample image and the cavel region labeling data corresponding to the training sample image into the target detection model for training to obtain the trained target detection model, including: importing the training sample image and the cavel region labeling data corresponding to the training sample image into a YOLO-v4 target detection model, and executing the following training steps in the YOLO-v4 target detection model: adjusting the training sample image to haveTarget size and is divided into
Figure 386684DEST_PATH_IMAGE001
A square image of a grid, wherein,
Figure 129906DEST_PATH_IMAGE002
a natural number not less than 5; judging whether the target center falls on the target center
Figure 578205DEST_PATH_IMAGE001
In a certain grid of the grids, wherein the target center is a center of a horn area of the pantograph; if so, the grid is responsible for predicting a plurality of target frames and calculating to obtain the predicted value of each target frame in the target frames on frame parameters, wherein the frame parameters comprise a frame center horizontal coordinate, a frame center vertical coordinate, a frame width, a frame height, a frame type and a confidence coefficient corresponding to the frame type; performing iterative optimization of a loss function according to the predicted value and the cavel region labeling data to obtain a detection model which is finished with target training;
according to the predicted value and the cavel region labeling data, iterative optimization of a loss function is carried out to obtain a detection model which is trained by a target, and the method comprises the following steps: extracting a real value of a real frame on the frame parameter according to the cavel region labeling data, wherein the real frame comprises a cavel labeling frame in the square image; calculating the frame position loss value according to the following formula according to the predicted value and the real value
Figure 889100DEST_PATH_IMAGE003
Figure 566200DEST_PATH_IMAGE048
In the formula (I), the compound is shown in the specification,
Figure 911731DEST_PATH_IMAGE005
the frame of the target is represented by a frame,
Figure 265352DEST_PATH_IMAGE006
representing the real border of the frame,
Figure 63544DEST_PATH_IMAGE007
representing the intersection ratio of the target bounding box and the real bounding box,
Figure 574028DEST_PATH_IMAGE008
representing a Euclidean distance between a center of the target bounding box and a center of the real bounding box,
Figure 39645DEST_PATH_IMAGE009
representing a diagonal length of a minimum bounding box that bounds the target bounding box and the real bounding box,
Figure 564167DEST_PATH_IMAGE010
it is indicated that the intermediate quantities are calculated,
Figure 600387DEST_PATH_IMAGE011
representing the real value of the bounding box width among the real values,
Figure 868558DEST_PATH_IMAGE012
representing the real values of the bounding box heights among the real values,
Figure 923101DEST_PATH_IMAGE013
representing a bounding box width prediction value of the prediction values,
Figure 618525DEST_PATH_IMAGE014
representing a bounding box height prediction value of the prediction values,
Figure 125730DEST_PATH_IMAGE015
representing the circumferential ratio; calculating a frame confidence coefficient loss value according to the predicted value and the true value and the following formula
Figure 467366DEST_PATH_IMAGE049
Figure 110837DEST_PATH_IMAGE017
In the formula (I), the compound is shown in the specification,
Figure 242741DEST_PATH_IMAGE018
which represents a pre-set weight parameter that is,
Figure 237242DEST_PATH_IMAGE019
respectively represent a positive integer, and each represents a positive integer,
Figure 847215DEST_PATH_IMAGE020
representing a total number of bounding boxes of the plurality of target bounding boxes,
Figure 361504DEST_PATH_IMAGE021
is shown with
Figure 664309DEST_PATH_IMAGE022
Corresponding to each grid
Figure 880527DEST_PATH_IMAGE031
Whether individual target bounding box is responsible for prediction
The logical value of the goat horn is 1 when the logical value is positive and 0 when the logical value is negative,
Figure 28612DEST_PATH_IMAGE024
represents the first
Figure 912254DEST_PATH_IMAGE031
Each target frame contains the probability of the goat's horn,
Figure 369649DEST_PATH_IMAGE025
represents the first
Figure 338742DEST_PATH_IMAGE031
Each target frame comprises a probability score predicted value of the goat horn; calculating a class prediction loss value according to the following formula according to the predicted value and the true value
Figure 556097DEST_PATH_IMAGE036
Figure 294246DEST_PATH_IMAGE027
In the formula (I), the compound is shown in the specification,
Figure 689586DEST_PATH_IMAGE028
respectively represent a positive integer, and each represents a positive integer,
Figure 880396DEST_PATH_IMAGE020
representing a total number of bounding boxes of the plurality of target bounding boxes,
Figure 370283DEST_PATH_IMAGE029
is shown with
Figure 228518DEST_PATH_IMAGE030
Corresponding to each grid
Figure 778448DEST_PATH_IMAGE031
Whether the target frame is responsible for predicting the logic value of the cavel or not is judged, if yes, the value is 1, and if not, the value is 0,
Figure 456554DEST_PATH_IMAGE032
a frame class is represented that is a frame class,
Figure 267908DEST_PATH_IMAGE033
a set of bounding box categories is represented,
Figure 980649DEST_PATH_IMAGE034
is represented by the second
Figure 701481DEST_PATH_IMAGE031
The actual code value of the frame class corresponding to the target frame,
Figure 866883DEST_PATH_IMAGE050
is represented by the second
Figure 698573DEST_PATH_IMAGE031
The frame type corresponding to each target frame is predicted and coded; losing the frame position value
Figure 16553DEST_PATH_IMAGE003
The frame confidence loss value
Figure 173864DEST_PATH_IMAGE016
And the class prediction loss value
Figure 560983DEST_PATH_IMAGE036
The sum is used as a loss function calculation result so as to carry out iterative optimization of the loss function and obtain the detection model.
5. A computer device, comprising a memory, a processor and a transceiver, which are sequentially connected in communication, wherein the memory is used for storing a computer program, the transceiver is used for transmitting and receiving data, and the processor is used for reading the computer program and executing the real-time detection method of the angle of a pantograph as claimed in any one of claims 1 to 3.
6. A storage medium having stored thereon instructions for performing the real-time detection method of a pantograph horn according to any one of claims 1 to 3 when the instructions are run on a computer.
CN202110919528.9A 2021-08-11 2021-08-11 Pantograph cavel real-time detection method, device, computer equipment and storage medium Active CN113362330B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110919528.9A CN113362330B (en) 2021-08-11 2021-08-11 Pantograph cavel real-time detection method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110919528.9A CN113362330B (en) 2021-08-11 2021-08-11 Pantograph cavel real-time detection method, device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113362330A CN113362330A (en) 2021-09-07
CN113362330B true CN113362330B (en) 2021-11-30

Family

ID=77522973

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110919528.9A Active CN113362330B (en) 2021-08-11 2021-08-11 Pantograph cavel real-time detection method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113362330B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117315670A (en) * 2023-09-26 2023-12-29 天津市金超利达科技有限公司 Water meter reading area detection method based on computer vision

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108981811A (en) * 2018-07-18 2018-12-11 东莞市诺丽电子科技有限公司 A kind of train pantograph on-line detecting system

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10380438B2 (en) * 2017-03-06 2019-08-13 Honda Motor Co., Ltd. System and method for vehicle control based on red color and green color detection
CN111260629A (en) * 2020-01-16 2020-06-09 成都地铁运营有限公司 Pantograph structure abnormity detection algorithm based on image processing
CN111967393B (en) * 2020-08-18 2024-02-13 杭州师范大学 Safety helmet wearing detection method based on improved YOLOv4
CN112132789B (en) * 2020-08-30 2022-10-25 南京理工大学 Pantograph online detection device and method based on cascade neural network
CN112381031B (en) * 2020-11-24 2024-02-02 中国科学院上海微系统与信息技术研究所 Real-time online pantograph and horn detection method based on convolutional neural network
CN112767357A (en) * 2021-01-20 2021-05-07 沈阳建筑大学 Yolov 4-based concrete structure disease detection method
CN112861959B (en) * 2021-02-02 2022-04-08 南京天创电子技术有限公司 Automatic labeling method for target detection image

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108981811A (en) * 2018-07-18 2018-12-11 东莞市诺丽电子科技有限公司 A kind of train pantograph on-line detecting system

Also Published As

Publication number Publication date
CN113362330A (en) 2021-09-07

Similar Documents

Publication Publication Date Title
CN109255350B (en) New energy license plate detection method based on video monitoring
CN104134222A (en) Traffic flow monitoring image detecting and tracking system and method based on multi-feature fusion
CN105512720A (en) Public transport vehicle passenger flow statistical method and system
CN106023076B (en) The method of the damage condition of the protective fence of the joining method and detection high-speed railway of panorama sketch
CN103442209A (en) Video monitoring method of electric transmission line
CN111652296A (en) Deep learning-based rail wagon lower pull rod fracture fault detection method
CN104966304A (en) Kalman filtering and nonparametric background model-based multi-target detection tracking method
CN113298059A (en) Pantograph foreign matter intrusion detection method, device, computer equipment, system and storage medium
CN107909012B (en) Real-time vehicle tracking detection method and device based on disparity map
CN111899515B (en) Vehicle detection system based on wisdom road edge calculates gateway
CN111561967A (en) Real-time online detection method and system for pantograph-catenary operation state
CN111626170A (en) Image identification method for railway slope rockfall invasion limit detection
CN113362330B (en) Pantograph cavel real-time detection method, device, computer equipment and storage medium
CN111582084B (en) Weak supervision learning-based rail foreign matter detection method and system under empty base view angle
CN115600124A (en) Subway tunnel inspection system and inspection method
CN115761537A (en) Power transmission line foreign matter intrusion identification method oriented to dynamic characteristic supplement mechanism
CN113657305B (en) Video-based intelligent detection method for black smoke vehicle and ringeman blackness level
CN114359286A (en) Insulator defect identification method, device and medium based on artificial intelligence
CN115359306A (en) Intelligent identification method and system for high-definition images of railway freight inspection
Song et al. Modeling and optimization of semantic segmentation for track bed foreign object based on attention mechanism
CN113920089A (en) Target detection method and device and electronic controller
CN111814582B (en) Method and device for processing driver behavior monitoring image
CN111723792B (en) Real-time positioning point identification method suitable for rigid-flexible contact network
CN114066895B (en) Detection method and device for pantograph slide plate
CN114005097A (en) Train operation environment real-time detection method and system based on image semantic segmentation

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20220614

Address after: 215300 room 807, building 1, 268 Dengyun Road, Yushan Town, Kunshan City, Suzhou City, Jiangsu Province

Patentee after: Jiangsu LUHANG Rail Transit Technology Co.,Ltd.

Address before: 215300 room 807, building 1, 268 Dengyun Road, Yushan Town, Kunshan City, Suzhou City, Jiangsu Province

Patentee before: KUNSHAN HIGH-NEW TRACK TRAFFIC INTELLIGENT EQUIPMENT Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20221014

Address after: 215300 room 807, building 1, 268 Dengyun Road, Yushan Town, Kunshan City, Suzhou City, Jiangsu Province

Patentee after: KUNSHAN HIGH-NEW TRACK TRAFFIC INTELLIGENT EQUIPMENT Co.,Ltd.

Address before: 215300 room 807, building 1, 268 Dengyun Road, Yushan Town, Kunshan City, Suzhou City, Jiangsu Province

Patentee before: Jiangsu LUHANG Rail Transit Technology Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20230419

Address after: 503-505, Building B, Tianhong Science and Technology Building, No. 18 Changwu Middle Road, Wujin District, Changzhou City, Jiangsu Province, 213164

Patentee after: CHANGZHOU LUHANG RAILWAY TRANSPORTATION TECHNOLOGY CO.,LTD.

Address before: 215300 room 807, building 1, 268 Dengyun Road, Yushan Town, Kunshan City, Suzhou City, Jiangsu Province

Patentee before: KUNSHAN HIGH-NEW TRACK TRAFFIC INTELLIGENT EQUIPMENT Co.,Ltd.