CN111738342A - Pantograph foreign matter detection method, storage medium and computer equipment - Google Patents

Pantograph foreign matter detection method, storage medium and computer equipment Download PDF

Info

Publication number
CN111738342A
CN111738342A CN202010589402.5A CN202010589402A CN111738342A CN 111738342 A CN111738342 A CN 111738342A CN 202010589402 A CN202010589402 A CN 202010589402A CN 111738342 A CN111738342 A CN 111738342A
Authority
CN
China
Prior art keywords
contour
image
threshold
foreign matter
outline
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.)
Granted
Application number
CN202010589402.5A
Other languages
Chinese (zh)
Other versions
CN111738342B (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.)
Southwest Jiaotong University
Chengdu Tangyuan Electric Co Ltd
Original Assignee
Southwest Jiaotong University
Chengdu Tangyuan Electric 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 Southwest Jiaotong University, Chengdu Tangyuan Electric Co Ltd filed Critical Southwest Jiaotong University
Priority to CN202010589402.5A priority Critical patent/CN111738342B/en
Publication of CN111738342A publication Critical patent/CN111738342A/en
Application granted granted Critical
Publication of CN111738342B publication Critical patent/CN111738342B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2411Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on the proximity to a decision surface, e.g. support vector machines
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/213Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/20Image enhancement or restoration by the use of local operators
    • G06T5/30Erosion or dilatation, e.g. thinning
    • G06T5/70
    • 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/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/28Quantising the image, e.g. histogram thresholding for discrimination between background and foreground patterns
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/50Context or environment of the image
    • G06V20/52Surveillance or monitoring of activities, e.g. for recognising suspicious objects
    • 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/20024Filtering details
    • G06T2207/20032Median filtering
    • 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 discloses a pantograph foreign matter detection method, a storage medium and computer equipment, and relates to the technical field of pantograph-catenary detection. The method comprises the steps of carrying out binarization processing on an input image, carrying out morphological processing on the image after the binarization processing, carrying out denoising processing on the image after the morphological processing, extracting a contour from the image after the denoising processing, calculating contour parameters, carrying out multi-dimensional threshold value screening on the contour parameters and carrying out gray parameter threshold value screening on a contour original gray image, so as to remove a part of non-foreign-matter images, then carrying out SVM classification processing, and finally identifying the pantograph foreign-matter image. The pantograph foreign matter detection method can adapt to the diversity of foreign matters and the complexity of an image background, determines the foreign matter candidate frame by an image processing method before training the SVM model, and filters partial candidate frames by morphological screening and gray feature screening, so that the missing detection rate is low, and the classification efficiency and precision of the SVM are improved.

Description

