CN111260629A - Pantograph structure abnormity detection algorithm based on image processing - Google Patents

Pantograph structure abnormity detection algorithm based on image processing Download PDF

Info

Publication number
CN111260629A
CN111260629A CN202010045931.9A CN202010045931A CN111260629A CN 111260629 A CN111260629 A CN 111260629A CN 202010045931 A CN202010045931 A CN 202010045931A CN 111260629 A CN111260629 A CN 111260629A
Authority
CN
China
Prior art keywords
pantograph
image
points
key
contour
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.)
Pending
Application number
CN202010045931.9A
Other languages
Chinese (zh)
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.)
Chengdu Metro Operation Co ltd
Original Assignee
Chengdu Metro Operation 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 Chengdu Metro Operation Co ltd filed Critical Chengdu Metro Operation Co ltd
Priority to CN202010045931.9A priority Critical patent/CN111260629A/en
Publication of CN111260629A publication Critical patent/CN111260629A/en
Pending legal-status Critical Current

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/0004Industrial image inspection
    • 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/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • 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
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/25Determination of region of interest [ROI] or a volume of interest [VOI]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/46Descriptors for shape, contour or point-related descriptors, e.g. scale invariant feature transform [SIFT] or bags of words [BoW]; Salient regional features
    • G06V10/462Salient features, e.g. scale invariant feature transforms [SIFT]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/10Terrestrial scenes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • 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
    • 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/20092Interactive image processing based on input by user
    • G06T2207/20104Interactive definition of region of interest [ROI]
    • 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/20172Image enhancement details
    • G06T2207/20192Edge enhancement; Edge preservation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Multimedia (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Computation (AREA)
  • Evolutionary Biology (AREA)
  • General Engineering & Computer Science (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Quality & Reliability (AREA)
  • Image Analysis (AREA)

Abstract

The invention belongs to the technical field of pantograph structure abnormity detection, and discloses an image processing-based pantograph structure abnormity detection algorithm, which comprises an image preprocessing step, a pantograph positioning step, a pantograph contour extraction step, a key point extraction step and a parameter calculation and abnormity judgment step.

Description

Pantograph structure abnormity detection algorithm based on image processing
Technical Field
The invention belongs to the technical field of pantograph structure abnormity detection, and particularly relates to an image processing-based pantograph structure abnormity detection algorithm.
Background
With the rapid development of railway industry, the requirements on the transportation safety of the railway industry are higher and higher. The pantograph is one of main components for providing energy for the electric locomotive, and if a fault defect of abnormal structure occurs, serious traffic accidents can be caused, and the driving safety is endangered. Therefore, the method has great significance for the maintenance and the driving safety of the pantograph when the abnormal fault of the pantograph structure is accurately and timely found.
The train needs get the electricity from the contact net through the pantograph on the roof in the operation process. With the rapid development of domestic rail transit, a locomotive pantograph-contact network system is widely applied to the system, and meanwhile, with the increase of train operation load and the increase of mileage, the pantograph is easy to have defect faults such as structural abnormality. The method has good guiding significance for the rapid maintenance of the pantograph when the defect of the abnormal structure of the pantograph is accurately and timely found, and meanwhile, unexpected driving safety accidents can be avoided. The traditional pantograph fault detection method needs a train to enter a locomotive service section, stop, descend a pantograph, cut off power and manually check on the top, has low efficiency, poor precision, time and labor waste and poor accuracy, belongs to high-altitude dangerous operation, and has limited measurement times, so that the method has the problems of misjudgment and safety, and is not suitable for high-speed development of railways due to insufficient monitoring of abnormal conditions of the pantograph. The image detection technology belongs to a non-contact measurement technology, and can independently and objectively perform action and static measurement on a measured object. The measurement result is more objective, the measurement efficiency is more efficient, and the measurement precision is more accurate.
As in the prior art, the invention patent document with publication number CN108681733A, publication number of 2018, 10, 19 and title of "a pantograph state anomaly detection system and detection method based on image processing" discloses a pantograph state anomaly detection system and detection method based on image processing, which comprises a power supply unit, a collection trigger unit, a video image collection unit, a video information synthesis unit, a pantograph detection unit, a fault failure alarm unit, a wireless communication unit, a video image storage unit and an information display unit, wherein the collection trigger unit is connected with a locomotive system unit and a video image collection unit, the video image collection unit is connected with the video information synthesis unit and the pantograph detection unit, the video information synthesis unit is further connected with a signal output end of the locomotive system unit, and the video information synthesis unit is connected with the video image storage unit, the pantograph detection unit is connected with the video image storage unit and the fault failure alarm unit, and the video image storage unit is connected with the information display unit through the wireless communication unit.
However, in the image recognition technical solutions in the prior art, the positioning of the pantograph in the image and the extraction method of the characteristics of the pantograph have the problems of inaccuracy and high calculation complexity in actual use, which results in slow processing progress, and such algorithms can only perform qualitative analysis on whether the pantograph is abnormal, and cannot determine the degree of structural abnormality of the pantograph.
Disclosure of Invention
In order to overcome the problems and the defects in the prior art, the invention aims to provide the pantograph structure abnormality detection algorithm which has good adaptability to images with complex background, uneven illumination, noise and the like, has high algorithm detection accuracy and improves the detection efficiency of pantograph structure abnormality faults.
In order to achieve the above object, the technical solution of the present invention is as follows:
the pantograph structure abnormity detection algorithm based on image processing is characterized by comprising the following steps of:
an image preprocessing step, namely removing noise in an image to be identified; the pantograph image is shot in all weather in day and 24 hours at night, so that the situations of uneven illumination and low image contrast exist, in addition, the camera is subjected to electronic interference, the original pantograph image is compressed by adopting a JPEG format, and other reasons, and noise is easy to generate in the shot image. If the original image shot by the camera is not preprocessed, the subsequent feature extraction accuracy is affected, so that the accuracy of pantograph positioning and abnormal judgment is affected.
The image preprocessing step is to adopt a Gaussian filtering method to filter noise generated in the process of acquiring the image to be recognized, and adopt a histogram equalization method to enhance the image to be recognized and improve the image contrast for the conditions of uneven illumination and low image contrast.
A pantograph positioning step, which specifically comprises pantograph classification model establishment and pantograph identification positioning; the pantograph classification model establishment comprises the steps of carrying out feature extraction on sample images by an HOG feature extraction method to obtain HOG features of each sample image, and then carrying out training learning on HOG features of pantograph images and non-pantograph images in the sample images by an SVM classification model to obtain a pantograph classification model; and the pantograph identification and positioning is to input the image to be identified, input the HOG feature extraction result into a pantograph classification model and identify and position the pantograph in the image to be identified through HOG feature extraction. The method for positioning the pantograph image contained in the image to be recognized after the image preprocessing step is carried out by adopting the HOG + SVM method comprises the following steps: the original size of a general pantograph image is large, a foreground area (including a pantograph) needing to be detected occupies about 1/5 of the size of the image, time is consumed if algorithm processing is directly carried out on a full image, and in addition, because the background of the pantograph image is complex and changeable, when the full image processing is directly carried out, the detection effect is easily influenced by background interference, so that the detection effect is inaccurate. Therefore, after image preprocessing is carried out, the pantograph is positioned by adopting a hog + svm method, so that the detection efficiency of a subsequent algorithm is improved, and the interference is reduced.
The sample image comprises positive and negative samples of the pantograph, wherein the positive sample is an image containing the pantograph, and the negative sample is an arbitrary image without the pantograph.
The method for extracting the features of the sample image by the HOG feature extraction specifically comprises the following steps:
normalization processing, because the shot pantograph images have different illumination conditions, each image needs to be normalized to reduce the influence of illumination factors and local shadows
I(x,y)=I(x,y)gammaWherein (x, y) is a pixel point of the image;
carrying out gradient calculation on the x direction and the y direction of the image, wherein the gradient calculation is to further weaken the influence of illumination, and the gradient of pixel points (x, y) in the image is
Gx(x,y)=H(x+1,y)-H(x-1,y)
Gy(x,y)=H(x,y+1)-H(x,y-1)
According to the above formula, the gradient amplitude at the pixel point (x, y) can be obtained
Figure BDA0002369390660000031
And direction of gradient
Figure BDA0002369390660000032
And (3) feature synthesis, traversing each pixel point in the sample image, calculating to obtain gradient amplitude values and gradient direction values of all the pixel points, performing organic combination in a certain mode on all the gradient amplitude values and the gradient directions, and performing histogram statistical calculation to obtain the HOG feature of the whole image.
The HOG characteristics of the pantograph images and the non-pantograph images in the sample images are classified through an SVM training method, and the HOG characteristics of the linearly separable sample images are classified through an optimal classification line, and the HOG characteristics of the non-linearly separable sample images are classified through an optimal classification hyperplane. Through the optimal classification line, the surface function can train and learn the positive and negative sample images of the pantograph, and finally a pantograph classification model is obtained.
And a pantograph contour extraction step, namely performing image enhancement on the image to be identified after the pantograph positioning step, then performing fixed thresholding, performing binary segmentation on the image to be identified by adopting a binarization method, traversing all pixels of the image to be identified, and extracting foreground pixels by taking the pixel values as extraction standards.
Specifically, the image enhancement of the image to be recognized is to increase the contrast between the outer edge area of the pantograph cavel of the image and a background image, the outer edge of the cavel in the enhanced image to be recognized is darker, and the background is relatively lighter, so that the image can be subjected to fixed thresholding, a low pixel range area in the image is extracted, and then the whole area subjected to thresholding is subjected to connected domain calculation to obtain areas with different properties; and then, performing morphological opening operation processing on the connected domain image, removing small isolated interference regions, calculating a circumscribed rectangle of each region, and calculating the characteristics of the area, the length, the width and the like of each region on the basis. By setting a certain threshold, the area meeting the threshold condition is screened out, and the pixels of the strengthened pantograph are lower in the edge area of the goat's horn and the gap area between the goat's horn and the sliding plate. According to the characteristics, a binarization method is adopted to perform binary segmentation on the pantograph image, all pixels of the image are traversed, and pixels with the pixel value range of 0-5 are taken as foreground pixels for extraction; the binarized image contains many interference regions, and the interference regions need to be screened out by solving the characteristics of each region: solving a connected domain of the image after the binarization of the image; removing isolated small regions and noise points by adopting a morphological open operation algorithm; and calculating the area of each region, circumscribing a rectangle, and removing interference through the characteristics of the area size, the length, the width and the like of each region.
Extracting key contours, namely extracting regions on the left side and the right side of the pantograph from the image to be identified processed in the pantograph contour extraction step, carrying out contour segmentation on the central line of the extracted regions, sequentially calculating the maximum value of the longitudinal coordinate of each contour in a traversal mode on the segmented contours, sequencing the maximum value of the longitudinal coordinate of each contour from large to small, and taking the contour corresponding to the last sequenced longitudinal coordinate and the contour where the first sequenced longitudinal coordinate is located as the key contour; the region of interest is extracted only by the region, and the key points cannot be accurately calculated by the region of interest. The extracted region needs to be subjected to skeleton extraction, that is, the extracted region of interest is reduced from a multi-pixel width to a unit pixel width, which can also be called as extracting a center line of the region of interest. The contour segmentation is carried out on the extracted region central line so as to facilitate the subsequent calculation of the length of the sliding plate and the length of the bow head.
And a key point extraction step, namely extracting the central line outline of the gap between the slide plate and the cavel and the central line outline of the cavel edge in the key outline to obtain key points including the pantograph slide plate and the cavel end points.
In the key point extraction step, extracting key points of the sliding plate, traversing the abscissa of all points on the outline of the central line of the gap between the sliding plate and the cavel, and solving the average of the abscissas as the x coordinate of the key point of the sliding plate; and sorting the vertical coordinates of all the contour points, and selecting the maximum value of the vertical coordinates as the y coordinate of the key point of the slide plate.
In the key point extraction step, the key points of the goat horn are extracted, coordinate points of the outline of the central line of the edge of the goat horn are sorted from big to small in the vertical coordinate direction, the abscissa of all points in the key point set is traversed, and the average of the abscissas is taken as the x coordinate of the key points of the goat horn; and taking the maximum value of the ordinate in the key point set as the y coordinate of the key point of the goat horn. Preferably, in order to reduce the calculation error of the key points, the top 20 coordinate point sets of the sorted coordinate points are intercepted as the cavel key point set for calculation of the cavel key points.
The extracted key outlines comprise a sliding plate and cavel gap central line outline and a cavel edge central line outline, and need to be distinguished, so that subsequent extraction of key points of the sliding plate and extraction of key points of the cavel can be conveniently and accurately carried out.
And calculating the length of the pantograph slide plate, the length of the pantograph head and the height of the pantograph head according to the result of the key point extraction step, comparing the calculated length of the slide plate, the calculated length of the pantograph head, the calculated height of the pantograph head and a standard value, and judging that the pantograph structure has an abnormal phenomenon.
The length of the pantograph slide plate is calculated by using the found key points of the slide plates at the left end and the right end of the pantograph according to a linear distance calculation method between the two points.
The length of the pantograph head of the pantograph is calculated by using the found key points of the goat's horn at the left end and the right end of the pantograph according to a linear distance calculation method between the two points.
The pantograph head height is calculated by finding out a sliding plate middle point m1 according to sliding plate key points at the left end and the right end of the pantograph, calculating a goat's horn middle point m2 according to goat's horn key points at the left end and the right end of the pantograph and calculating the pantograph head height according to the two middle points.
The invention has the following beneficial effects:
the algorithm of the invention can detect whether the pantograph structure is abnormal or not at the running time and the stopping time of the locomotive, and aims to solve the defects that the conventional pantograph structure abnormality detection needs stopping, manual overhead viewing and manual measurement. Experimental tests on a large amount of data show that the detection accuracy of the algorithm is over 90%, the requirement of online detection can be well met, and the method has a good application prospect.
Drawings
The foregoing and following detailed description of the invention will be apparent when read in conjunction with the following drawings, in which:
FIG. 1 is a schematic diagram of the logical relationship of the present invention.
Detailed Description
The technical solutions for achieving the objects of the present invention are further illustrated by the following specific examples, and it should be noted that the technical solutions claimed in the present invention include, but are not limited to, the following examples.
Example 1
The embodiment discloses an image processing-based pantograph structure anomaly detection algorithm, which comprises an image preprocessing step, a pantograph positioning step, a pantograph contour extraction step, a key point extraction step and a parameter calculation and anomaly judgment step as shown in fig. 1;
an image preprocessing step, namely removing noise in an image to be identified; the pantograph image is shot in all weather in day and 24 hours at night, so that the situations of uneven illumination and low image contrast exist, in addition, the camera is subjected to electronic interference, the original pantograph image is compressed by adopting a JPEG format, and other reasons, and noise is easy to generate in the shot image. If the original image shot by the camera is not preprocessed, the subsequent feature extraction accuracy is affected, so that the accuracy of pantograph positioning and abnormal judgment is affected.
Preferably, the image preprocessing step is to perform noise filtering on noise occurring in the process of acquiring the image to be recognized by adopting a gaussian filtering method, and perform image enhancement and image contrast improvement on the image to be recognized by adopting a histogram equalization method aiming at the conditions of uneven illumination and low image contrast
A pantograph positioning step, which specifically comprises pantograph classification model establishment and pantograph identification positioning; the pantograph classification model establishment comprises the steps of carrying out feature extraction on sample images by an HOG feature extraction method to obtain HOG features of each sample image, then carrying out training and learning on the HOG features of pantograph images and non-pantograph images in the sample images by an SVM classification model to obtain a pantograph classification model, namely, the sample images comprise positive and negative pantograph samples, the positive pantograph samples are images containing pantographs, and the negative pantograph samples are any images not containing pantographs; and the pantograph identification and positioning is to input the image to be identified, input the HOG feature extraction result into a pantograph classification model and identify and position the pantograph in the image to be identified through HOG feature extraction. The method for positioning the pantograph image contained in the image to be recognized after the image preprocessing step is carried out by adopting the HOG + SVM method comprises the following steps: the original size of a general pantograph image is relatively large, for example 2048 × 1080, and a foreground region (including a pantograph) to be detected occupies about 1/5 of the size of the image, so that it will take time to directly perform algorithm processing on a full map, and in addition, since a background of the pantograph image is relatively complicated and changeable, when the full map processing is directly performed, the detection effect is easily influenced by background interference, which causes inaccuracy. Therefore, after image preprocessing is carried out, the pantograph is positioned by adopting a hog + svm method, so that the detection efficiency of a subsequent algorithm is improved, and the interference is reduced.
The method for extracting the features of the sample image by the HOG feature extraction specifically comprises the following steps:
normalization processing, because the shot pantograph images have different illumination conditions, each image needs to be normalized to reduce the influence of illumination factors and local shadows
I(x,y)=I(x,y)gammaWherein (x, y) is a pixel point of the image;
carrying out gradient calculation on the x direction and the y direction of the image, wherein the gradient calculation is to further weaken the influence of illumination, and the gradient of pixel points (x, y) in the image is
Gx(x,y)=H(x+1,y)-H(x-1,y)
Gy(x,y)=H(x,y+1)-H(x,y-1)
According to the above formula, the gradient amplitude at the pixel point (x, y) can be obtained
Figure BDA0002369390660000071
And direction of gradient
Figure BDA0002369390660000072
And (3) feature synthesis, traversing each pixel point in the sample image, calculating to obtain gradient amplitude values and gradient direction values of all the pixel points, performing organic combination in a certain mode on all the gradient amplitude values and the gradient directions, and performing histogram statistical calculation to obtain the HOG feature of the whole image.
The HOG characteristics of the pantograph images and the non-pantograph images in the sample images are classified through an SVM training method, and the HOG characteristics of the linearly separable sample images are classified through an optimal classification line, and the HOG characteristics of the non-linearly separable sample images are classified through an optimal classification hyperplane.
Specifically, for a linearly separable sample image HOG feature point, let { (x)i,yi) N is a set of N sample images, where x is 1iFor each sample image, yi1 or-1 represents xiThe class to which the positive sample belongs may be represented as 1, and the class to which the negative sample belongs may be represented as-1;
the sample images are classified by using the classification standard to form a linear equation Y which is w.X + b, wherein X represents all the sample images XiY represents all of YiW represents a weight, and b is an offset; i.e. it means that there is a sample xiWhether the sample belongs to the class of the positive sample or the class of the negative sample;
and searching an optimal classification line to separate different classes, and simultaneously enabling the classification interval to be maximum, so that the two classes of samples simultaneously meet the condition that Y is greater than or equal to 1, and the classification interval is equal to 2/| | w |. Since Y ═ 0 is a classification line of positive and negative samples in a two-dimensional space, when Y ═ 1 or-1, the distance from a point on the line Y ═ 1 or-1 to the line Y ═ 0 is calculated as Y/| | | w | |, and i.e., 2/| | w |, the classification interval maximization is equivalent to the following optimization problem: minG (w) | | w | | non-woven phosphor2So that y isi[(w·xi)+b]-1 ≧ 0, i ≧ 1i[(w·x)+b]The training samples with-1-0 are called support vectors.
Constructing lagrange functions
Figure BDA0002369390660000073
Thereby converting into a quadratic programming problem of the formulaWherein a ═ a1,a2,...,aN) Is the lagrange multiplier. minG (w) | | w | | non-woven phosphor2The minimum value in the range is the saddle point of Lagrange function, and the partial derivative function of w and b can be obtained through L and calculated to be converted into minG (w | | | w | | the sweet hair through the operation that L is equal to 02The dual problem of (2), solving a function
Figure BDA0002369390660000081
Is measured.
The constraint condition is
Figure BDA0002369390660000082
If it is
Figure BDA0002369390660000083
For its optimal solution, then
Figure BDA0002369390660000084
Figure BDA0002369390660000085
Thus, the optimal classification function is
Figure BDA0002369390660000086
Wherein sgn refers to a sign function in calculus mathematics, 1 is taken when an independent variable is a positive number, 0 is taken as 0, and a negative number is taken as-1; in the formula (10), x is an independent variable.
And for the HOG characteristic points of the sample images which can be divided in a nonlinear way, mapping the sample characteristic points to a high-dimensional characteristic space by using a nonlinear function phi, and carrying out linear classification in the characteristic space. If the mapping φ can be found, then the inner product operation (x)iX) can be represented by (phi (x)i) φ (x)) instead, usually with a kernel function K (x)i,x)=(φ(xi) φ (x)) represents the inner product operation, and thus the optimal classification hyperplane can be represented as
Figure BDA0002369390660000087
The positive and negative sample images of the pantograph can be trained and learned through the optimal classification function, and finally a pantograph classification model is obtained.
Inputting an image to be recognized, setting a window size w1 h1 and a window sliding parameter omega, sliding the window in the x direction and the y direction by taking omega as step length, intercepting the image to be recognized into a plurality of small graphs with the size of w1 h1, calculating according to the HOG feature extraction method to obtain the HOG feature of each small graph, then comparing the HOG feature of the small graphs with a pantograph classification model by adopting a nearest neighbor method, if the HOG feature of the small graphs is similar to a positive sample of the classification model, detecting the pantograph, and otherwise, detecting no pantograph. Those skilled in the art will appreciate that the window size coincides or approximately coincides with the size of the sample image.
And a pantograph contour extraction step, namely performing image enhancement on the image to be identified after the pantograph positioning step, then performing fixed thresholding, performing binary segmentation on the image to be identified by adopting a binarization method, traversing all pixels of the image to be identified, and extracting foreground pixels by taking the pixel values as extraction standards.
Specifically, the image enhancement of the image to be recognized is to increase the contrast between the outer edge area of the pantograph cavel of the image and a background image, the outer edge of the cavel in the enhanced image to be recognized is darker, and the background is relatively lighter, so that the image can be subjected to fixed thresholding, a low pixel range area in the image is extracted, and then the whole area subjected to thresholding is subjected to connected domain calculation to obtain areas with different properties; and then, performing morphological opening operation processing on the connected domain image, removing small isolated interference regions, calculating a circumscribed rectangle of each region, and calculating the characteristics of the area, the length, the width and the like of each region on the basis. By setting a certain threshold, the area meeting the threshold condition is screened out, and the pixels of the strengthened pantograph are lower in the edge area of the goat's horn and the gap area between the goat's horn and the sliding plate. According to the characteristic, a binarization method is adopted to perform binary segmentation on the pantograph image, all pixels of the pantograph image are traversed, and pixels with pixel values ranging from 0 to N are extracted as foreground pixels, wherein N is a set foreground pixel threshold value, and preferably, N is 5; the binarized image contains many interference regions, and the interference regions need to be screened out by solving the characteristics of each region: solving a connected domain of the image after the binarization of the image; removing isolated small regions and noise points by adopting a morphological open operation algorithm; and calculating the area of each region, circumscribing a rectangle, and removing interference through the characteristics of the area size, the length, the width and the like of each region.
Extracting key contours, namely extracting regions on the left side and the right side of the pantograph from the image to be identified processed in the pantograph contour extraction step, carrying out contour segmentation on the central line of the extracted regions, sequentially calculating the maximum value of the longitudinal coordinate of each contour in a traversal mode on the segmented contours, sequencing the maximum value of the longitudinal coordinate of each contour from large to small, and taking the contour corresponding to the last sequenced longitudinal coordinate and the contour where the first sequenced longitudinal coordinate is located as the key contour; the region of interest is extracted only by the region, and the key points cannot be accurately calculated by the region of interest. The extracted region needs to be subjected to skeleton extraction, that is, the extracted region of interest is reduced from a multi-pixel width to a unit pixel width, which can also be called as extracting a center line of the region of interest. The contour segmentation is carried out on the extracted region central line so as to facilitate the subsequent calculation of the length of the sliding plate and the length of the bow head.
And a key point extraction step, namely extracting the central line outline of the gap between the slide plate and the horn and the central line outline of the edge of the horn in the key outline to obtain the key points of the pantograph slide plate and the horn.
In the key point extraction step, extracting key points of the sliding plate, traversing the abscissa of all points on the outline of the central line of the gap between the sliding plate and the cavel, and solving the average of the abscissas as the x coordinate of the key point of the sliding plate; and sorting the vertical coordinates of all the contour points, and selecting the maximum value of the vertical coordinates as the y coordinate of the key point of the slide plate.
In the key point extraction step, the key points of the goat horn are extracted, coordinate points of the outline of the central line of the edge of the goat horn are sorted from big to small in the vertical coordinate direction, the abscissa of all points in the key point set is traversed, and the average of the abscissas is taken as the x coordinate of the key points of the goat horn; and taking the maximum value of the ordinate in the key point set as the y coordinate of the key point of the goat horn. Preferably, in order to reduce the calculation error of the key points, the top 20 coordinate point sets of the sorted coordinate points are intercepted as the cavel key point set for calculation of the cavel key points.
The extracted key contour comprises a sliding plate and cavel gap center line contour and a cavel edge center line contour, which need to be distinguished, thereby facilitating the subsequent accurate extraction of sliding plate key points and cavel key pointsyIf the central line profile is smaller than the set threshold value, the central line profile is judged to be the central line profile of the edge of the goat's horn, otherwise, the central line profile of the gap between the sliding plate and the goat's horn is judged.
And calculating the length of the pantograph slide plate, the length of the pantograph head and the height of the pantograph head according to the result of the key point extraction step, comparing the calculated length of the slide plate, the calculated length of the pantograph head, the calculated height of the pantograph head and a standard value, and judging that the pantograph structure has an abnormal phenomenon.
Specifically, the length of the pantograph slide plate is calculated by using the found key points of the slide plates at the left end and the right end of the pantograph according to a linear distance calculation method between the two points.
The length of the pantograph head of the pantograph is calculated by using the found key points of the goat's horn at the left end and the right end of the pantograph according to a linear distance calculation method between the two points.
The pantograph head height is calculated by finding out a sliding plate middle point m1 according to sliding plate key points at the left end and the right end of the pantograph, calculating a goat's horn middle point m2 according to goat's horn key points at the left end and the right end of the pantograph and calculating the pantograph head height according to the two middle points.

