CN113284076A - FloodFill-based high-speed rail contact net current-carrying ring fracture abnormity detection method - Google Patents

FloodFill-based high-speed rail contact net current-carrying ring fracture abnormity detection method Download PDF

Info

Publication number
CN113284076A
CN113284076A CN202110827688.0A CN202110827688A CN113284076A CN 113284076 A CN113284076 A CN 113284076A CN 202110827688 A CN202110827688 A CN 202110827688A CN 113284076 A CN113284076 A CN 113284076A
Authority
CN
China
Prior art keywords
current
carrying ring
floodfill
picture
pixels
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
CN202110827688.0A
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.)
Yantai Comprehensive Information Center Yantai Citizen Card Management Center
Original Assignee
Yantai Comprehensive Information Center Yantai Citizen Card Management Center
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 Yantai Comprehensive Information Center Yantai Citizen Card Management Center filed Critical Yantai Comprehensive Information Center Yantai Citizen Card Management Center
Priority to CN202110827688.0A priority Critical patent/CN113284076A/en
Publication of CN113284076A publication Critical patent/CN113284076A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/40Image enhancement or restoration using histogram techniques
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/8851Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • 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
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/194Segmentation; Edge detection involving foreground-background segmentation
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/8851Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges
    • G01N2021/8887Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges based on image processing techniques

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Health & Medical Sciences (AREA)
  • Signal Processing (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Chemical & Material Sciences (AREA)
  • Analytical Chemistry (AREA)
  • Biochemistry (AREA)
  • General Health & Medical Sciences (AREA)
  • Immunology (AREA)
  • Pathology (AREA)
  • Image Analysis (AREA)

Abstract

The invention relates to a FloodFill-based high-speed rail contact net current-carrying ring fracture abnormity detection method, and belongs to the technical field of high-speed rail current-carrying ring abnormity diagnosis. The filling detection method based on FloodFill provided by the invention firstly preprocesses the image to reduce the influence of noise and low illumination, adopts image filtering to the current-carrying ring, and improves the quality of the image through histogram equalization; then, carrying out threshold segmentation processing on the picture, and processing the picture to only contain two kinds of pixels, namely black and white; obtaining a skeleton diagram of the current-carrying ring by using distance transformation, horizontal projection and vertical projection; filling the pictures by using FloodFill; and finally, calculating the ratio of the pixel values of the white pixel and the whole picture to determine whether the current-carrying ring has fracture abnormity. The method can realize intelligent detection of the 4C detection of the vehicle-mounted flow ring fracture abnormity, and has important application value for solving the problems of unbalanced positive and negative samples and non-uniform current-carrying ring states.

Description

FloodFill-based high-speed rail contact net current-carrying ring fracture abnormity detection method
Technical Field
The invention relates to a FloodFill-based high-speed rail contact net current-carrying ring fracture abnormity detection method, and belongs to the technical field of high-speed rail current-carrying ring abnormity diagnosis.
Background
Once a high-speed rail contact net breaks down, the normal operation of the high-speed rail is influenced. The current carrying ring is used as an important part of a high-speed rail contact net and has the function of suspending a contact line and a catenary, so that the elasticity and sag of the contact net are guaranteed under the condition that a strut is not added to the contact net, and the contact net and a pantograph of an electric locomotive are guaranteed to take current well. If the current-carrying ring breaks abnormally, the power supply of the train is caused to be in a problem, and the safe operation of the railway is greatly influenced.
The invention designs and realizes a visual-based current-carrying ring fracture abnormity detection method aiming at a current-carrying ring picture shot by a 4C detection vehicle. And the current-carrying ring fracture abnormity detection is to judge whether the current-carrying ring is closed, if the current-carrying ring is closed, the current-carrying ring is not abnormal, and if the current-carrying ring has an opening, the current-carrying ring is judged to be abnormal in fracture.
Disclosure of Invention
The invention provides a FloodFill-based high-speed rail contact net current-carrying ring fracture abnormity detection method, which comprises the steps of firstly preprocessing an image to reduce the influence of noise and illumination, filtering the current-carrying ring by adopting an image, and balancing a histogram to improve the quality of the image; then, carrying out threshold segmentation processing on the picture, and processing the picture to only contain two kinds of pixels, namely black and white; obtaining a skeleton diagram of the current-carrying ring by using distance transformation, horizontal projection and vertical projection; filling the pictures by using FloodFill; and finally, calculating the ratio of the pixel values of the white pixel and the whole picture to determine whether the current-carrying ring is abnormally broken or not, and realizing intelligent detection of the abnormal breakage of the 4C detection vehicle-mounted flow ring. The method has important application value for solving the problems of unbalanced positive and negative samples and non-uniform current-carrying ring states.
In order to achieve the purpose, the invention adopts the following technical scheme:
a FloodFill-based high-speed rail contact net current-carrying ring fracture abnormality detection method comprises the following steps:
preprocessing an input current-carrying ring picture, zooming the picture to 256 × 256 resolution, keeping the original proportion of a current-carrying ring while ensuring the calculation efficiency of an algorithm, and removing the influence of illumination and noise in the picture so as to improve the detection effect;
performing threshold segmentation on the preprocessed picture, wherein the processed picture only has black and white pixels, the black represents a background, and the white represents a foreground, namely a current-carrying ring;
extracting the contour of the current-carrying ring by using a Canny algorithm;
filling white (RGB values are R:255, G:255 and B: 255) from the upper left corner, the upper right corner, the lower left corner and the lower right corner of the outline picture of the current-carrying ring in sequence by using a FloodFill filling method;
calculating the number of the filled white pixels and the ratio of the white pixels to all pixels of the picture, and judging whether the current-carrying ring is broken abnormally according to the ratio;
further, the influence of illumination is removed by adopting histogram equalization, wherein the histogram equalization is to convert the histogram of the original image into a uniformly distributed form and increase the dynamic range of pixel gray values, so that the effect of enhancing the overall contrast of the image is achieved, and the detection precision is improved. Histogram equalization can be expressed by the following equation,
Figure 714950DEST_PATH_IMAGE001
Figure 655225DEST_PATH_IMAGE002
=
Figure 178610DEST_PATH_IMAGE003
wherein MN is the total number of image pixels,
Figure 529826DEST_PATH_IMAGE002
is a gray scale of
Figure 709134DEST_PATH_IMAGE004
The number of the pixels of (a) is,l is the number of image gray levels by which the gray level value of a pixel in the output image can be determined from the gray level of a pixel in the input image
Figure 249837DEST_PATH_IMAGE004
Is mapped as
Figure 817609DEST_PATH_IMAGE005
And then obtaining the compound.
Removing picture noise using gaussian filtering, gaussian filtering formula
Figure 418355DEST_PATH_IMAGE006
U, v denote the coordinates of the pixel,
Figure 819380DEST_PATH_IMAGE007
is the standard deviation of a normal distribution. Gaussian filtering:
1. the central element of the relevant kernel is moved so that it is located directly above the pixels to be processed of the input image.
2. The pixel values of the input image are multiplied by the correlation kernel as weights.
3. And adding the results obtained in the above steps as output.
Furthermore, bilateral filtering can be adopted to remove picture noise, so that the fuzzy edge information of the image after normal Gaussian filtering can be kept clear, and the image edge is smoother. The concrete formula is as follows
Figure 163774DEST_PATH_IMAGE008
Figure 583123DEST_PATH_IMAGE009
As a result of the current pixel weight value,
Figure 354770DEST_PATH_IMAGE010
as the information of the current pixel is,
Figure 243091DEST_PATH_IMAGE011
is the current pixel domain mean value;
Figure 125597DEST_PATH_IMAGE012
as information on the position of the current pixel,
Figure 478080DEST_PATH_IMAGE013
as the average position information of the current pixel,
Figure 140004DEST_PATH_IMAGE014
and
Figure 577939DEST_PATH_IMAGE015
respectively, the standard deviation of the current pixel information and the current pixel position information.
Further, the picture is divided by a fixed threshold value, the fixed threshold value is used for separating the current-carrying ring from the background in the picture of the current-carrying ring, and the target and the background have strong contrast
Figure 388769DEST_PATH_IMAGE016
Figure 533442DEST_PATH_IMAGE017
Is a threshold value, the following formula is satisfied when the image is divided:
Figure 833843DEST_PATH_IMAGE018
wherein the threshold value
Figure 431177DEST_PATH_IMAGE017
Setting the gray value of the pixel to be 5, setting all the pixels with the gray value of more than or equal to 5 to be 255, and representing the current-carrying ring pixel; all the others are set to 0, indicating background.
Further, the Canny algorithm is used to extract the contour of the current-carrying ring, and the steps are preferably as follows:
firstly, the gradient amplitude direction of the image is calculated by using first-order partial derivative finite difference, Roberts operators of edges are searched by using local difference operators, and the sharpness of the edges is determined by the gradient of the image gray.
And carrying out non-maximum suppression on the gradient amplitude, and reserving the point with the maximum local gradient value.
The edges are detected and connected using hysteresis thresholds, and the contours of the current-carrying rings are extracted.
Further, the picture is filled using the FloodFill method. A four-way FloodFill algorithm, which is specifically as follows, or an eight-way FloodFill algorithm may be used: filling white from upper left, upper right, lower left and lower right corners of the picture by using a FloodFill filling method, and searching pixel points by using a four-way FloodFill algorithm
Figure 576857DEST_PATH_IMAGE019
If not, filling the four adjacent pixel points, and continuously searching the four connected pixels until the closed area is completely filled with new color.
The eight-pass FloodFill algorithm is specifically as follows: filling the pictures from the upper left point, the upper right point, the lower left point and the lower right point of the pictures by using a FloodFill filling method in sequence by using white, and calculating pixel points by using an eight-way FloodFill algorithm
Figure 435091DEST_PATH_IMAGE019
And recursively looks for their octal connected pixel fill until the region is completely filled with new color.
If the current-carrying ring is broken, the whole picture is changed into white after filling; if the current-carrying ring is not broken, namely the current-carrying ring is annular, after filling, the middle of the current-carrying ring cannot be filled with white, and the part is black with background color.
And calculating the number of white pixel values in the picture after each filling, and calculating the ratio of the number of white pixels to the total number of pixels of the picture, wherein the fracture abnormity occurs in the current-carrying ring as long as the ratio is more than or equal to 0.98 at any time in multiple filling.
According to the method, the intelligent detection of the 4C detection of the vehicle-mounted flowing ring fracture abnormity can be realized. In addition, the method has important application value for solving the problems of unbalance of positive and negative samples and non-uniform current-carrying ring states.
Drawings
FIG. 1 is a flow chart of a method according to a first embodiment of the present invention;
FIG. 2 is a schematic diagram of four sectors as described in embodiments one and two of the present invention;
FIG. 3 is a diagram of the first and second embodiments of the present invention
Figure 391546DEST_PATH_IMAGE020
A schematic of a neighborhood;
FIG. 4 is a schematic diagram of the eight-pass process in accordance with a first embodiment of the present invention;
FIG. 5 is a flowchart of a method according to a second embodiment of the present invention;
FIG. 6 is a schematic diagram of the four-pass method according to the second embodiment of the present invention.
Detailed Description
In order to clearly illustrate the technical features of the present invention, the present invention will be explained in detail by the following embodiments and the accompanying drawings. The following disclosure provides many different embodiments, or examples, for implementing different features of the invention. To simplify the disclosure of the present invention, the components and arrangements of specific examples are described below. Furthermore, the present invention may repeat reference numerals and/or letters in the various examples. This repetition is for the purpose of simplicity and clarity and does not in itself dictate a relationship between the various embodiments and/or configurations discussed. Descriptions of well-known components and processing techniques and procedures are omitted so as to not unnecessarily limit the invention.
Example one
As shown in fig. 1, the method for detecting the abnormal breakage of the current-carrying ring of the high-speed rail contact network based on the FloodFill comprises the following steps:
s1, preprocessing the input current-carrying ring picture, scaling the picture to 256 × 256 resolution, firstly, using histogram equalization to remove the influence of illumination on the picture, and then using Gaussian filtering to remove noise in the picture so as to improve the detection effect; the histogram equalization is to transform the histogram of the original image into a uniformly distributed form and increase the dynamic range of the pixel gray value, thereby achieving the effect of enhancing the overall contrast of the image and improving the detection precision. Histogram equalization can be expressed by the following equation,
Figure 804073DEST_PATH_IMAGE001
Figure 832072DEST_PATH_IMAGE002
=
Figure 469114DEST_PATH_IMAGE003
wherein MN is the total number of image pixels (MN =65535),
Figure 596470DEST_PATH_IMAGE002
is a gray scale of
Figure 230713DEST_PATH_IMAGE004
L is the number of image grey levels (e.g. L =256 for an 8-bit image), by which the grey value of a pixel in the output image can be determined from the grey value of the pixel in the input image
Figure 983775DEST_PATH_IMAGE004
Is mapped as
Figure 285443DEST_PATH_IMAGE005
And then obtaining the compound.
Removing picture noise using gaussian filtering, gaussian filtering formula
Figure 849280DEST_PATH_IMAGE006
U, v denote the coordinates of the pixel,
Figure 970819DEST_PATH_IMAGE007
is the standard deviation of a normal distribution. Gaussian filtering: (1) the central element of the relevant kernel is moved so that it is located directly above the pixels to be processed of the input image. (2) The pixel values of the input image are multiplied by the correlation kernel as weights. (3) And adding the results obtained in the above steps as output.
We use a 3 × 3 template, then the calculation formula is as follows
Figure 340621DEST_PATH_IMAGE021
Wherein the content of the first and second substances,
Figure 683746DEST_PATH_IMAGE016
as in the image
Figure 480801DEST_PATH_IMAGE022
The gray-scale value of the point or points,
Figure 292899DEST_PATH_IMAGE023
is the gaussian filtered value for that point.
S2, carrying out threshold processing on the preprocessed picture, separating the current-carrying ring from the background in the picture of the current-carrying ring, wherein the method adopted in the embodiment is to divide the current-carrying ring by a fixed threshold value and set the original image as the target and the background have stronger contrast
Figure 200812DEST_PATH_IMAGE016
Figure 132865DEST_PATH_IMAGE017
Is a threshold value, the following formula is satisfied when the image is divided:
Figure 100821DEST_PATH_IMAGE018
wherein the threshold value
Figure 134636DEST_PATH_IMAGE017
Set to 5, all of the pixels having a gradation value of 5 or more are 255, indicating thatA current-carrying ring pixel; all the others are set to 0, indicating background. The processed picture only has black and white pixels, wherein the black pixel represents the background, and the white pixel represents the foreground, namely the current-carrying ring;
s3, extracting the contour of the current carrying ring by using a Canny algorithm, and the steps are as follows: first, the gradient magnitude direction of the image is calculated by using a first-order partial derivative finite difference, and a first-order differential operator is generally completed by convolution through a spatial differential operator, but actually derivation in the digital image is performed by using a differential approximate differential.
The gradient corresponds to the first derivative and the gradient operator is the first derivative operator. For a continuous function
Figure 846240DEST_PATH_IMAGE016
It is in position
Figure 889590DEST_PATH_IMAGE022
The gradient may be represented as a vector
Figure 28447DEST_PATH_IMAGE024
For digital images, the derivatives can be approximated by differences, and the gradient can be expressed as:
Figure 549558DEST_PATH_IMAGE025
in practice, a small region template convolution is often used to approximate the calculation. To pair
Figure 64853DEST_PATH_IMAGE026
And
Figure 784548DEST_PATH_IMAGE027
one template each, so two templates are required to be combined to form a gradient operator. Depending on the size of the template, where the element (coefficient) values differ, a large number of templates can be proposed, constituting a large number of detection operators.
The operator proposed by Roberts is a method of exploiting local differencesThe sub-operators search operators of edges, and the sharpness of the edges is determined by the gradient of the image gray level. The gradient is a vector of the magnitude of the gradient,
Figure 281257DEST_PATH_IMAGE028
indicating the fastest direction and number of gray scale changes.
The simplest edge detection operator is therefore to approximate the gradient operator with the vertical and horizontal difference of the image:
Figure 351981DEST_PATH_IMAGE029
the vector of the above formula is calculated for each pixel, its absolute value is calculated, and then compared with a threshold, and by using this idea, the Roberts cross operator is obtained:
Figure 343071DEST_PATH_IMAGE030
the above equation can provide a better invariant edge orientation. For edges of equal length but different orientations, the resultant amplitude variation obtained by applying the Roberts maximum operator is smaller than that obtained by applying the Roberts crossover operator. It is clear that the Roberts first differential is not along
Figure 182851DEST_PATH_IMAGE031
Axial direction and
Figure 850461DEST_PATH_IMAGE032
axial differential, but taking rotation
Figure 408482DEST_PATH_IMAGE033
The sum of the differential values in two directions of 45 degrees.
And carrying out non-maximum suppression on the gradient amplitude, and reserving the point with the maximum local gradient value. The above steps only result in a global gradient and are not sufficient to determine the edge, so to determine the edge, the point where the local gradient is maximal must be preserved, while suppressing non-maxima.
Using simple edge calculationsThe sub-vector can obtain vertical and horizontal direction edges, and the direction can be rotated by using Roberts cross operator
Figure 937683DEST_PATH_IMAGE033
Edges in two directions of 45 degrees, therefore, we can combine the two operators to obtain edge information in four directions. As shown in FIGS. 2 and 3, the four directional edges may be represented by a pie chart, labeled with sector numbers
Figure 631970DEST_PATH_IMAGE034
To
Figure 736061DEST_PATH_IMAGE035
To indicate the pixels that compute the edge utilization in four directions, which corresponds to
Figure 515798DEST_PATH_IMAGE020
Four possible combinations of neighborhoods. Sector 0 corresponds to pixels 8 and 4 in fig. 3, sector 1 corresponds to pixels 7 and 3 in fig. 3, sector 2 corresponds to pixels 6 and 2 in fig. 3, and sector 3 corresponds to pixels 5 and 1 in fig. 3.
At each point, the central pixel of the neighborhood
Figure 848690DEST_PATH_IMAGE036
Compared to two pixels along the gradient line. If it is not
Figure 663063DEST_PATH_IMAGE036
The gradient value of (a) is not larger than the gradient values of two adjacent pixels along the gradient line, then
Figure 485525DEST_PATH_IMAGE037
. Namely, it is
Figure 942439DEST_PATH_IMAGE038
Edges are detected and connected using hysteresis thresholds. The choice of the threshold size affects the quality of the detected edge. This step is to convert the image into a non-black, i.e. white, edge map, defining two parameters:
Figure 79022DEST_PATH_IMAGE039
and
Figure 747901DEST_PATH_IMAGE040
(1) if the amplitude of the point is lower than Low, the point is not an edge point, is removed and is set to be black.
(2) If the amplitude of the point is higher than High, it is an edge point, and the point is set to white.
(3) If the amplitude of the point is between Low and High, then:
a) if the point is directly adjacent to a point having a magnitude greater than High or the point may be indirectly adjacent through a point also between Low and High and a point having a magnitude greater than High. The point is considered to be on the edge, is an edge point, and is set to white.
b) Otherwise, the edge point is not considered to be the edge point, and the color is set to be black.
Through the processing, the final image is converted into an edge map which is not black or white and is suitable for computer processing, and the purpose of edge detection is achieved, namely the edge map of the current-carrying ring is obtained.
And S4, filling the picture by using a FloodFill filling method. The FloodFill method fills a communication area with a certain color, and achieves different filling effects by setting the upper limit and the lower limit of a connectable pixel and a communication mode. The FloodFill algorithm accepts three parameters: the start node, the target color and the alternate color. The algorithm traverses all nodes to find nodes connected to the starting node (connected by a path of the target color) and then changes their color to the alternate color.
In this embodiment, an eight-connected filling algorithm is adopted, as shown in fig. 4, that is, a pixel point is found
Figure 928215DEST_PATH_IMAGE019
Up, down, left, right, top left, bottom left, top right, bottom right eight neighboring pixels, if not filled, fill them, and recursively find their eight connected pixel fills until the region is completely filled with the new color.
The algorithm comprises the following steps:
(1) and finding a pixel point which is not dyed, dyeing the pixel point into the designated color, and finishing the algorithm if the pixel point is not dyed.
(2) Initializing an empty queue and inserting the pixel points of the first step into the queue.
(3) And continuously obtaining the value of the head element of the queue and popping up, and point-dyeing the uncolored pixel adjacent to the head element of the queue into the specified color and adding the uncolored pixel into the queue.
(4) And repeating the first step until all the pixel points are dyed, and finishing the algorithm.
Filling the pictures by white (RGB values are R:255, G:255 and B: 255) from upper left, upper right, lower left and lower right corners of the pictures in sequence by using a FloodFill filling method; if the current-carrying ring is broken, the whole picture is changed into white after filling; if the current-carrying ring is not broken, namely the current-carrying ring is annular, after filling, the middle of the current-carrying ring cannot be filled with white, and the part is black with background color.
And S5, calculating the number of white pixel values in the picture after each filling, calculating the ratio of the number of white pixels to the total number of pixels of the picture (65536), and if the ratio is more than or equal to 0.98 in any one filling of four times, determining that the carrier ring has a fracture abnormity.
Example two
As shown in fig. 5, a method for detecting abnormal breakage of a current-carrying ring of a high-speed rail contact network based on FloodFill comprises the following steps:
s1, adjusting the input picture to 256 × 256 resolution, using histogram equalization to solve the effect of illumination change in the current-carrying ring not affected by the force anomaly detection (same as in the first embodiment), and filtering the image to remove the picture noise.
And the bilateral filtering is used for removing picture noise, so that the fuzzy edge information of the image after normal Gaussian filtering is kept clear, and the image edge is smoother. The concrete formula is as follows,
Figure 620228DEST_PATH_IMAGE008
Figure 357239DEST_PATH_IMAGE009
as a result of the current pixel weight value,
Figure 67575DEST_PATH_IMAGE010
as the information of the current pixel is,
Figure 497420DEST_PATH_IMAGE011
is the current pixel domain mean value;
Figure 676728DEST_PATH_IMAGE012
as information on the position of the current pixel,
Figure 951852DEST_PATH_IMAGE013
as the average position information of the current pixel,
Figure 782273DEST_PATH_IMAGE014
and
Figure 117440DEST_PATH_IMAGE015
respectively, the standard deviation of the current pixel information and the current pixel position information.
S2, carrying out threshold processing on the preprocessed picture, separating the current-carrying ring from the background in the picture of the current-carrying ring, wherein the method adopted in the embodiment is to divide the current-carrying ring by a fixed threshold value and set the original image as the target and the background have stronger contrast
Figure 784045DEST_PATH_IMAGE016
Figure 862859DEST_PATH_IMAGE017
Is a threshold value, the following formula is satisfied when the image is divided:
Figure 360836DEST_PATH_IMAGE018
wherein the threshold value
Figure 322364DEST_PATH_IMAGE017
Setting the gray value of the pixel to be 5, setting all the pixels with the gray value of more than or equal to 5 to be 255, and representing the current-carrying ring pixel; all the others are set to 0, indicating background. The processed picture only has black and white pixels, wherein the black pixel represents the background, and the white pixel represents the foreground, namely the current-carrying ring;
s3, extracting the contour of the current carrying ring by using a Canny algorithm, and the steps are as follows:
first, the gradient magnitude direction of the image is calculated by using a first-order partial derivative finite difference, and a first-order differential operator is generally completed by convolution through a spatial differential operator, but actually derivation in the digital image is performed by using a differential approximate differential.
The gradient corresponds to the first derivative and the gradient operator is the first derivative operator. For a continuous function
Figure 273002DEST_PATH_IMAGE016
It is in position
Figure 93191DEST_PATH_IMAGE022
The gradient may be represented as a vector
Figure 445675DEST_PATH_IMAGE024
For digital images, the derivatives can be approximated by differences, and the gradient can be expressed as:
Figure 575173DEST_PATH_IMAGE025
in practice, a small region template convolution is often used to approximate the calculation. To pair
Figure 13108DEST_PATH_IMAGE026
And
Figure 371408DEST_PATH_IMAGE027
one of the templates is used for each,two templates are required to be combined to form a gradient operator. Depending on the size of the template, where the element (coefficient) values differ, a large number of templates can be proposed, constituting a large number of detection operators.
The operator proposed by Roberts is an operator that finds edges using local difference operators, the sharpness of the edges being determined by the gradient of the image grey scale. The gradient is a vector of the magnitude of the gradient,
Figure 843978DEST_PATH_IMAGE028
indicating the fastest direction and number of gray scale changes.
The simplest edge detection operator is therefore to approximate the gradient operator with the vertical and horizontal difference of the image:
Figure 144378DEST_PATH_IMAGE029
the vector of the above formula is calculated for each pixel, its absolute value is calculated, and then compared with a threshold, and by using this idea, the Roberts cross operator is obtained:
Figure 69609DEST_PATH_IMAGE030
the above equation can provide a better invariant edge orientation. For edges of equal length but different orientations, the resultant amplitude variation obtained by applying the Roberts maximum operator is smaller than that obtained by applying the Roberts crossover operator. It is clear that the Roberts first differential is not along
Figure 231600DEST_PATH_IMAGE031
Axial direction and
Figure 293097DEST_PATH_IMAGE032
axial differential, but taking rotation
Figure 764398DEST_PATH_IMAGE041
The sum of the differential values in the two directions of degrees.
And carrying out non-maximum suppression on the gradient amplitude, and reserving the point with the maximum local gradient value. The above steps only result in a global gradient and are not sufficient to determine the edge, so to determine the edge, the point where the local gradient is maximal must be preserved, while suppressing non-maxima.
As shown in FIGS. 2 and 3, four sectors are numbered
Figure 176925DEST_PATH_IMAGE034
To
Figure 142607DEST_PATH_IMAGE035
Correspond to
Figure 324190DEST_PATH_IMAGE020
Four possible combinations of neighborhoods. At each point, the central pixel of the neighborhood
Figure 513862DEST_PATH_IMAGE036
If compared to two pixels along the gradient line
Figure 603566DEST_PATH_IMAGE036
The gradient value of (a) is not larger than the gradient values of two adjacent pixels along the gradient line, then
Figure 107359DEST_PATH_IMAGE037
. Namely, it is
Figure 409028DEST_PATH_IMAGE038
Edges are detected and connected using hysteresis thresholds. The choice of the threshold size affects the quality of the detected edge. This step is to convert the image into a non-black, i.e. white, edge map, defining two parameters:
Figure 769602DEST_PATH_IMAGE039
and
Figure 343672DEST_PATH_IMAGE040
if the amplitude of the point is lower than Low, the point is not an edge point, is removed and is set to be black.
If the amplitude of the point is higher than High, it is an edge point, and the point is set to white.
If the amplitude of the point is between Low and High, then:
a) if the point is directly adjacent to a point with amplitude greater than High or the point can be indirectly adjacent to a point with amplitude greater than High through a point also between Low and High, the point is considered to be on the edge and is an edge point, and is set to white.
b) Otherwise, the edge point is not considered to be the edge point, and the color is set to be black.
Through the processing, the final image is converted into an edge map which is not black or white and is suitable for computer processing, and the purpose of edge detection is achieved, namely the edge map of the current-carrying ring is obtained.
And S4, filling the picture by using a FloodFill filling method. The FloodFill method fills a connected region with a certain color, and achieves different filling effects by setting the upper limit and the lower limit of a connectable pixel and a connection mode. FloodFill is often used to mark or separate portions of an image for further processing or analysis, and may also be used to obtain areas of masks from an input image, where the masks speed up the process, or to process only pixels specified by the masks, and the result of the operation is always some continuous area.
The FloodFill algorithm accepts three parameters: the start node, the target color and the alternate color. The algorithm traverses all nodes to find nodes connected to the starting node (connected by a path of the target color) and then changes their color to the alternate color.
As shown in fig. 6, in this embodiment, a four-way FloodFill algorithm is adopted to find a pixel point
Figure 713473DEST_PATH_IMAGE019
If not, filling the four adjacent pixel points, and continuously searching the four connected pixels until the closed area is completely filled with new color.
The algorithm comprises the following steps:
(1) and finding a pixel point which is not dyed, dyeing the pixel point into the designated color, and finishing the algorithm if the pixel point is not dyed.
(2) Initializing an empty queue and inserting the pixel points of the first step into the queue.
(3) And continuously obtaining the value of the head element of the queue and popping up, and point-dyeing the uncolored pixel adjacent to the head element of the queue into the specified color and adding the uncolored pixel into the queue.
(4) And repeating the first step until all the pixel points are dyed, and finishing the algorithm.
Fill with white (255 ) from four points (0, 0), (0, 255), (255, 0) and (255 ) of the picture in sequence using the flodfill algorithm. If the current-carrying ring is broken, the whole picture is changed into white after filling; if the current-carrying ring is not broken, namely the current-carrying ring is annular, after filling, the middle of the current-carrying ring cannot be filled with white, and the part is black with background color.
And S5, calculating the number of white pixel values in the picture after each filling, calculating the ratio of the number of white pixels to the total number of pixels of the picture (65536), and if the ratio is more than or equal to 0.98 when any one time occurs in four times of filling, determining that the carrier ring has a fracture abnormity.
Although the embodiments of the present invention have been described with reference to the accompanying drawings, it is not intended to limit the scope of the present invention, and it should be understood by those skilled in the art that various modifications and variations can be made without inventive efforts by those skilled in the art based on the technical solution of the present invention.