Pantograph foreign matter detection method, storage medium and computer equipment
Technical Field
The invention relates to the technical field of pantograph and catenary detection, in particular to the technical field of pantograph and pantograph detection, and more particularly relates to a pantograph and foreign matter detection method, a storage medium and computer equipment.
Background
All rail transit trains acquire electric energy from the outside through sliding contact between a train pantograph and a contact network, and the contact relation between the pantograph and the contact network is important for safe and normal operation of the trains. Due to the special contact relation and the structural characteristics of the pantograph and the contact network, the pantograph or the contact network of the operation train is not convenient to install test equipment, and once the operation train is in serious abnormal contact with the pantograph network or is attached with foreign matters, the operation train is also not convenient to check the train roof in a line section, and the train roof needs to be checked by means of special attachment equipment or the train is maintained to operate by changing the pantograph, so that the train is directly influenced to operate at a normal point.
In the prior art, the maintenance and monitoring of the running state of the pantograph are mainly performed by manually checking and registering by special technical personnel after a train is put in storage every day, and whether the overall structure size and the lifting state of the pantograph are normal or not is judged. However, this maintenance method can only ensure whether the pantograph itself is significantly abnormal, and cannot ensure that a normal pantograph-catenary contact relationship can be achieved after the pantograph is put into operation. In addition, a high-definition camera can be arranged on the roof of the train to record the pantograph state in the running process of the train, but the abnormal state can be checked only in a manual video playback mode, and the pantograph-catenary contact relation state and whether foreign matters are impacted or attached cannot be evaluated in real time.
At present, foreign matter detection of a pantograph is mainly performed by means of image recognition. The current contact net and the regional foreign matter detection of pantograph slide discernment mainly have following shortcoming: (1) the recognition rate is low, and different foreign matters are difficult to recognize by singly adopting the traditional image processing mode due to the variety of the types of the foreign matters; (2) the false alarm rate is high, and because the foreign matter form is various, there are infinite possible foreign matters to appear in theory, and the foreign matters are very likely to be very similar to the background of the detection image, and the image background is relatively complicated simultaneously, if want to use traditional mode to discern as many foreign matters as possible, will cause a large amount of false recognitions.
Disclosure of Invention
In order to overcome the defects and shortcomings in the prior art, the application provides a pantograph foreign matter detection method, and aims to solve the problems of low foreign matter identification rate, high false alarm rate and large image data processing amount in the prior art. According to the pantograph foreign matter detection method, binarization processing is carried out on an input image, morphological processing is carried out on the image after binarization processing, denoising processing is carried out on the image after morphological processing, the outline is extracted from the image after denoising processing, outline parameters are calculated, multi-dimensional threshold value screening is carried out on the outline parameters, gray parameter threshold value screening is carried out on an original gray image of the outline, therefore, a part of non-foreign matter images are removed, then SVM classification processing is carried out, and finally a pantograph foreign matter image is identified. The pantograph foreign matter detection method can adapt to the diversity of foreign matters and the complexity of the image background, partial images are judged and filtered through two threshold values, the calculation amount of SVM model classification is greatly reduced, the missing detection rate is lowered, and the classification efficiency and precision of the SVM are improved.
In order to solve the problems in the prior art, the invention is realized by the following technical scheme:
a pantograph foreign matter detection method comprises the following steps:
an image processing step: collecting and reading a gray image of a pantograph slide bar area, performing binarization processing on the image of the pantograph slide bar area by adopting a local self-adaptive binarization method, performing morphological processing on the image obtained after the binarization processing, performing denoising processing on the image after the morphological processing, searching a connected domain in the image after the denoising processing, and outputting the outer boundary of the connected domain as a contour; calculating outline parameters of the output outline, wherein the outline parameters comprise an outline area, an outline area-to-outline frame area ratio, an outline width, an outline height and an outline width-to-height ratio;
a threshold I judging step, namely comparing and judging the contour parameters calculated in the image processing step with a preset contour parameter threshold, if all the contour parameters of the output contour are within the contour parameter threshold, judging the contour as a suspected foreign body contour and outputting the contour to the next step, and if any contour parameter is not within the corresponding contour parameter threshold, judging the contour as a non-foreign body contour; if the contours in the input image are all non-foreign body contours, updating data and inputting the next image, and repeating the image processing step and the step for detection;
a threshold II judging step, namely corresponding the suspected foreign matter contour judged in the threshold I judging step to an original input image corresponding to the suspected foreign matter contour, and calculating a pixel gray level mean value and a variance in the corresponding contour in the original input image; respectively comparing the calculated gray level mean value and the calculated variance with a preset gray level mean value threshold value and a preset variance threshold value, and if the gray level mean value and the variance of the suspected foreign matter outline are both located in the gray level mean value threshold value and the variance threshold value, judging that the suspected foreign matter outline is an approximate foreign matter outline; if any element of the gray mean value and the variance does not meet the gray mean value threshold and the variance threshold, judging that the suspected foreign matter outline is a non-foreign matter outline; if the suspected foreign body contours in the input image are all non-foreign body contours, updating data and inputting the next image, and repeating the image processing step, the threshold I judging step and the step for detection;
an SVM classification step, namely performing dimensionality reduction on the sample image by using a principal component analysis method, and training by using data subjected to dimensionality reduction to obtain an SVM classification decision function; and (3) corresponding the approximate foreign matter outline judged in the threshold II judging step to the original image, setting an interested area according to the position of the approximate foreign matter outline frame in the original image, and substituting the interested area into an SVM classification decision function to perform secondary classification of foreign matters or non-foreign matters.
In the threshold value I judging step, the preset contour parameter threshold values comprise a contour area threshold value, a contour area-to-contour frame area ratio threshold value, a contour width threshold value, a contour height threshold value and a contour width-to-height ratio threshold value; the contour parameter threshold, the gray mean threshold and the variance threshold are obtained by manually framing a foreign object area in each image in a plurality of sample images, then obtaining the contour parameter, the gray mean and the variance of the foreign object contour through an image processing step and carrying out statistics by using statistics.
The preset contour parameter threshold, the preset gray level mean threshold and the preset variance threshold in the threshold I judging step and the preset contour parameter threshold in the threshold II judging step are obtained through the following processes:
manually framing a foreign matter area in each image in a plurality of sample images, then carrying out binarization processing, morphological processing, denoising processing and contour extraction processing to obtain a plurality of small foreign matter images, and then carrying out contour parameter calculation on the contours of the small foreign matter images to calculate a contour area AckThe ratio AR of the area of the outline to the area of the outline frameckWide profile RWckHigh profile RHckAnd profile aspect ratio RWck/RHckCalculating the pixel gray level mean value and variance of the corresponding contour of the foreign matter small image contour in the original image through a gray level parameter calculation step, carrying out statistics by utilizing statistics to obtain a maximum statistic value MaxSto and a minimum statistic value MinSto of each parameter, and adding redundancy, namely ThrMax ═ MaxSto (1+ Ratio1) and ThrMinMinMin ═ MinSto (1-Ratio2) into the maximum statistic value MaxSto and the minimum statistic value MinSto obtained by statistics, wherein Ratio1 ∈ (0,1) and Ratio2 ∈ (0,1) are obtained, so that the contour area and the contour surface are obtainedThe threshold values of product to outline box area ratio, outline width, outline height, outline width height ratio, gray mean and gray variance.
In the parameter threshold values in the threshold value I judging step and the threshold value II judging step, the Ratio1 and the Ratio2 are 0.05, 0.1 or 0.2. In the parameter threshold values in the threshold value I judging step and the threshold value II judging step,
Figure BDA0002554880010000031
wherein StofThe parameter values satisfying the maximum frequency are distributed statistically.
The specific training process of the SVM classification decision function is as follows:
(a) manually framing a foreign matter area and a non-foreign matter area on an existing pantograph image sample, generating positive and negative samples to be trained, and re-adjusting the size of each sample to be M x N, wherein the set of samples to be trained is D ═ D0,D1,...,Di,...,DI-1]The sample label is y ═ y0,y1,...,yi,...,yI-1]Total of I samples, and yi∈ { -1, +1}, -1 denotes a non-foreign matter sample, +1 denotes a foreign matter sample;
(b) will DiReconstructing into head-connected M x N dimensional column vectors x by rowsiSo that the set of samples to be trained can be written as X ═ X1,x2,...,xI-1];
(c) The PCA dimensionality reduction matrix is obtained by utilizing the data set X, the central vector u of the data set is firstly calculated,
Figure BDA0002554880010000041
then, each sample is subtracted by the central vector to obtain a de-centered sample
Figure BDA0002554880010000042
Wherein
Figure BDA0002554880010000043
Then the covariance matrix of the center-removed sample is subjected to eigenvalue decomposition,
Figure BDA0002554880010000044
wherein λ ═ λ01,...,λM*N-1]Is an eigenvalue of the covariance matrix, and01>...>λM*N-1,Q=[q1,q2,...,qM*N-1]is an eigenvector matrix of a covariance matrix, andicorresponds to qiThen setting a threshold value Tλ=λ0Rat, Rat ∈ (0,1), then selecting greater than TλForming a dimensionality reduction matrix by the eigenvectors corresponding to the eigenvalues;
(d) using a dimensionality reduction matrix to pair the depocenter sample sets according to the following formula
Figure BDA0002554880010000045
And (3) performing dimensionality reduction:
Figure BDA0002554880010000046
wherein
Figure BDA0002554880010000047
The dimension of the data matrix after dimension reduction is K x I, K<<M*N;
(e) Using the reduced dimension data
Figure BDA0002554880010000048
Training the SVM model specifically as follows:
Figure BDA0002554880010000049
s.t.1-yi(wTφ(xi)+b)-ξi≤0,ξi0, I ≧ 0,1,2, 1, I-1, where w, b are parameters for classifying hyperplanes, ξiThe soft interval parameter is C, the penalty coefficient is C, phi (-) is a mapping relation, and phi (-) is operated through a kernel function; by constructing the lagrange function and the dual transformation, the above model is transformed as follows:
Figure BDA00025548800100000410
s.t.λi≥0,μi≥0;
by calculating the partial derivatives for each parameter and making them 0, we can obtain:
Figure BDA00025548800100000411
Figure BDA00025548800100000412
C=λii
and substituting the above relation into Lagrange function to obtain optimized model,
Figure BDA0002554880010000051
Figure BDA0002554880010000052
wherein phi (x)i)·φ(xj) Calculating by a kernel function, solving by using an SMO algorithm to obtain lambda, and selecting lambda satisfying that C is more than or equal to lambdajA component λ of 0 or morejAnd calculating:
Figure BDA0002554880010000053
wherein, SV is a support vector set, and a decision function is finally obtained:
Figure BDA0002554880010000054
in the image processing step, binarization processing is carried out on the pantograph slide bar area image, specifically: dividing an input image into a plurality of non-overlapping small blocks, and carrying out binarization on each small block according to the corresponding gray scale change characteristic of each small block; the specific process is as follows:
the input image I is divided into 4 non-overlapping small blocks, denoted as IA、IB、ICAnd IDThen E isA=f(IA,thrA)
Figure BDA0002554880010000055
i=0,1,2,...,IAH-1,j=i=0,1,2,...,IAW-1; wherein E isAIs IAImage after binarization, thrAFor threshold values used in binarization, the threshold value being in accordance with IAObtaining a gray level histogram of (1)AHIs IAHigh of (I)AWIs IAIs wide; in the same way, E can be obtainedB、EC、EDAnd then the binary images E of the input image I are obtained by splicing the images together in a manner of segmentation. The adoption of the local self-adaptive binarization method to obtain the binarized image E overcomes the influence of the brightness and contrast difference of different areas of the image on the binarized extraction target caused by different illumination conditions at different time on the image obtained by on-line pantograph monitoring, and provides a foundation for effectively screening foreign body images by subsequent morphological processing.
In the image processing step, morphological processing comprises image corrosion, image expansion, opening operation and closing operation; in the image processing step, the image obtained after the binarization processing is subjected to morphological processing, specifically, the image obtained after the binarization processing is subjected to two opening operations, and is subjected to one etching to obtain a processed image M.
In the image processing step, the mode of denoising the image after morphological processing is median filtering or Gaussian filtering.
In the SVM classification step, phi (-) is operated by a kernel function, and phi (x)i)·φ(xj) The kernel function in the operation by the kernel function includes one of a linear kernel, a polynomial kernel, and a gaussian kernel.
In the SVM classification step, phi (x)i)·φ(xj) The operation is carried out through a kernel function, and the kernel function adopts a Gaussian kernel function:
Figure BDA0002554880010000061
a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor performing the steps of the above method when executing the computer program.
A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned method.
Compared with the prior art, the beneficial technical effects brought by the application are shown in that:
1. the invention combines the traditional image processing and machine learning methods, and has the advantages of high detection accuracy, low false detection rate, low missing detection rate and high running speed. Before training an SVM model, a foreign matter candidate frame is determined in an image processing mode, and then part of candidate frames are filtered by morphological screening and gray feature screening, wherein the part of candidate frames are processed on the premise of ensuring that non-foreign matter candidate frames are filtered as far as possible, so that the missing detection rate is low, and the classification efficiency and precision of the SVM are improved.
2. According to the method, a comprehensive threshold judgment method is adopted to filter out part of non-foreign matter candidate frames, the processing data volume is reduced for the subsequent SVM classification model processing, and the SVM classification efficiency and precision can be effectively improved. Meanwhile, the parameter threshold value is obtained by data mining and statistics of a large amount of sample data, and in order to avoid filtering foreign matters, a certain redundancy is increased when the threshold value is set, so that the risk of mistakenly filtering the foreign matters is reduced as much as possible. Meanwhile, the threshold value can be adaptively modified according to the monitoring images of different scenes, so that the method, the system or the computer equipment or the computer program in the storage medium can be well adapted to the scene switching, and the foreign matter detection accuracy and detection efficiency, such as day and night scene switching, can be ensured. In addition, the threshold expansion of the redundancy is combined with the statistical distribution of the sample parameters, so that the effects of considering screening efficiency and retaining effective abnormal data are achieved.
3. According to the method, Principal Component Analysis (PCA) is combined in the process of SVM classification establishment to train the data to be classified, the SVM model is trained by using the data after dimensionality reduction, and the training efficiency of the SVM model is improved on the basis of ensuring the recognition accuracy of the SVM model.
4. The invention sets the judgment threshold value by adopting a training statistic mode, can adapt to the diversity of foreign matters and the complexity of an image background, is convenient to modify algorithm parameters after being set into a computer program, and can better adapt to the detection of the current environment by only modifying the judgment threshold value and a corresponding SVM classification model. The modification of the relevant parameters can be carried out by other non-specialized persons without specialized persons.
5. According to the method, threshold judgment is combined with SVM classification, preliminary rough selection is carried out in the threshold judgment step, SVM classification is accurately identified, and if SVM classification identification is directly carried out, the large amount of SVM classification processing data is caused, the processing efficiency is low, and pantograph foreign matter identification in real-time online monitoring cannot be realized; and the foreign matter cannot be accurately identified by adopting the image characteristic threshold value alone for judgment, so that the condition of false detection is easy to occur. According to the method and the device, threshold judgment and SVM classification are combined, the detection accuracy is high, the false detection rate is low, the missing detection rate is low, and the running speed is high.
6. Because the background of the detection image containing the pantograph is relatively complex, the foreign object image is likely to have similarity with the background image, and the foreign object image can be effectively highlighted by adopting a mode of firstly carrying out opening operation twice and then carrying out corrosion once.
Drawings
Fig. 1 is a flowchart of a pantograph foreign object detection method according to the present invention.
Detailed Description
The technical scheme of the application is further elaborated in the following by combining the drawings in the specification.
Referring to the accompanying drawing 1 of the specification, the embodiment discloses a pantograph foreign matter detection method, and the specific flow is described as follows:
image input: and inputting a gray image of the pantograph slider area, and marking as I.
Image binarization: the local self-adaptive binarization method is adopted, namely, an input image is divided into a plurality of non-overlapping small blocks, and each small block is binarized according to the corresponding gray scale change characteristic of the small block.
For example, the input image I is divided into 4 non-overlapping small blocks, denoted as IA、IB、IC、IDThen E isA=f(IA,thrA)
Figure BDA0002554880010000071
i=0,1,2,...,IAH-1,j=0,1,2,...,IAW-1, wherein EAIs IAImage after binarization, thrAFor the threshold used in binarization, the threshold may be according to IAObtaining a gray level histogram of (1)AHIs IAHigh of (I)AWIs IAIs wide. In the same way, E can be obtainedB,EC,EDThen, the input image I is pieced together in the manner of segmentation to obtain a binarized image E of the input image I.
Morphological treatment: and performing morphological processing on the binary image E, wherein the morphological processing mainly comprises image corrosion, expansion, opening operation, closing operation and the like. The above operations can be used in combination according to actual conditions, for example, the binary image is first subjected to two opening operations and then subjected to one etching, and the output image is recorded as M.
Median filtering: and further performing drying treatment on the morphologically processed image. Median filtering is used herein, and the filtered image is recorded as
Figure BDA0002554880010000081
Extracting the contour: in that
Figure BDA0002554880010000082
Searching for connected domain, and outputting the outer boundary of the connected domain as contour, and recording a certain contour as ck
Calculating profile parameters: including profile area, ratio of profile area to profile frame area, profile width, profile height, and profile width to height ratio. In detail, the outline area calculation mode is to count the number of pixel points in the outline, and is recorded as Ack
The outline frame is an external rectangle of the outline, theoretically, the external rectangles of the outline have infinite number, the rectangle sides are simply selected as horizontal and vertical external rectangles respectively to carry out subsequent calculation, the area of the external rectangles is equal to the product of the width and the height of the outline frame, therefore, the calculation mode of the area ratio of the outline area to the outline frame is that the outline area is divided by the outline frame area and is marked as ARck
Width of the profile, i.e. the width of the profile frame, denoted RWckI.e. the horizontal distance of the rightmost and leftmost pixels of the contour; height of the profile, i.e. the height of the profile frame, denoted RHckI.e. the vertical distance between the uppermost and lowermost pixel points of the profile; the aspect ratio is calculated by dividing the aspect ratio by the aspect ratio.
Whether the parameter satisfies a threshold i: the step is to primarily screen the extracted contours and filter out the contours which are obviously not foreign matters. If a certain contour area is between (area min, area max), the ratio of the contour area to the contour frame area is between (area ratio min, area ratio max), the contour width is between (width min, width max), the contour height is between (HeiMin, HeiMax), and the contour width-height ratio is between (width heiratimin, width HeiMax), then it is determined that the contour is a foreign object contour, if any one of the above conditions is not satisfied, it is determined that the contour is a non-foreign object contour, and the foreign object contour is directly removed, as a statistical determination interval herein: (area min, area max) ═ (387, 20471), (area ratio min, area ratio max) ═ (0.34, 0.83), (HeiMin, HeiMax) ═ (18, 163), (widheiratio min, widhei ratio max) ═ 0.27, 3.91.
If all the contours extracted from the input image are removed, the updated data is input into the next image for detection. If the contour passes the primary screening, the next calculation is carried out. The threshold values are obtained through statistics, for example, a large number of images are processed to the step of extracting the contour, then the foreign body contour and the non-foreign body contour are manually distinguished, then the parameters are respectively calculated, and the corresponding optimal threshold values are set according to the calculated parameter values, wherein the threshold values can allow the non-foreign bodies to be judged as foreign bodies, but real foreign bodies cannot be missed as far as possible, the method is just primary screening, and the subsequent steps are further screened and finally judged.
Calculating a gray level parameter: and corresponding the preliminarily screened contours to an original input image, and then calculating the mean value and the variance of the pixel gray scales in the corresponding contours in the original input image.
Whether the parameter satisfies a threshold value II: the step is to further filter out non-foreign body contours according to the gray scale parameters. If the mean value of the gray levels in a certain contour is between (AveIm, AveMax) and the variance of the gray levels is between (VarMin, VarMax), the contour is further judged to be a foreign body contour, if any condition of the two conditions is not met, the contour is judged to be a non-foreign body contour, and the contour is directly removed. If all the contours input in the step are completely removed, judging that no foreign object exists in the input image, and then updating data and inputting the updated data into the next image for detection. If there are contours that pass this screening, the next step is performed. Similarly, the threshold of the filtering is obtained by statistical means, and the specific manner can refer to the threshold statistics of the first filtering. The threshold setting of this step also allows some non-foreign object profiles to pass the screening while trying to ensure that the true foreign object profile is not missed, as in this document (AveMin, AveMax) ═ 116, 203), (VarMin, VarMax) ═ 3.66, 13.42.
The specific statistical modes of the parameter threshold I and the parameter threshold II are as follows:
according to 36925 pantograph images obtained by monitoring at a certain time, manually framing a foreign matter area in each image to obtain 2189 foreign matter small images, then respectively calculating the outline area, the outline area to outline frame area ratio, the outline width, the outline height, the outline width height ratio, the gray level mean value in the outline and the gray level variance in the outline of each small image according to the calculation mode, further obtaining the maximum statistic MaxSto and the minimum statistic MinSto of each parameter, and adding partial redundancy in order to reduce the risk of filtering foreign matters as much as possible, so that the maximum and minimum filtering threshold values of the parameter interval are set as follows:
ThrMax=MaxSto*(1+Ratio1)
ThrMin=MinSto*(1–Ratio2)
wherein Ratio1 ∈ (0,1)Ratio2 ∈ (0,1), and is usually set to be small, such as 0.05, 0.1, 0.2, etc., in the parameter threshold values in the threshold value I judging step and the threshold value II judging step,
Figure BDA0002554880010000091
wherein StofThe parameter values satisfying the maximum frequency are distributed statistically.
SVM classification: and corresponding the contours after the two-time screening to the original image, setting a region of interest (ROI) in the original image according to a contour frame, and then carrying out secondary classification on foreign matters or non-foreign matters on the ROI.
In the SVM classification process, Principal Component Analysis (PCA) is combined to firstly perform dimensionality reduction on classification data, and the specific training process is as follows:
1) according to the existing pantograph image samples, a foreign matter area and a non-foreign matter area are manually framed respectively, positive and negative samples to be trained are generated, the size of each sample is adjusted to be M x N again, and the set of samples to be trained is recorded as D ═ D0,D1,...,Di,...,DI-1]And the sample label is marked as y ═ y0,y1,...,yi-1,...,yI-1]Total of I samples, and yi∈ { -1, +1}, -1 denotes a non-foreign matter sample, +1 denotes a foreign matter sample;
2) will DiRow-wise reconstruction as an end-to-end M x N dimensional column vector xiSo that the set of samples to be trained can be written as X ═ X1,x2,…,xI-1];
3) The PCA dimensionality reduction matrix is obtained by utilizing the data set X, the central vector u of the data set is firstly calculated,
Figure BDA0002554880010000101
then, each sample is subtracted by the central vector to obtain a de-centered sample
Figure BDA0002554880010000102
Wherein
Figure BDA0002554880010000103
Then the covariance matrix of the center-removed sample is subjected to eigenvalue decomposition,
Figure BDA0002554880010000104
wherein λ ═ λ01,...,λM*N-1]Is an eigenvalue of the covariance matrix, and01>...>λM*N-1,Q=[q1,q2,...,qM*N-1]is an eigenvector matrix of a covariance matrix, andicorresponds to qiThen setting a threshold value Tλ=λ0Rat, Rat ∈ (0,1), then selecting greater than TλThe eigenvectors corresponding to the eigenvalues of (a) form a dimension reduction matrix. In addition, the eigenvectors corresponding to eigenvalues greater than 0 may also be directly selected or selected according to a certain proportion of the original dimension M × N, for example, the eigenvectors corresponding to the first int (M × N × Rat) eigenvalues are selected as the dimension reduction matrix, which is marked as P, and K eigenvectors selected according to the above-mentioned manner are added, so that P ═ q is added0,q1,...,qK],K<<M*N;
4) Using a dimensionality reduction matrix to pair the depocenter sample sets according to the following formula
Figure BDA0002554880010000105
And (3) performing dimensionality reduction:
Figure BDA0002554880010000106
wherein
Figure BDA0002554880010000107
The dimension of the data matrix after dimension reduction is K x I, K<<M*N;
5) Using the reduced dimension data
Figure BDA0002554880010000108
Training the SVM model specifically as follows:
Figure BDA0002554880010000111
s.t.1-yi(wTφ(xi)+b)-ξi≤0,ξi≥0,i=0,1,2,...,I-1
where w, b are parameters for classifying hyperplanes, ξiThe soft interval parameter is C, the penalty coefficient is C, phi (-) is a certain mapping relation, and phi (-) can be directly operated subsequently through a kernel function;
by constructing the lagrangian function and the dual transformation, the above model can be transformed as follows:
Figure BDA0002554880010000112
s.t.λi≥0,μi≥0
by calculating the partial derivatives for each parameter and making them 0, we can obtain:
Figure BDA0002554880010000113
Figure BDA0002554880010000114
C=λii
and the above-mentioned relation is substituted into Lagrange function, then the optimized model can be obtained
Figure BDA0002554880010000115
Figure BDA0002554880010000116
Wherein phi (x)i)·φ(xj) The operation can be performed through kernel functions, which are commonly used as linear kernels, polynomial kernels and gaussian kernels, and the gaussian kernel function is used here:
Figure BDA0002554880010000117
finally, solving by using an SMO algorithm to obtain lambda, and then selecting lambda satisfying 0 & ltlambdajComponent lambda of < CjAnd calculating:
Figure BDA0002554880010000118
wherein SV is a set of support vectors. Finally, a decision function can be constructed:
Figure BDA0002554880010000119
the decision function is brought in for the sample x to be measured, if f (x) is more than 0, the sample x is foreign matter, otherwise, the sample x is non-foreign matter.
Example 2
Referring to the attached fig. 1, this embodiment discloses:
a pantograph foreign matter detection method comprises the following steps:
an image processing step: collecting and reading a gray level image I of a pantograph slide bar area, and performing binarization processing on the image of the pantograph slide bar area by adopting a local self-adaptive binarization method to obtain an image E after binarization processing; performing morphological processing on the image E obtained after the binarization processing to obtain an image M; denoising the image M after the morphological processing to obtain an image
Figure BDA0002554880010000121
Image after de-noising processing
Figure BDA0002554880010000122
Searching a connected domain, outputting the outer boundary of the connected domain as a contour, and outputting a certain contour ck(ii) a Calculating the contour parameters of the output contour, wherein the contour parameters comprise a contour area AckThe ratio AR of the area of the outline to the area of the outline frameckWide profile RWckHigh profile RHckAnd profile aspect ratio RWck/RHck
A threshold I judging step of judging the contour parameters calculated in the image processing stepComparing and judging with a preset contour parameter threshold, if all contour parameters of the output contour are within the contour parameter threshold, judging the contour as a suspected foreign body contour and outputting the suspected foreign body contour to the next step, and if any contour parameter is not within the corresponding contour parameter threshold, judging the contour as a non-foreign body contour; if the contours in the input image are all non-foreign body contours, updating data and inputting the next image, and repeating the image processing step and the step for detection; namely, the contour area A calculated in the contour parameter calculation stepckThe ratio AR of the area of the outline to the area of the outline frameckWide profile RWckHigh profile RHckAnd profile aspect ratio RWck/RHckMaking a judgment if a certain contour ckArea A of the contour ofckBetween (AreaMin, AreaMax), the ratio AR of the outline area to the outline box areackBetween (area ratio min, area ratio max), the profile width RWckBetween (WidthMin, WidthMax), the profile is high RHckBetween (HeiMin, HeiMax), the profile aspect ratio RWck/RHckAt (WidHeiRatioMin, WidHeiRatioMax), the profile c is judgedkIs a foreign matter candidate outline; if the condition is not met, judging that the contour is a non-foreign-body contour, and directly rejecting the contour; if all the contours extracted from the input image are removed, updating data and inputting the next image for detection; and if the contour extracted from the input image meets the determined foreign matter candidate contour, performing the next step.
A threshold II judging step, wherein the foreign matter candidate contour judged in the threshold I judging step is corresponding to the corresponding original input image, and the pixel gray level mean value and the variance in the corresponding contour are calculated in the original input image; respectively comparing the calculated gray level mean value and the calculated variance with a preset gray level mean value threshold value and a preset variance threshold value, and if the gray level mean value and the variance of the suspected foreign matter outline are both located in the gray level mean value threshold value and the variance threshold value, judging that the suspected foreign matter outline is an approximate foreign matter outline; if any element of the gray mean value and the variance does not meet the gray mean value threshold and the variance threshold, judging that the suspected foreign matter outline is a non-foreign matter outline; if the suspected foreign body contours in the input image are all non-foreign body contours, updating data and inputting the next image, and repeating the image processing step, the threshold I judging step and the step for detection;
judging the pixel gray mean value and variance of the foreign object candidate contour in the original input image corresponding to the contour calculated in the gray parameter calculation step, and if the gray mean value is between (AveIm, AveMax) and the gray variance is between (VarMin, VarMax), further judging that the contour is the foreign object contour; if any one of the two conditions is not met, the contour is judged to be a non-foreign-body contour, and the foreign-body contour is directly removed; if all the contours input in the step are completely removed, judging that the input image has no foreign objects, and then updating data and inputting the next image for detection; if the contour passes the judgment of the step, the next step is carried out.
An SVM classification step, namely performing dimensionality reduction on the sample image by using a principal component analysis method, and training by using data subjected to dimensionality reduction to obtain an SVM classification decision function; and (3) corresponding the approximate foreign matter outline judged in the threshold II judging step to the original image, setting an interested area according to the position of the approximate foreign matter outline frame in the original image, and substituting the interested area into an SVM classification decision function to perform secondary classification of foreign matters or non-foreign matters.
Example 3
Referring to the attached fig. 1, this embodiment discloses:
a pantograph foreign matter detection method comprises the following steps:
an image processing step: collecting and reading a gray image of a pantograph slide bar area, performing binarization processing on the image of the pantograph slide bar area by adopting a local self-adaptive binarization method, performing morphological processing on the image obtained after the binarization processing, performing denoising processing on the image after the morphological processing, searching a connected domain in the image after the denoising processing, and outputting the outer boundary of the connected domain as a contour; calculating outline parameters of the output outline, wherein the outline parameters comprise an outline area, an outline area-to-outline frame area ratio, an outline width, an outline height and an outline width-to-height ratio;
a threshold I judging step, namely comparing and judging the contour parameters calculated in the image processing step with a preset contour parameter threshold, if all the contour parameters of the output contour are within the contour parameter threshold, judging the contour as a suspected foreign body contour and outputting the contour to the next step, and if any contour parameter is not within the corresponding contour parameter threshold, judging the contour as a non-foreign body contour; if the contours in the input image are all non-foreign body contours, updating data and inputting the next image, and repeating the image processing step and the step for detection;
a threshold II judging step, namely corresponding the suspected foreign matter contour judged in the threshold I judging step to an original input image corresponding to the suspected foreign matter contour, and calculating a pixel gray level mean value and a variance in the corresponding contour in the original input image; respectively comparing the calculated gray level mean value and the calculated variance with a preset gray level mean value threshold value and a preset variance threshold value, and if the gray level mean value and the variance of the suspected foreign matter outline are both located in the gray level mean value threshold value and the variance threshold value, judging that the suspected foreign matter outline is an approximate foreign matter outline; if any element of the gray mean value and the variance does not meet the gray mean value threshold and the variance threshold, judging that the suspected foreign matter outline is a non-foreign matter outline; if the suspected foreign body contours in the input image are all non-foreign body contours, updating data and inputting the next image, and repeating the image processing step, the threshold I judging step and the step for detection;
an SVM classification step, namely performing dimensionality reduction on the sample image by using a principal component analysis method, and training by using data subjected to dimensionality reduction to obtain an SVM classification decision function; and (3) corresponding the approximate foreign matter outline judged in the threshold II judging step to the original image, setting an interested area according to the position of the approximate foreign matter outline frame in the original image, and substituting the interested area into an SVM classification decision function to perform secondary classification of foreign matters or non-foreign matters.
In the threshold value I judging step, the preset contour parameter threshold values comprise a contour area threshold value, a contour area-to-contour frame area ratio threshold value, a contour width threshold value, a contour height threshold value and a contour width-to-height ratio threshold value; the contour parameter threshold, the gray mean threshold and the variance threshold are obtained by manually framing a foreign object area in each image in a plurality of sample images, then obtaining the contour parameter, the gray mean and the variance of the foreign object contour through an image processing step and carrying out statistics by using statistics.
The preset contour parameter threshold, the preset gray level mean threshold and the preset variance threshold in the threshold I judging step and the preset contour parameter threshold in the threshold II judging step are obtained through the following processes:
manually framing a foreign matter area in each image in a plurality of sample images, then carrying out binarization processing, morphological processing, denoising processing and contour extraction processing to obtain a plurality of small foreign matter images, and then carrying out contour parameter calculation on the contours of the small foreign matter images to calculate a contour area AckThe ratio AR of the area of the outline to the area of the outline frameckWide profile RWckHigh profile RHckAnd profile aspect ratio RWck/RHckCalculating the pixel gray level mean value and the variance of the corresponding contour of the foreign matter small image contour in the original image through a gray level parameter calculation step, carrying out statistics by utilizing statistics to obtain a maximum statistic value MaxSto and a minimum statistic value MinSto of each parameter, and adding redundancy, namely ThrMaxSto ═ MaxSto (1+ Ratio1) and ThrMinMinMin ═ MinSto (1-Ratio2) into the maximum statistic value MaxSto and the minimum statistic value MinSto obtained by statistics, wherein Ratio1 ∈ (0,1) and Ratio2 ∈ (0,1) are added, so that the threshold values of the contour area, the Ratio of the contour area to the contour frame area, the contour width, the contour height, the contour width height Ratio, the gray level mean value and the gray level variance are obtained.
In the parameter threshold values in the threshold value I judging step and the threshold value II judging step, the Ratio1 and the Ratio2 are 0.05, 0.1 or 0.2.
The specific training process of the SVM classification decision function is as follows:
(a) manually framing a foreign matter area and a non-foreign matter area on an existing pantograph image sample, generating positive and negative samples to be trained, and re-adjusting the size of each sample to be M x N, wherein the set of samples to be trained is D ═ D0,D1,...,Di,...,DI-1]The sample label is y ═[y0,y1,...,yi,...,yI-1]Total of I samples, and yi∈ { -1, +1}, -1 denotes a non-foreign matter sample, +1 denotes a foreign matter sample;
(b) will DiReconstructing into head-connected M x N dimensional column vectors x by rowsiSo that the set of samples to be trained can be written as X ═ X1,x2,...,xI-1];
(c) The PCA dimensionality reduction matrix is obtained by utilizing the data set X, the central vector u of the data set is firstly calculated,
Figure BDA0002554880010000151
then, each sample is subtracted by the central vector to obtain a de-centered sample
Figure BDA0002554880010000152
Wherein
Figure BDA0002554880010000153
Then the covariance matrix of the center-removed sample is subjected to eigenvalue decomposition,
Figure BDA0002554880010000154
wherein λ ═ λ01,...,λM*N-1]Is an eigenvalue of the covariance matrix, and01>...>λM*N-1,Q=[q1,q2,...,qM*N-1]is an eigenvector matrix of a covariance matrix, andicorresponds to qiThen setting a threshold value Tλ=λ0Rat, Rat ∈ (0,1), then selecting greater than TλForming a dimensionality reduction matrix by the eigenvectors corresponding to the eigenvalues;
(d) using a dimensionality reduction matrix to pair the depocenter sample sets according to the following formula
Figure BDA0002554880010000155
And (3) performing dimensionality reduction:
Figure BDA0002554880010000156
wherein
Figure BDA0002554880010000157
The dimension of the data matrix after dimension reduction is K x I, K<<M*N;
(e) Using the reduced dimension data
Figure BDA0002554880010000158
Training the SVM model specifically as follows:
Figure BDA0002554880010000159
s.t.1-yi(wTφ(xi)+b)-ξi≤0,ξimore than or equal to 0, I ═ 0,1,2
Parameters of noodles, ξiThe soft interval parameter is C, the penalty coefficient is C, phi (-) is a mapping relation, and phi (-) is operated through a kernel function; by constructing the lagrange function and the dual transformation, the above model is transformed as follows:
Figure BDA0002554880010000161
s.t.λi≥0,μi≥0;
by calculating the partial derivatives for each parameter and making them 0, we can obtain:
Figure BDA0002554880010000162
Figure BDA0002554880010000163
C=λii
and substituting the above relation into Lagrange function to obtain optimized model,
Figure BDA0002554880010000164
Figure BDA0002554880010000165
wherein phi (x)i)·φ(xj) Calculating by a kernel function, solving by using an SMO algorithm to obtain lambda, and selecting lambda satisfying that C is more than or equal to lambdajA component λ of 0 or morejAnd calculating:
Figure BDA0002554880010000166
wherein, SV is a support vector set, and a decision function is finally obtained:
Figure BDA0002554880010000167
in the image processing step, binarization processing is carried out on the pantograph slide bar area image, specifically: dividing an input image into a plurality of non-overlapping small blocks, and carrying out binarization on each small block according to the corresponding gray scale change characteristic of each small block; the specific process is as follows:
the input image I is divided into 4 non-overlapping small blocks, denoted as IA、IB、ICAnd IDThen E isA=f(IA,thrA)
Figure BDA0002554880010000168
i=0,1,2,...,IAH-1,j=i=0,1,2,...,IAW-1; wherein E isAIs IAImage after binarization, thrAFor threshold values used in binarization, the threshold value being in accordance with IAObtaining a gray level histogram of (1)AHIs IAHigh of (I)AWIs IAIs wide; in the same way, E can be obtainedB、EC、EDAnd then the binary images E of the input image I are obtained by splicing the images together in a manner of segmentation.
In the image processing step, morphological processing comprises image corrosion, image expansion, opening operation and closing operation; in the image processing step, the image obtained after the binarization processing is subjected to morphological processing, specifically, the image obtained after the binarization processing is subjected to two opening operations, and is subjected to one etching to obtain a processed image M.
In the image processing step, the mode of denoising the image after morphological processing is median filtering or Gaussian filtering.
In the SVM classification step, phi (-) is operated by a kernel function, and phi (x)i)·φ(xj) The kernel function in the operation by the kernel function includes one of a linear kernel, a polynomial kernel, and a gaussian kernel.
In the SVM classification step, phi (x)i)·φ(xj) The operation is carried out through a kernel function, and the kernel function adopts a Gaussian kernel function:
Figure BDA0002554880010000171
example 4
In order to achieve the above object, according to another aspect of the present application, there is also provided a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the above pantograph foreign object detection method when executing the computer program.
The processor may be a Central Processing Unit (CPU) in this embodiment. The Processor may also be other general purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, or a combination thereof.
The memory, which is a non-transitory computer readable storage medium, may be used to store non-transitory software programs, non-transitory computer executable programs, and units, such as the corresponding program units in the above-described method embodiments of the present invention. The processor executes various functional applications of the processor and the processing of the work data by executing the non-transitory software programs, instructions and modules stored in the memory, that is, the method in the above method embodiment is realized.
The memory may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created by the processor, and the like. Further, the memory may include high speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory optionally includes memory located remotely from the processor, and such remote memory may be coupled to the processor via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The one or more units are stored in the memory and, when executed by the processor, perform the methods of embodiments 1-3 above.
Example 5
As another preferred embodiment of the present invention, the present embodiment discloses a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the steps of embodiment 1 or embodiment 2 or embodiment 3 above:
the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A pantograph foreign matter detection method is characterized by comprising the following steps: the method comprises the following steps:
an image processing step: collecting and reading a gray image of a pantograph slide bar area, performing binarization processing on the image of the pantograph slide bar area by adopting a local self-adaptive binarization method, performing morphological processing on the image obtained after the binarization processing, performing denoising processing on the image after the morphological processing, searching a connected domain in the image after the denoising processing, and outputting the outer boundary of the connected domain as a contour; calculating outline parameters of the output outline, wherein the outline parameters comprise an outline area, an outline area-to-outline frame area ratio, an outline width, an outline height and an outline width-to-height ratio;
a threshold I judging step, namely comparing and judging the contour parameters calculated in the image processing step with a preset contour parameter threshold, if all the contour parameters of the output contour are within the contour parameter threshold, judging the contour as a suspected foreign body contour and outputting the contour to the next step, and if any contour parameter is not within the corresponding contour parameter threshold, judging the contour as a non-foreign body contour; if the contours in the input image are all non-foreign body contours, updating data and inputting the next image, and repeating the image processing step and the step for detection;
a threshold II judging step, namely corresponding the suspected foreign matter contour judged in the threshold I judging step to an original input image corresponding to the suspected foreign matter contour, and calculating a pixel gray level mean value and a variance in the corresponding contour in the original input image; respectively comparing the calculated gray level mean value and the calculated variance with a preset gray level mean value threshold value and a preset variance threshold value, and if the gray level mean value and the variance of the suspected foreign matter outline are both located in the gray level mean value threshold value and the variance threshold value, judging that the suspected foreign matter outline is an approximate foreign matter outline; if any element of the gray mean value and the variance does not meet the gray mean value threshold and the variance threshold, judging that the suspected foreign matter outline is a non-foreign matter outline; if the suspected foreign body contours in the input image are all non-foreign body contours, updating data and inputting the next image, and repeating the image processing step, the threshold I judging step and the step for detection;
an SVM classification step, namely performing dimensionality reduction on the sample image by using a principal component analysis method, and training by using data subjected to dimensionality reduction to obtain an SVM classification decision function; and (3) corresponding the approximate foreign matter outline judged in the threshold II judging step to the original image, setting an interested area according to the position of the approximate foreign matter outline frame in the original image, and substituting the interested area into an SVM classification decision function to perform secondary classification of foreign matters or non-foreign matters.
2. The pantograph foreign matter detection method according to claim 1, wherein: in the threshold value I judging step, the preset contour parameter threshold values comprise a contour area threshold value, a contour area-to-contour frame area ratio threshold value, a contour width threshold value, a contour height threshold value and a contour width height ratio threshold value; the contour parameter threshold, the gray mean threshold and the variance threshold are obtained by manually framing a foreign object area in each image in a plurality of sample images, then obtaining the contour parameter, the gray mean and the variance of the foreign object contour through an image processing step and carrying out statistics by using statistics.
3. The pantograph foreign matter detection method according to claim 2, wherein: the preset contour parameter threshold, the preset gray level mean threshold and the preset variance threshold in the threshold I judging step and the preset contour parameter threshold in the threshold II judging step are obtained through the following processes:
manually framing a foreign matter area in each image in a plurality of sample images, then carrying out binarization processing, morphological processing, denoising processing and contour extraction processing to obtain a plurality of small foreign matter images, and then carrying out contour parameter calculation on the contours of the small foreign matter images to calculate a contour area AckThe ratio AR of the area of the outline to the area of the outline frameckWide profile RWckHigh profile RHckAnd profile aspect ratio RWck/RHckCalculating the pixel gray level mean value and the variance of the corresponding contour of the foreign matter small image contour in the original image through a gray level parameter calculation step, carrying out statistics by utilizing statistics to obtain a maximum statistic value MaxSto and a minimum statistic value MinSto of each parameter, and adding redundancy, namely ThrMaxSto ═ MaxSto (1+ Ratio1) and ThrMinMinMin ═ MinSto (1-Ratio2) into the maximum statistic value MaxSto and the minimum statistic value MinSto obtained by statistics, wherein Ratio1 ∈ (0,1) and Ratio2 ∈ (0,1) are added, so that the threshold values of the contour area, the Ratio of the contour area to the contour frame area, the contour width, the contour height, the contour width height Ratio, the gray level mean value and the gray level variance are obtained.
4. As in claimThe pantograph foreign matter detection method according to claim 3, characterized by: in the parameter threshold values in the threshold value I judging step and the threshold value II judging step,
Figure FDA0002554880000000021
wherein StofThe parameter values satisfying the maximum frequency are distributed statistically.
5. The pantograph foreign matter detection method according to claim 1, wherein: in the image processing step, binarization processing is carried out on the pantograph slide bar area image, specifically: dividing an input image into a plurality of non-overlapping small blocks, and carrying out binarization on each small block according to the corresponding gray scale change characteristic of each small block; the specific process is as follows:
the input image I is divided into 4 non-overlapping small blocks, denoted as IA、IB、ICAnd IDThen, then
Figure FDA0002554880000000022
Figure FDA0002554880000000023
(ii) a Wherein E isAIs IAImage after binarization, thrAFor threshold values used in binarization, the threshold value being in accordance with IAObtaining a gray level histogram of (1)AHIs IAHigh of (I)AWIs IAIs wide; in the same way, E can be obtainedB、EC、EDAnd then the binary images E of the input image I are obtained by splicing the images together in a manner of segmentation.
6. The pantograph foreign matter detection method according to claim 1, wherein: in the image processing step, morphological processing is performed on the image obtained after binarization processing, specifically: and carrying out corrosion, expansion, opening operation or closing operation on the image after the binarization processing for many times.
7. The pantograph foreign matter detection method according to claim 5, wherein: in the image processing step, morphological processing is performed on the image obtained after binarization processing, specifically: and performing two opening operations on the image after the binarization processing, and performing one etching to obtain a processed image M.
8. The pantograph foreign matter detection method according to claim 1, wherein: in the image processing step, the mode of denoising the image after morphological processing is median filtering or Gaussian filtering.
9. A computer device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein: the processor, when executing the computer program, performs the steps of a pantograph foreign object detection method according to any one of claims 1 to 7.
10. A computer-readable storage medium characterized by: stored thereon, a computer program which, when being executed by a processor, carries out the steps of a pantograph foreign object detection method according to any one of the preceding claims 1-7.
CN202010589402.5A 2020-06-24 2020-06-24 Pantograph foreign matter detection method, storage medium and computer equipment Active CN111738342B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010589402.5A CN111738342B (en) 2020-06-24 2020-06-24 Pantograph foreign matter detection method, storage medium and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010589402.5A CN111738342B (en) 2020-06-24 2020-06-24 Pantograph foreign matter detection method, storage medium and computer equipment