Claims (9)

1. The pantograph structure abnormity detection algorithm based on image processing is characterized by comprising the following steps of:
an image preprocessing step, namely removing noise in an image to be identified;
a pantograph positioning step, which specifically comprises pantograph classification model establishment and pantograph identification positioning; the pantograph classification model establishment comprises the steps of carrying out feature extraction on sample images by an HOG feature extraction method to obtain HOG features of each sample image, and then carrying out training learning on HOG features of pantograph images and non-pantograph images in the sample images by an SVM classification model to obtain a pantograph classification model; the pantograph positioning step is to input an image to be identified, input an HOG feature extraction result into a pantograph classification model through HOG feature extraction, and identify and position a pantograph in the image to be identified;
a pantograph contour extraction step, namely performing image enhancement on the image to be identified subjected to the pantograph positioning step, then performing fixed thresholding, performing binary segmentation on the image to be identified by adopting a binarization method, traversing all pixels of the image to be identified, and extracting foreground pixels by taking pixel values as extraction standards;
extracting key contours, namely extracting regions on the left side and the right side of the pantograph from the image to be identified processed in the pantograph contour extraction step, carrying out contour segmentation on the central line of the extracted regions, sequentially calculating the maximum value of the longitudinal coordinate of each contour in a traversal mode on the segmented contours, sequencing the maximum value of the longitudinal coordinate of each contour from large to small, and taking the contour corresponding to the last sequenced longitudinal coordinate and the contour where the first sequenced longitudinal coordinate is located as the key contour;
a key point extraction step, namely extracting the central line outline of the gap between the slide plate and the cavel and the central line outline of the cavel edge in the key outline to obtain key points including the pantograph slide plate and the cavel end points;
and parameter calculation and abnormity judgment steps, wherein the length of the pantograph slide plate, the length of the pantograph head of the pantograph and the height of the pantograph head of the pantograph are calculated according to the result of the key point extraction step, the calculated length of the slide plate, the calculated length of the pantograph head, the calculated height of the pantograph head and a standard value are compared, and whether the structure of the pantograph has an abnormal phenomenon is judged.
2. The image processing-based pantograph structure abnormality detection algorithm of claim 1, wherein: the image preprocessing step is to adopt a Gaussian filtering method to filter noise generated in the process of acquiring the image to be identified; aiming at the conditions of uneven illumination and low image contrast, a histogram equalization method is adopted to perform image enhancement on the image to be recognized and improve the image contrast.
3. The image processing-based pantograph structure abnormality detection algorithm of claim 1, wherein: in the establishment of the classification model of the pantograph, the sample images comprise positive and negative samples of the pantograph, the positive samples are images containing the pantograph, and the negative samples are any images without the pantograph.
4. The image processing-based pantograph structure abnormality detection algorithm according to claim 1, wherein the feature extraction is performed on the sample image or the image to be identified by using a HOG feature extraction method, and the method specifically comprises the following steps:
normalization process, I (x, y) ═ I (x, y)gammaWherein (x, y) is a pixel point of the image;
carrying out gradient calculation on the x direction and the y direction of the image, wherein the gradient of a pixel point (x, y) in the image is
Gx(x,y)=H(x+1,y)-H(x-1,y)
Gy(x,y)=H(x,y+1)-H(x,y-1),
And the gradient amplitude at the pixel point (x, y) can be obtained
Figure FDA0002369390650000021
And direction of gradient
Figure FDA0002369390650000022
And (3) feature synthesis, namely traversing each pixel point in the sample image or the image to be identified, calculating to obtain gradient amplitude values and gradient direction values of all the pixel points, combining all the gradient amplitude values and gradient directions, and then performing histogram statistical calculation to obtain the HOG feature of the whole image.
5. The image processing-based pantograph structure abnormality detection algorithm of claim 3, wherein: in the pantograph classification model establishment, HOG characteristics of a pantograph image and a non-pantograph image in a sample image are classified through an SVM training method, and the HOG characteristics comprise that HOG characteristic points of the linearly separable sample image are classified through an optimal classification line, and HOG characteristic points of the non-linearly separable sample image are classified through an optimal classification hyperplane.
6. The image processing-based pantograph structure abnormality detection algorithm of claim 1, wherein: in the step of extracting the pantograph contour, the image enhancement is carried out on the image to be recognized, namely the contrast between the outer edge area of the pantograph goat horn of the image and the background image is increased; then, carrying out fixed thresholding on the image and carrying out connected domain calculation on the whole thresholded region; performing morphological opening operation processing on the connected domain image; and (3) performing binary segmentation on the pantograph image by adopting a binarization method, traversing all pixels of the image, and extracting pixels with pixel values ranging from 0 to N as foreground pixels, wherein N is a set foreground pixel threshold value.
7. The image processing-based pantograph structure abnormality detection algorithm of claim 1, wherein: in the key point extraction step, an outline coordinate point p (x, y) is randomly extracted from any outline in the image to be recognized after the key outline extraction step, if py is smaller than a set threshold value, the outline is judged to be the central line outline of the edge of the goat horn, otherwise, the outline is judged to be the central line outline of the gap between the sliding plate and the goat horn.
8. The image processing-based pantograph structure abnormality detection algorithm of claim 7, wherein: in the key point extraction step, extracting key points of the sliding plate, traversing the abscissa of all points on the outline of the central line of the gap between the sliding plate and the cavel, and solving the average of the abscissas as the x coordinate of the key point of the sliding plate; sorting the vertical coordinates of all the contour points, and selecting the maximum value of the vertical coordinates as the y coordinate of the key point of the slide plate;
in the key point extraction step, the key points of the goat horn are extracted, coordinate points of the outline of the central line of the edge of the goat horn are sorted from big to small in the vertical coordinate direction, the abscissa of all points in the key point set is traversed, and the average of the abscissas is taken as the x coordinate of the key points of the goat horn; and taking the maximum value of the ordinate in the key point set as the y coordinate of the key point of the goat horn.
9. The image processing-based pantograph structure abnormality detection algorithm of claim 7, wherein: the length of the pantograph slide plate is calculated by using the found key points of the slide plates at the left end and the right end of the pantograph according to a linear distance calculation method between the two points;
the length of the pantograph head of the pantograph is calculated by using the found key points of the goat's horn at the left end and the right end of the pantograph according to a linear distance calculation method between the two points;
the pantograph head height is obtained by finding out the middle point of the sliding plate according to the key points of the sliding plates at the left and right ends of the pantograph, calculating the middle point of the goat horn according to the key points of the goat horn at the left and right ends, and calculating the pantograph head height according to the two middle points.
CN202010045931.9A 2020-01-16 2020-01-16 Pantograph structure abnormity detection algorithm based on image processing Pending CN111260629A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010045931.9A CN111260629A (en) 2020-01-16 2020-01-16 Pantograph structure abnormity detection algorithm based on image processing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010045931.9A CN111260629A (en) 2020-01-16 2020-01-16 Pantograph structure abnormity detection algorithm based on image processing