Claims (9)

1. A high-speed rail contact net current-carrying ring fracture abnormity detection method based on FloodFill is characterized by comprising the following steps:
firstly, preprocessing an input current-carrying ring picture, and zooming the picture so as to remove the influence of illumination and noise in the picture;
secondly, thresholding is carried out on the preprocessed picture, the processed picture only has two kinds of pixels, namely black pixels and white pixels, the black pixels represent the background, and the white pixels represent the foreground, namely a current-carrying ring;
extracting the contour of the current carrying ring by using a Canny algorithm;
filling white from the upper left, upper right, lower left and lower right corners of the picture by using a FloodFill filling method in sequence;
and fifthly, calculating the number of the white pixels after filling and the ratio of the white pixels to all pixels of the picture, and judging whether the current-carrying ring has fracture abnormity according to the ratio.
2. The method for detecting the abnormal breakage of the current-carrying ring of the high-speed rail contact network based on the FloodFill as claimed in claim 1, wherein in the first step, histogram equalization is adopted to remove the influence of illumination, the histogram of an original graph is converted into a uniform distribution form, and the dynamic range of pixel gray values is increased.
3. The FloodFill-based high-speed rail contact net current-carrying ring fracture abnormality detection method according to claim 2, wherein in the first step, image noise is removed by adopting Gaussian filtering.
4. The FloodFill-based high-speed rail contact net current-carrying ring fracture abnormality detection method according to claim 2, wherein in the first step, picture noise is removed by adopting bilateral filtering.
5. The FloodFill-based high-speed rail contact net current-carrying ring fracture abnormality detection method according to claim 1, wherein in the second step, the picture is subjected to fixed threshold segmentation, and an original image is set
Figure 501774DEST_PATH_IMAGE001
Figure 298828DEST_PATH_IMAGE002
Is a threshold value, the following formula is satisfied when the image is divided:
Figure 845347DEST_PATH_IMAGE003
all the gray values of the original image pixels which are larger than or equal to T are set to be 255, and the current-carrying ring pixels are represented; all the others are set to 0, indicating background.
6. The method for detecting the abnormal breakage of the current-carrying ring of the high-speed rail contact network based on the FloodFill according to the claim 1, wherein the Canny algorithm is used for extracting the outline of the current-carrying ring in the third step, and the method comprises the following steps:
firstly, calculating the gradient amplitude direction of an image by using first-order partial derivative finite difference, searching a Roberts operator of an edge by using a local difference operator, wherein the sharpness of the edge is determined by the gradient of the gray level of the image;
then, carrying out non-maximum suppression on the gradient amplitude, and reserving a point with the maximum local gradient value;
finally, edges are detected and connected by using a hysteresis threshold, and the contour of the current-carrying ring is extracted.
7. The FloodFill-based high-speed rail contact net current-carrying ring fracture abnormality detection method according to claim 1, wherein a four-way connection FloodFill algorithm is adopted in the fourth step, four adjacent pixel points, namely upper, lower, left and right, of the pixel points are searched, if the four adjacent pixel points are not filled, the four adjacent pixel points are filled, and the four-way connection pixel points are continuously searched until a closed area is completely filled with a new color.
8. The FloodFill-based high-speed rail contact net current-carrying ring fracture abnormality detection method according to claim 1, wherein an eight-connected FloodFill algorithm is used in the fourth step, adjacent pixels of pixel points, namely upper, lower, left, right, upper left, lower left, upper right and lower right, are calculated, and eight-connected pixel filling of the pixels is searched recursively until the area is completely filled with new colors.
9. The method for detecting the abnormal breakage of the current-carrying ring of the high-speed rail contact net based on the FloodFill according to the claim 7 or 8, wherein the fifth step is to calculate the number of white pixel values in the picture after each filling, calculate the ratio of the number of the white pixels to the total number of the pixels in the picture, and determine that the abnormal breakage of the current-carrying ring occurs when the ratio is larger than or equal to a set value.
CN202110827688.0A 2021-07-22 2021-07-22 FloodFill-based high-speed rail contact net current-carrying ring fracture abnormity detection method Pending CN113284076A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110827688.0A CN113284076A (en) 2021-07-22 2021-07-22 FloodFill-based high-speed rail contact net current-carrying ring fracture abnormity detection method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110827688.0A CN113284076A (en) 2021-07-22 2021-07-22 FloodFill-based high-speed rail contact net current-carrying ring fracture abnormity detection method

