CN110717900B - Pantograph abrasion detection method based on improved Canny edge detection algorithm - Google Patents
Pantograph abrasion detection method based on improved Canny edge detection algorithm Download PDFInfo
- Publication number
- CN110717900B CN110717900B CN201910921337.9A CN201910921337A CN110717900B CN 110717900 B CN110717900 B CN 110717900B CN 201910921337 A CN201910921337 A CN 201910921337A CN 110717900 B CN110717900 B CN 110717900B
- Authority
- CN
- China
- Prior art keywords
- pantograph
- image
- value
- calculating
- minimum
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
- G06T7/0004—Industrial image inspection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/11—Region-based segmentation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/13—Edge detection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/136—Segmentation; Edge detection involving thresholding
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/40—Analysis of texture
- G06T7/41—Analysis of texture based on statistical description of texture
- G06T7/44—Analysis of texture based on statistical description of texture using image operators, e.g. filters, edge density metrics or local histograms
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Quality & Reliability (AREA)
- Probability & Statistics with Applications (AREA)
- Image Analysis (AREA)
- Length Measuring Devices By Optical Means (AREA)
Abstract
The invention discloses a pantograph abrasion detection method based on an improved Canny edge detection algorithm. The method comprises the following steps: firstly, carrying out smooth filtering on an original image by using an improved Kalman filtering method, converting the filtered image into a binary image, and drawing a relation graph of gray level and line number of each line of the binary image; then, positioning the pantograph position by using a simulated annealing algorithm and a hill climbing method, and segmenting the pantograph position from the background image; then, obtaining a pantograph edge contour map by using an improved Canny edge detection algorithm; and finally, calculating the minimum pixel difference value of the upper edge and the lower edge of the pantograph, and finally calculating the wear value of the pantograph through camera calibration and the obtained minimum pixel difference value. The invention has the advantages of accurate positioning, high effectiveness and strong adaptability.
Description
Technical Field
The invention relates to the technical field of pantograph detection, in particular to a pantograph abrasion detection method based on an improved Canny edge detection algorithm.
Background
With the rapid development of national socioeconomic and the continuous promotion of urbanization progress, urban subways are developed quite rapidly, but the online monitoring of train pantographs by various domestic units and companies is still in a test stage, the experimental results cannot be popularized and applied, and the overhaul of the train pantographs by the subway companies still depends on the traditional manual overhaul method.
Image detection methods are one of the major directions of domestic research. The current method for positioning the sliding plate in pantograph detection mainly calculates the gray scale change rate along a certain direction, and divides the change rate by taking the empirical value as a boundary according to the empirical value obtained by analyzing a large number of pictures. When the gray scale change rate is greatly changed due to changes of the target position, the illumination condition and the like in the shot image, the segmentation result has larger deviation. In addition, this method is difficult to effectively separate two sliding plates of the pantograph, and analysis of a single sliding plate cannot be realized.
Disclosure of Invention
The invention aims to provide a pantograph abrasion detection method based on an improved Canny edge detection algorithm, which is accurate in positioning, high in effectiveness and strong in adaptability.
The technical solution for realizing the purpose of the invention is as follows: a pantograph abrasion detection method based on an improved Canny edge detection algorithm comprises the following steps:
step 1, carrying out smooth filtering on a target image by using an improved Kalman filtering method to remove noise;
step 2, converting the filtered target image into a binary image by using an iterative optimal threshold method, and drawing a relation graph of the gray level of each line and the line number of the binary image;
step 3, positioning the position of the pantograph by using a simulated annealing algorithm and a hill climbing method, and segmenting a target pantograph to be detected from a background image;
step 4, obtaining a pantograph edge contour map by using an improved Canny edge detection algorithm;
and 5, calculating the minimum pixel difference value of the upper edge and the lower edge, and calculating the wear value of the pantograph through camera calibration and the obtained minimum pixel difference value.
Further, the step 1 of performing smooth filtering on the target image by using an improved kalman filtering method to remove noise specifically includes:
a two-dimensional fractional order random discrete space state model is constructed by using a Kalman filtering method based on a two-dimensional fractional order differential mask, a two-dimensional discrete Kalman filtering algorithm is designed based on the constructed state model, and the formula is as follows:
s(x,y)=s′(x,y)+K(x,y)[r(x,y)-Cs′(x,y)]
wherein s (x, y) is a filter estimation equation, s' (x, y) is a one-step prediction equation of the system state, K (x, y) is a filter gain equation, r (x, y) is an image measurement value, and C is a measurement matrix.
Further, the step 2 of converting the filtered target image into a binary image by using an iterative optimal threshold method, and drawing a relation graph of gray level and line number of each line of the binary image, specifically as follows:
step 2.1, determining the imageSetting an initial threshold value T according to the maximum gray value H and the minimum gray value L 0 Comprises the following steps:
step 2.2, according to the initial threshold value T 0 An image is divided into a target and a background, and an average gradation value A of the target is obtained b And the average gray value A of the background f :
The formula g is the gray value of a certain pixel point in the image, and h (g) is the number of the pixel points with the gray value of g;
step 2.3, calculate the new threshold T k The formula is as follows:
if T k =T k+1 Then T is k Entering step 2.4 for the calculated threshold value; otherwise, the step 2.2 is carried out to continue iteration;
step 2.4, utilizing the obtained threshold value T k And obtaining a binary image, and drawing a relation graph of the gray level of each line of the binary image and the corresponding line number.
Further, the positioning of the pantograph position by using the simulated annealing algorithm and the hill climbing method in step 3 divides the target pantograph to be detected from the background image, which specifically includes:
3.1, calculating all local maximum values including a global maximum value of the pixel sum in the relation image obtained in the step 2.4 by using a simulated annealing algorithm;
step 3.2, with each local maximum as a starting point, respectively searching two sides of a row where the local maximum is located by utilizing the characteristic that a hill climbing method can search the local maximum to find a minimum value with the closest distance between the two sides;
and 3.3, dividing the pantograph from the background image by using the range framed by each local maximum value and the corresponding minimum values of the two sides of the local maximum value, namely the range of the upper edge and the lower edge of each pantograph.
Further, the step 4 of obtaining the pantograph edge profile map by using the improved Canny edge detection algorithm specifically includes the following steps:
step 4.1, obtaining a gradient histogram of the image, and finding out an amplitude peak value H max Calculating the mean square error sigma:
wherein N is the total number of image pixels, H i The gradient amplitude of the ith pixel point is obtained;
step 4.2, calculate the high threshold T h :
T h =H max +σ
Step 4.3, removing gradient with amplitude higher than T h After the pixel points are obtained, the gradient amplitude histogram statistics is carried out on the residual image again, and a new peak value H 'is calculated' max And new mean square error σ':
wherein N' is the total number of pixel points of the residual image, H i The gradient amplitude of the ith pixel point in the residual image is obtained;
step 4.4, calculate the low threshold T l :
T l =H′ max +σ′
Further, the minimum pixel difference of the upper edge and the lower edge is calculated in step 5, and the wear value of the pantograph is calculated by calibrating the camera and the obtained minimum pixel difference, specifically as follows:
step 5.1, sequentially calculating pixel difference values of upper and lower edges from left to right according to the edge contour map of the pantograph obtained in the step 4, and taking the minimum value as a finally obtained abrasion pixel value;
and 5.2, calibrating by a camera to obtain the corresponding relation between the minimum pixel difference and the distance in the physical space, thereby obtaining the actual abrasion value.
Compared with the prior art, the invention has the following remarkable advantages: (1) The pantograph is positioned based on a simulated annealing algorithm and a climbing method, so that the position of each pantograph can be effectively and accurately positioned; (2) The improved Canny algorithm based on the self-adaptive threshold value is used for positioning the edge contour diagram of the pantograph, so that the adaptability of positioning the pantograph under different illumination conditions is enhanced.
Drawings
Fig. 1 is a schematic flow chart of the pantograph abrasion detection method based on the improved Canny edge detection algorithm.
Fig. 2 is a binary map obtained by using an iterative optimal threshold method according to an embodiment of the present invention.
FIG. 3 is a graph of the gray scale per line and the number of lines of an image in accordance with an embodiment of the present invention.
Fig. 4 is a contour diagram of the pantograph divided by a simulated annealing algorithm and a hill climbing method in the embodiment of the invention.
Fig. 5 is a pantograph edge profile obtained by improving Canny edge detection in an embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the figures and the specific embodiments.
With reference to fig. 1, the pantograph abrasion detection method based on the improved Canny edge detection algorithm of the present invention includes the following steps:
step 1: carrying out smooth filtering on the target image by utilizing an improved Kalman filtering method to remove noise, specifically:
and for the obtained initial image, constructing a two-dimensional fractional order random discrete space state model by using a Kalman filtering method based on a two-dimensional fractional order differential mask. Fractional order differentiation is the popularization of integer order differentiation, and can greatly identify the singularity of a signal and extract a target object. When the differential order is smaller, the high-frequency component in the signal is greatly enhanced, meanwhile, the low-frequency component is correspondingly enhanced, and the very low frequency is not lost, so that the defect of detail loss caused by the traditional Kalman filtering is effectively overcome.
Designing a two-dimensional discrete Kalman filtering algorithm based on the constructed state model, wherein a filtering estimation equation is as follows:
s(x,y)=s′(x,y)+K(x,y)[r(x,y)-Cs′(x,y)]
wherein s (x, y) is a filter estimation equation, s' (x, y) is a one-step prediction equation of the system state, K (x, y) is a filter gain equation, r (x, y) is an image measurement value, and C is a measurement matrix.
Step 2, converting the filtered target image into a binary image by using an iterative optimal threshold method, and drawing a relation graph of gray scale and line number of each line of the binary image, wherein the specific steps are as follows:
step 2.1, solving the maximum gray value H and the minimum gray value L of the image, and setting an initial threshold value T 0 Comprises the following steps:
step 2.2, according to the initial threshold value T 0 An image is divided into a target and a background, and an average gradation value A of the target is obtained b And the average gray value A of the background f :
The above formula g is the gray value of a certain pixel in the image, hg) is the number of pixels with gray value g.
Step 2.3, calculate the new threshold T k The formula is as follows:
if T k =T k+1 Then T is k Entering step 2.4 for the calculated threshold value; otherwise, the step 2.2 is carried out to continue iteration;
step 2.4, utilizing the obtained threshold value T k And obtaining a binary image, and drawing a relation graph of the gray level of each line of the binary image and the corresponding line number.
Step 3, positioning the pantograph position by using a simulated annealing algorithm and a hill climbing method, and segmenting a target pantograph to be detected from a background image, wherein the method specifically comprises the following steps:
3.1, calculating all local maxima of the pixel sum in the relation graph obtained in the step 2.4 by using a simulated annealing algorithm, wherein the local maxima comprise a global maximum;
3.2, with each local maximum as a starting point, searching two sides of a row where the local maximum is located respectively by utilizing the characteristic that a hill climbing method can search the local maximum, and finding out a minimum value with the closest distance between the two sides;
and 3.3, dividing the pantograph from the background image by the aid of the framed range corresponding to each local maximum value and the minimum values on the two sides of the local maximum value, namely the range of the upper edge and the lower edge of each pantograph.
Step 4, obtaining a pantograph edge contour map by using an improved Canny edge detection algorithm, which comprises the following specific steps:
step 4.1, obtaining a gradient histogram of the image, and finding out an amplitude peak value H max Calculating the mean square error sigma:
wherein N is the total number of image pixels, H i The gradient amplitude of the ith pixel point is obtained;
step 4.2, calculate the high threshold T h :
T h =H max +σ
Step 4.3, removing gradient with amplitude higher than T h After the pixel points are obtained, the gradient amplitude histogram statistics is carried out on the residual image again, and a new peak value H 'is calculated' max And new mean square error σ':
wherein N' is the total number of pixel points of the residual image, H i The gradient amplitude of the ith pixel point in the residual image is obtained;
step 4.4, calculate the low threshold T l :
T l =H′ max +σ′
Step 5, calculating the minimum pixel difference value of the upper edge and the lower edge, and calculating the wear value of the pantograph through camera calibration and the obtained minimum pixel difference value, wherein the method specifically comprises the following steps:
step 5.1, sequentially calculating pixel difference values of upper and lower edges from left to right according to the edge contour map of the pantograph obtained in the step 4, and taking the minimum value as a finally obtained abrasion pixel value;
and 5.2, calibrating by a camera to obtain the corresponding relation between the minimum pixel difference and the distance in the physical space, thereby obtaining the actual abrasion value.
Example 1
According to one embodiment of the invention, the pantograph abrasion detection method based on the improved Canny edge detection algorithm is utilized for detecting the pantograph abrasion of a certain pantograph.
Fig. 2 is a binary image obtained by using an iterative optimal threshold method, and it can be seen that the obtained binary image can clearly mark the position of the pantograph in the original image and maximally filter the interference of other objects.
Fig. 3 is a graph of gray scale of each line of an image and a relationship between line number and line number, the image is in a multi-peak shape, and the process from a certain peak valley to the peak top to the peak valley is from the upper edge to the center to the lower edge of the pantograph, so that the local maxima can be well searched by a simulated annealing algorithm and a hill climbing method when different images are faced.
Fig. 4 is a pantograph profile obtained by segmenting through a simulated annealing algorithm and a hill climbing method, and the pantograph profile obtained by segmenting through the simulated annealing algorithm and the hill climbing method from an original image, and it can be seen that the pantograph profile is accurately positioned at the upper edge and the lower edge, and interference of edges of other pantographs is filtered.
Fig. 5 is a pantograph edge contour diagram obtained by improving Canny edge detection, which is obtained by performing edge detection on a pantograph image by improving a Canny algorithm, and it can be seen that points corresponding to minimum values of pixel differences at the last upper and lower edges can be detected accurately.
Claims (1)
1. A pantograph abrasion detection method based on an improved Canny edge detection algorithm is characterized by comprising the following steps:
step 1, performing smooth filtering on a target image by using an improved Kalman filtering method to remove noise;
step 2, converting the filtered target image into a binary image by using an iterative optimal threshold method, and drawing a relation graph of the gray level of each line and the line number of the binary image;
step 3, positioning the position of the pantograph by using a simulated annealing algorithm and a hill climbing method, and segmenting a target pantograph to be detected from a background image;
step 4, obtaining a pantograph edge contour map by using an improved Canny edge detection algorithm;
step 5, calculating the minimum pixel difference value of the upper edge and the lower edge, and calculating the wear value of the pantograph through camera calibration and the obtained minimum pixel difference value;
step 1, performing smooth filtering on the target image by using an improved Kalman filtering method to remove noise, specifically as follows:
a two-dimensional fractional order random discrete space state model is constructed by using a Kalman filtering method based on a two-dimensional fractional order differential mask, a two-dimensional discrete Kalman filtering algorithm is designed based on the constructed state model, and the formula is as follows:
s(x,y)=s′(x,y)+K(x,y)[r(x,y)-Cs′(x,y)]
wherein s (x, y) is a filter estimation equation, s' (x, y) is a one-step prediction equation of the system state, K (x, y) is a filter gain equation, r (x, y) is an image measurement value, and C is a measurement matrix;
step 2, converting the filtered target image into a binary image by using an iterative optimal threshold method, and drawing a relation graph of gray level and line number of each line of the binary image, wherein the specific steps are as follows:
step 2.1, solving the maximum gray value H and the minimum gray value L of the image, and setting an initial threshold value T 0 Comprises the following steps:
step 2.2, according to the initial threshold value T 0 An image is divided into a target and a background, and an average gradation value A of the target is obtained b And the average gray value A of the background f :
The formula g is the gray value of a certain pixel point in the image, and h (g) is the number of the pixel points with the gray value of g;
step 2.3, calculate the new threshold T k The formula is as follows:
if T k =T k+1 Then T is k Entering step 2.4 for the calculated threshold value; otherwise, the step 2.2 is carried out to continue iteration;
step 2.4, utilizing the obtained threshold value T k Obtaining a binary image, anDrawing a relation graph of the gray level of each line of the binary image and the corresponding line number;
positioning the position of the pantograph by using a simulated annealing algorithm and a hill climbing method, and segmenting a target pantograph to be detected from a background image, wherein the method specifically comprises the following steps:
3.1, calculating all local maximum values including a global maximum value of the pixel sum in the relation image obtained in the step 2.4 by using a simulated annealing algorithm;
step 3.2, with each local maximum as a starting point, respectively searching two sides of a row where the local maximum is located by utilizing the characteristic that a hill climbing method can search the local maximum to find a minimum value with the closest distance between the two sides;
3.3, each local maximum and the range framed by the corresponding line of the minimum on the two sides of the local maximum are the range of the upper edge and the lower edge of each pantograph, so as to segment the pantograph from the background image;
and 4, obtaining a pantograph edge contour map by using an improved Canny edge detection algorithm, which comprises the following specific steps:
step 4.1, obtaining a gradient histogram of the image, and finding out an amplitude peak value H max Calculating the mean square error sigma:
wherein N is the total number of image pixels, H i The gradient amplitude of the ith pixel point is set;
step 4.2, calculate the high threshold T h :
T h =H max +σ
Step 4.3, removing gradient with amplitude higher than T h After the pixel points are obtained, the gradient amplitude histogram statistics is carried out on the residual image again, and a new peak value H 'is calculated' max And new mean square error σ':
wherein N' is the total number of pixel points of the remaining image, H i The gradient amplitude of the ith pixel point in the residual image is obtained;
step 4.4, calculate the low threshold T l :
T l =H′ max +σ′
Calculating the minimum pixel difference of the upper edge and the lower edge, and calculating the wear value of the pantograph through the camera calibration and the obtained minimum pixel difference, wherein the calculation method specifically comprises the following steps:
step 5.1, sequentially calculating pixel difference values of upper and lower edges from left to right according to the edge contour map of the pantograph obtained in the step 4, and taking the minimum value as a finally obtained abrasion pixel value;
and 5.2, calibrating by a camera to obtain the corresponding relation between the minimum pixel difference and the distance in the physical space, thereby obtaining the actual abrasion value.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910921337.9A CN110717900B (en) | 2019-09-27 | 2019-09-27 | Pantograph abrasion detection method based on improved Canny edge detection algorithm |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910921337.9A CN110717900B (en) | 2019-09-27 | 2019-09-27 | Pantograph abrasion detection method based on improved Canny edge detection algorithm |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110717900A CN110717900A (en) | 2020-01-21 |
CN110717900B true CN110717900B (en) | 2023-03-31 |
Family
ID=69210996
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910921337.9A Active CN110717900B (en) | 2019-09-27 | 2019-09-27 | Pantograph abrasion detection method based on improved Canny edge detection algorithm |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110717900B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112085725B (en) * | 2020-09-16 | 2021-08-27 | 塔里木大学 | Residual film residual quantity detection method and early warning system based on heuristic iterative algorithm |
CN113034531A (en) * | 2021-04-02 | 2021-06-25 | 广州绿怡信息科技有限公司 | Equipment placement detection method and device |
CN113487543B (en) * | 2021-06-16 | 2023-08-04 | 成都唐源电气股份有限公司 | Contact net arcing burning detection method, device, computer equipment and storage medium |
CN116147525B (en) * | 2023-04-17 | 2023-07-04 | 南京理工大学 | Pantograph contour detection method and system based on improved ICP algorithm |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107588733A (en) * | 2017-08-21 | 2018-01-16 | 南京理工大学 | A kind of abrasion of pantograph pan on-line measuring device and method based on image |
CN110086350B (en) * | 2019-05-30 | 2021-01-15 | 南京邮电大学 | Isolated bidirectional DC-DC efficiency optimization method based on simulated annealing-hill climbing hybrid algorithm |
-
2019
- 2019-09-27 CN CN201910921337.9A patent/CN110717900B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN110717900A (en) | 2020-01-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110717900B (en) | Pantograph abrasion detection method based on improved Canny edge detection algorithm | |
CN110428433B (en) | Canny edge detection algorithm based on local threshold | |
CN107808378B (en) | Method for detecting potential defects of complex-structure casting based on vertical longitudinal and transverse line profile features | |
CN108038883B (en) | Crack detection and identification method applied to highway pavement video image | |
CN107507208B (en) | Image feature point extraction method based on curvature estimation on contour | |
CN104658011B (en) | A kind of intelligent transportation moving object detection tracking | |
CN109325935B (en) | Power transmission line detection method based on unmanned aerial vehicle image | |
CN109658381B (en) | Method for detecting copper surface defects of flexible IC packaging substrate based on super-pixels | |
CN108921076B (en) | Pavement crack disease self-adaptive constant false alarm detection method based on image | |
CN108846844B (en) | Sea surface target detection method based on sea antenna | |
CN102169581A (en) | Feature vector-based fast and high-precision robustness matching method | |
CN112734761B (en) | Industrial product image boundary contour extraction method | |
CN108921813A (en) | Unmanned aerial vehicle detection bridge structure crack identification method based on machine vision | |
CN104992429A (en) | Mountain crack detection method based on image local reinforcement | |
CN105389793A (en) | Method for automatically identifying trend and width of fracture in object surface | |
CN114596551A (en) | Vehicle-mounted forward-looking image crack detection method | |
CN115457277A (en) | Intelligent pavement disease identification and detection method and system | |
CN116630813A (en) | Highway road surface construction quality intelligent detection system | |
CN109978858B (en) | Double-frame thumbnail image quality evaluation method based on foreground detection | |
CN116071692A (en) | Morphological image processing-based water gauge water level identification method and system | |
CN117893550A (en) | Moving object segmentation method under complex background based on scene simulation | |
CN111611858B (en) | Multi-angle discrimination-based automatic detection method and device for tilting track surface | |
CN111161264B (en) | Method for segmenting TFT circuit image with defects | |
Wu et al. | Research on crack detection algorithm of asphalt pavement | |
CN113643290B (en) | Straw counting method and device based on image processing and storage medium |
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 |