Publications (1)

Publication Number Publication Date
CN111260629A true CN111260629A (en) 2020-06-09

Family

ID=70950587

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010045931.9A Pending CN111260629A (en) 2020-01-16 2020-01-16 Pantograph structure abnormity detection algorithm based on image processing

Country Status (1)

Country Link
CN (1) CN111260629A (en)

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111738342A (en) * 2020-06-24 2020-10-02 西南交通大学 Pantograph foreign matter detection method, storage medium and computer equipment
CN111862023A (en) * 2020-07-14 2020-10-30 苏州华启智能科技有限公司 Pantograph structure abnormity detection method based on computer vision
CN112053300A (en) * 2020-09-01 2020-12-08 国交空间信息技术(北京)有限公司 Method, device and equipment for correcting image with uneven illumination
CN112330597A (en) * 2020-10-14 2021-02-05 浙江大华技术股份有限公司 Image difference detection method and device and computer equipment
CN112365481A (en) * 2020-11-13 2021-02-12 哈尔滨市科佳通用机电股份有限公司 Method for detecting bolt loss of cross beam assembly based on image processing
CN112529928A (en) * 2020-12-28 2021-03-19 晟通科技集团有限公司 Part assembly detection method, computer device and storage medium
CN112541894A (en) * 2020-12-11 2021-03-23 无锡雷德环保设备有限公司 Product deformation detection method
CN112950532A (en) * 2021-01-14 2021-06-11 成都铁安科技有限责任公司 Train pantograph state detection method
CN112991318A (en) * 2021-03-31 2021-06-18 中车青岛四方机车车辆股份有限公司 Motor train unit pantograph fault detection method and device and storage medium
CN113362330A (en) * 2021-08-11 2021-09-07 昆山高新轨道交通智能装备有限公司 Pantograph cavel real-time detection method, device, computer equipment and storage medium
CN113436157A (en) * 2021-06-18 2021-09-24 西南交通大学 Vehicle-mounted image identification method for pantograph fault
CN113487561A (en) * 2021-07-02 2021-10-08 成都唐源电气股份有限公司 Pantograph foreign matter detection method and device based on gray gradient abnormal voting
CN113989666A (en) * 2021-10-26 2022-01-28 中科海拓(无锡)科技有限公司 High-speed rail pantograph abnormity detection method
CN117911792A (en) * 2024-03-15 2024-04-19 垣矽技术(青岛)有限公司 Pin detecting system for voltage reference source chip production
CN117911792B (en) * 2024-03-15 2024-06-04 垣矽技术(青岛)有限公司 Pin detecting system for voltage reference source chip production

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107590441A (en) * 2017-08-21 2018-01-16 南京理工大学 A kind of pantograph goat's horn on-line measuring device and method based on image procossing
CN108694349A (en) * 2017-04-07 2018-10-23 成都唐源电气股份有限公司 A kind of pantograph image extraction method and device based on line-scan digital camera
CN109029539A (en) * 2018-05-07 2018-12-18 南京理工大学 A kind of municipal rail train pantograph goat's horn monitoring device and method
WO2019000653A1 (en) * 2017-06-30 2019-01-03 清华大学深圳研究生院 Image target identification method and apparatus
CN109961429A (en) * 2019-03-22 2019-07-02 武汉工程大学 A kind of pantograph detection localization method and system based on monocular infrared image

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108694349A (en) * 2017-04-07 2018-10-23 成都唐源电气股份有限公司 A kind of pantograph image extraction method and device based on line-scan digital camera
WO2019000653A1 (en) * 2017-06-30 2019-01-03 清华大学深圳研究生院 Image target identification method and apparatus
CN107590441A (en) * 2017-08-21 2018-01-16 南京理工大学 A kind of pantograph goat's horn on-line measuring device and method based on image procossing
CN109029539A (en) * 2018-05-07 2018-12-18 南京理工大学 A kind of municipal rail train pantograph goat's horn monitoring device and method
CN109961429A (en) * 2019-03-22 2019-07-02 武汉工程大学 A kind of pantograph detection localization method and system based on monocular infrared image