Publications (1)

Publication Number Publication Date
CN113284076A true CN113284076A (en) 2021-08-20

Family

ID=77286925

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110827688.0A Pending CN113284076A (en) 2021-07-22 2021-07-22 FloodFill-based high-speed rail contact net current-carrying ring fracture abnormity detection method

Country Status (1)

Country Link
CN (1) CN113284076A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180027145A1 (en) * 2016-07-25 2018-01-25 Iteris, Inc. Image-based field boundary detection and identification
CN109840909A (en) * 2019-01-18 2019-06-04 西安科技大学 A kind of crucible bubble counting device and method of counting
CN111402214A (en) * 2020-03-07 2020-07-10 西南交通大学 Neural network-based automatic detection method for breakage defect of catenary dropper current-carrying ring
CN111899268A (en) * 2020-08-17 2020-11-06 上海商汤智能科技有限公司 Image segmentation method and device, electronic equipment and storage medium
US20200363408A1 (en) * 2018-01-11 2020-11-19 Essenlix Corporation Homogenous assay (ii)

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180027145A1 (en) * 2016-07-25 2018-01-25 Iteris, Inc. Image-based field boundary detection and identification
US20200363408A1 (en) * 2018-01-11 2020-11-19 Essenlix Corporation Homogenous assay (ii)
CN109840909A (en) * 2019-01-18 2019-06-04 西安科技大学 A kind of crucible bubble counting device and method of counting
CN111402214A (en) * 2020-03-07 2020-07-10 西南交通大学 Neural network-based automatic detection method for breakage defect of catenary dropper current-carrying ring
CN111899268A (en) * 2020-08-17 2020-11-06 上海商汤智能科技有限公司 Image segmentation method and device, electronic equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
杨帆: "《数字图像处理与分析》", 31 January 2019, 北京航空航天大学出版社 *