Publications (2)

Publication Number Publication Date
CN111738342A true CN111738342A (en) 2020-10-02
CN111738342B CN111738342B (en) 2022-06-28

Family

ID=72651002

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010589402.5A Active CN111738342B (en) 2020-06-24 2020-06-24 Pantograph foreign matter detection method, storage medium and computer equipment

Country Status (1)

Country Link
CN (1) CN111738342B (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113298059A (en) * 2021-07-27 2021-08-24 昆山高新轨道交通智能装备有限公司 Pantograph foreign matter intrusion detection method, device, computer equipment, system and storage medium
CN113487561A (en) * 2021-07-02 2021-10-08 成都唐源电气股份有限公司 Pantograph foreign matter detection method and device based on gray gradient abnormal voting
CN113763491A (en) * 2021-08-26 2021-12-07 浙江中烟工业有限责任公司 Visual detection method for tobacco shred barrel residues
CN114140731A (en) * 2021-12-08 2022-03-04 西南交通大学 Traction substation abnormity detection method
CN115100580A (en) * 2022-08-23 2022-09-23 浙江大华技术股份有限公司 Foreign matter detection method, device, terminal and computer readable storage medium
CN115147770A (en) * 2022-08-30 2022-10-04 山东千颐科技有限公司 Belt foreign matter vision recognition system based on image processing
CN116468729A (en) * 2023-06-20 2023-07-21 南昌江铃华翔汽车零部件有限公司 Automobile chassis foreign matter detection method, system and computer
CN117315493A (en) * 2023-11-29 2023-12-29 浙江天演维真网络科技股份有限公司 Identification and resolution method, device, equipment and medium for field weeds

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012015698A (en) * 2010-06-30 2012-01-19 Meidensha Corp Pantograph detection device and method thereof
CN103984961A (en) * 2014-05-30 2014-08-13 成都西物信安智能系统有限公司 Image detection method for detecting foreign matter at bottom of vehicle
JP2016192863A (en) * 2015-03-31 2016-11-10 公益財団法人鉄道総合技術研究所 Device and method for detecting abnormality of pantograph and method for coping with detected abnormality of pantograph
CN110378897A (en) * 2019-07-25 2019-10-25 中车青岛四方机车车辆股份有限公司 A kind of pantograph running state real-time monitoring method and device based on video
CN110458126A (en) * 2019-08-16 2019-11-15 上海仁童电子科技有限公司 A kind of pantograph state monitoring method and device
CN111260629A (en) * 2020-01-16 2020-06-09 成都地铁运营有限公司 Pantograph structure abnormity detection algorithm based on image processing

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012015698A (en) * 2010-06-30 2012-01-19 Meidensha Corp Pantograph detection device and method thereof
CN103984961A (en) * 2014-05-30 2014-08-13 成都西物信安智能系统有限公司 Image detection method for detecting foreign matter at bottom of vehicle
JP2016192863A (en) * 2015-03-31 2016-11-10 公益財団法人鉄道総合技術研究所 Device and method for detecting abnormality of pantograph and method for coping with detected abnormality of pantograph
CN110378897A (en) * 2019-07-25 2019-10-25 中车青岛四方机车车辆股份有限公司 A kind of pantograph running state real-time monitoring method and device based on video
CN110458126A (en) * 2019-08-16 2019-11-15 上海仁童电子科技有限公司 A kind of pantograph state monitoring method and device
CN111260629A (en) * 2020-01-16 2020-06-09 成都地铁运营有限公司 Pantograph structure abnormity detection algorithm based on image processing

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
DONGKAI ZHANG等: "A Robust Pantograph–Catenary Interaction", 《IEEE TRANSACTIONS ON INSTRUMENTATION AND MEASUREMENT》 *
YUAN SHEN等: "A Pantograph Horn Detection Method Based on Deep Learning Network", 《2018 THE 3RD OPTOELECTRONICS GLOBAL CONFERENCE》 *
刘建宏: "高速列车接触网悬挂系统缺陷图像识别技术研究", 《中国优秀博硕士学位论文全文数据库(硕士)工程科技Ⅱ辑》 *
曹蔡旻: "机车受电弓及其车顶状态检测系统", 《中国优秀硕士学位论文全文数据库 工程科技Ⅱ辑》 *

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113487561B (en) * 2021-07-02 2023-06-30 成都唐源电气股份有限公司 Pantograph foreign matter detection method and device based on gray gradient abnormal voting
CN113487561A (en) * 2021-07-02 2021-10-08 成都唐源电气股份有限公司 Pantograph foreign matter detection method and device based on gray gradient abnormal voting
CN113298059A (en) * 2021-07-27 2021-08-24 昆山高新轨道交通智能装备有限公司 Pantograph foreign matter intrusion detection method, device, computer equipment, system and storage medium
CN113763491A (en) * 2021-08-26 2021-12-07 浙江中烟工业有限责任公司 Visual detection method for tobacco shred barrel residues
CN113763491B (en) * 2021-08-26 2024-03-12 浙江中烟工业有限责任公司 Visual detection method for tobacco shred barrel residues
CN114140731A (en) * 2021-12-08 2022-03-04 西南交通大学 Traction substation abnormity detection method
CN115100580A (en) * 2022-08-23 2022-09-23 浙江大华技术股份有限公司 Foreign matter detection method, device, terminal and computer readable storage medium
CN115147770B (en) * 2022-08-30 2022-12-02 山东千颐科技有限公司 Belt foreign matter vision recognition system based on image processing
CN115147770A (en) * 2022-08-30 2022-10-04 山东千颐科技有限公司 Belt foreign matter vision recognition system based on image processing
CN116468729A (en) * 2023-06-20 2023-07-21 南昌江铃华翔汽车零部件有限公司 Automobile chassis foreign matter detection method, system and computer
CN116468729B (en) * 2023-06-20 2023-09-12 南昌江铃华翔汽车零部件有限公司 Automobile chassis foreign matter detection method, system and computer
CN117315493A (en) * 2023-11-29 2023-12-29 浙江天演维真网络科技股份有限公司 Identification and resolution method, device, equipment and medium for field weeds
CN117315493B (en) * 2023-11-29 2024-02-20 浙江天演维真网络科技股份有限公司 Identification and resolution method, device, equipment and medium for field weeds

Also Published As

Publication number Publication date
CN111738342B (en) 2022-06-28

Similar Documents

Publication Publication Date Title
CN111738342B (en) Pantograph foreign matter detection method, storage medium and computer equipment
Bautista et al. Convolutional neural network for vehicle detection in low resolution traffic videos
CN111080620B (en) Road disease detection method based on deep learning
Sen-Ching et al. Robust techniques for background subtraction in urban traffic video
CN110232380A (en) Fire night scenes restored method based on Mask R-CNN neural network
CN103839085B (en) A kind of detection method of compartment exception crowd density
CN109255326B (en) Traffic scene smoke intelligent detection method based on multi-dimensional information feature fusion
CN110826389B (en) Gait recognition method based on attention 3D frequency convolution neural network
Khalifa et al. Malaysian Vehicle License Plate Recognition.
CN101482923A (en) Human body target detection and sexuality recognition method in video monitoring
CN108280409B (en) Large-space video smoke detection method based on multi-feature fusion
Bedruz et al. Real-time vehicle detection and tracking using a mean-shift based blob analysis and tracking approach
CN110929593A (en) Real-time significance pedestrian detection method based on detail distinguishing and distinguishing
CN111753794B (en) Fruit quality classification method, device, electronic equipment and readable storage medium
CN113344475B (en) Transformer bushing defect identification method and system based on sequence modal decomposition
Shoaib et al. Shadow detection for moving humans using gradient-based background subtraction
CN111062273A (en) Tracing detection and alarm method for left-over articles
Lian et al. A novel method on moving-objects detection based on background subtraction and three frames differencing
CN114298948A (en) Ball machine monitoring abnormity detection method based on PSPNet-RCNN
Daniel et al. Automatic road distress detection and analysis
Nejati et al. License plate recognition based on edge histogram analysis and classifier ensemble
CN111368742B (en) Reconstruction and identification method and system of double yellow traffic marking lines based on video analysis
CN115171218A (en) Material sample feeding abnormal behavior recognition system based on image recognition technology
CN112084957B (en) Mobile target retention detection method and system
Kamal et al. Human detection based on HOG-LBP for monitoring sterile zone

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