Cited By (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111738342A (en) * 2020-06-24 2020-10-02 西南交通大学 Pantograph foreign matter detection method, storage medium and computer equipment
CN111738342B (en) * 2020-06-24 2022-06-28 西南交通大学 Pantograph foreign matter detection method, storage medium and computer equipment
CN111862023A (en) * 2020-07-14 2020-10-30 苏州华启智能科技有限公司 Pantograph structure abnormity detection method based on computer vision
CN112053300A (en) * 2020-09-01 2020-12-08 国交空间信息技术(北京)有限公司 Method, device and equipment for correcting image with uneven illumination
CN112053300B (en) * 2020-09-01 2023-11-21 国交空间信息技术(北京)有限公司 Correction method, device and equipment for illumination non-uniform image
CN112330597A (en) * 2020-10-14 2021-02-05 浙江大华技术股份有限公司 Image difference detection method and device and computer equipment
CN112365481A (en) * 2020-11-13 2021-02-12 哈尔滨市科佳通用机电股份有限公司 Method for detecting bolt loss of cross beam assembly based on image processing
CN112541894A (en) * 2020-12-11 2021-03-23 无锡雷德环保设备有限公司 Product deformation detection method
CN112541894B (en) * 2020-12-11 2023-12-08 无锡雷德环保设备有限公司 Product deformation detection method
CN112529928A (en) * 2020-12-28 2021-03-19 晟通科技集团有限公司 Part assembly detection method, computer device and storage medium
CN112950532B (en) * 2021-01-14 2024-04-16 成都铁安科技有限责任公司 Train pantograph state detection method
CN112950532A (en) * 2021-01-14 2021-06-11 成都铁安科技有限责任公司 Train pantograph state detection method
CN112991318A (en) * 2021-03-31 2021-06-18 中车青岛四方机车车辆股份有限公司 Motor train unit pantograph fault detection method and device and storage medium
CN113436157A (en) * 2021-06-18 2021-09-24 西南交通大学 Vehicle-mounted image identification method for pantograph fault
CN113436157B (en) * 2021-06-18 2022-11-22 西南交通大学 Vehicle-mounted image identification method for pantograph fault
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
CN113362330A (en) * 2021-08-11 2021-09-07 昆山高新轨道交通智能装备有限公司 Pantograph cavel real-time detection method, device, computer equipment and storage medium
CN113989666B (en) * 2021-10-26 2023-01-31 中科海拓(无锡)科技有限公司 High-speed rail pantograph abnormity detection method
CN113989666A (en) * 2021-10-26 2022-01-28 中科海拓(无锡)科技有限公司 High-speed rail pantograph abnormity detection method
CN117911792A (en) * 2024-03-15 2024-04-19 垣矽技术(青岛)有限公司 Pin detecting system for voltage reference source chip production
CN117911792B (en) * 2024-03-15 2024-06-04 垣矽技术(青岛)有限公司 Pin detecting system for voltage reference source chip production

Similar Documents

Publication Publication Date Title
CN111260629A (en) Pantograph structure abnormity detection algorithm based on image processing
CN109753929B (en) High-speed rail insulator inspection image recognition method
CN109658387B (en) Method for detecting defects of pantograph carbon slide plate of electric train
CN104809732B (en) A kind of power equipment appearance method for detecting abnormality compared based on image
CN102902974B (en) Image based method for identifying railway overhead-contact system bolt support identifying information
CN111738342B (en) Pantograph foreign matter detection method, storage medium and computer equipment
Liang et al. Defect detection of rail surface with deep convolutional neural networks
CN103745224A (en) Image-based railway contact net bird-nest abnormal condition detection method
CN111091544B (en) Method for detecting breakage fault of side integrated framework of railway wagon bogie
CN108680833B (en) Composite insulator defect detection system based on unmanned aerial vehicle
CN111784633A (en) Insulator defect automatic detection algorithm for power inspection video
CN111814686A (en) Vision-based power transmission line identification and foreign matter invasion online detection method
CN106778833A (en) Small object loses the automatic identifying method of failure under a kind of complex background
CN105044122A (en) Copper part surface defect visual inspection system and inspection method based on semi-supervised learning model
Aydin A new approach based on firefly algorithm for vision-based railway overhead inspection system
CN108694349B (en) Pantograph image extraction method and device based on linear array camera
CN111080691A (en) Infrared hot spot detection method and device for photovoltaic module
CN110751619A (en) Insulator defect detection method
CN108009574B (en) Track fastener detection method
CN108508023B (en) Defect detection system for contact end jacking bolt in railway contact network
Prasongpongchai et al. A vision-based method for the detection of missing rail fasteners
CN112508911A (en) Rail joint touch net suspension support component crack detection system based on inspection robot and detection method thereof
CN111667655A (en) Infrared image-based high-speed railway safety area intrusion alarm device and method
CN106650752A (en) Vehicle body color recognition method
CN111597939B (en) High-speed rail line nest defect detection method based on deep learning

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20200609

RJ01 Rejection of invention patent application after publication