Similar Documents

Publication Publication Date Title
CN109741356B (en) Sub-pixel edge detection method and system
CN102782706B (en) Text enhancement of a textual image undergoing optical character recognition
CN108022233A (en) A kind of edge of work extracting method based on modified Canny operators
CN110264459A (en) A kind of interstices of soil characteristics information extraction method
CN109377450B (en) Edge protection denoising method
US20100008576A1 (en) System and method for segmentation of an image into tuned multi-scaled regions
CN105913396A (en) Noise estimation-based image edge preservation mixed de-noising method
CN107220988A (en) Based on the parts image edge extraction method for improving canny operators
KR20150097367A (en) Method and apparatus for adjusting image
CN109961416B (en) Business license information extraction method based on morphological gradient multi-scale fusion
CN105894491A (en) Image high-frequency information positioning method and device
CN103942756B (en) A kind of method of depth map post processing and filtering
CN107798670A (en) A kind of dark primary prior image defogging method using image wave filter
CN109472788A (en) A kind of scar detection method on airplane riveting surface
CN115330645A (en) Welding image enhancement method
CN115131351A (en) Engine oil radiator detection method based on infrared image
CN113537037A (en) Pavement disease identification method, system, electronic device and storage medium
CN110807406B (en) Foggy day detection method and device
CN105787912A (en) Classification-based step type edge sub pixel localization method
CN115660990A (en) Endoscope image mirror reflection detection and restoration method based on brightness classification
CN109101985A (en) It is a kind of based on adaptive neighborhood test image mismatch point to elimination method
CN117094975A (en) Method and device for detecting surface defects of steel and electronic equipment
CN107292897A (en) Image edge extraction method, device and terminal for YUV domains
CN114943744A (en) Edge detection method based on local Otsu thresholding
JP2004030188A (en) Method, apparatus and program for dividing image into areas

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: 20210820

RJ01 Rejection of invention patent application after publication