CN115063430A - Electric pipeline crack detection method based on image processing - Google Patents

Electric pipeline crack detection method based on image processing Download PDF

Info

Publication number
CN115063430A
CN115063430A CN202210995649.6A CN202210995649A CN115063430A CN 115063430 A CN115063430 A CN 115063430A CN 202210995649 A CN202210995649 A CN 202210995649A CN 115063430 A CN115063430 A CN 115063430A
Authority
CN
China
Prior art keywords
pipeline
area
image
crack
scratch
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210995649.6A
Other languages
Chinese (zh)
Other versions
CN115063430B (en
Inventor
丁春玲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nantong Jinmao Explosion Proof Electrical Co ltd
Original Assignee
Nantong Jinmao Explosion Proof Electrical 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 Nantong Jinmao Explosion Proof Electrical Co ltd filed Critical Nantong Jinmao Explosion Proof Electrical Co ltd
Priority to CN202210995649.6A priority Critical patent/CN115063430B/en
Publication of CN115063430A publication Critical patent/CN115063430A/en
Application granted granted Critical
Publication of CN115063430B publication Critical patent/CN115063430B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • 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
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Computing Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Quality & Reliability (AREA)
  • Databases & Information Systems (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Multimedia (AREA)
  • Image Processing (AREA)

Abstract

The invention relates to the field of electric pipeline defect detection, in particular to an electric pipeline crack detection method based on image processing. The method comprises the following steps: classifying the edge lines according to gray gradient change curves corresponding to the pixel points on the edge lines of each defect area in the pipeline image to obtain a suspected crack area and a scratch area, judging whether the suspected crack area and the scratch area are overlapped, and if so, replacing the scratch area with a normal area pixel value to obtain a pipeline down-sampling image; if the images are not overlapped, deleting the corresponding target area in the pipeline image to obtain a pipeline down-sampling image; replacing the scratch area in the pipeline image with the pixel value of the normal area to obtain a new restored image, and judging whether the suspected pipeline crack area in the pipeline image under the pipeline image is the pipeline crack area or not and whether the suspected pipeline crack area in the new restored image is the pipeline crack area or not by using a target network; if both are true, it is determined that a crack is present. The invention improves the identification precision of the electric pipeline cracks.

Description

Electric pipeline crack detection method based on image processing
Technical Field
The invention relates to the field of electric pipeline defect detection, in particular to an electric pipeline crack detection method based on image processing.
Background
Two defects of pipeline cracks and pipeline scratches may occur to the electric pipeline, the pipeline scratches are damaged on the surface, the influence is small, and potential safety hazards may exist when the pipeline cracks are large. The electric pipeline crack is one of industrial safety hidden dangers, and accurate detection of the electric pipeline crack is necessary. In the prior art, the surface cracks of the electric pipeline are mainly detected by a laser detector, and whether the surface of the pipeline has crack defects or not is determined by laser return time. When the surface crack of the electric pipeline is detected, the scratch defect of the pipeline can cause interference to the crack detection to a certain degree, and the accuracy of the crack detection is reduced.
Disclosure of Invention
In order to solve the problem of low accuracy of electric pipeline crack detection in the existing method, the invention aims to provide an electric pipeline crack detection method based on image processing, and the adopted technical scheme is as follows:
the invention provides an electric pipeline crack detection method based on image processing, which comprises the following steps:
acquiring a pipeline image;
performing edge detection on the pipeline image to obtain edge lines of each defect area in the pipeline image;
classifying the edge lines of the defect areas according to the gray gradient change curves corresponding to the pixel points on the edge lines of the defect areas to obtain suspected pipeline crack areas and pipeline scratch areas corresponding to the pipeline images;
acquiring the row number and the column number of each pixel point of a suspected pipeline crack area and a pipeline scratch area corresponding to a pipeline image, judging whether the row number and the column number of the pixel points of the suspected pipeline crack area and the pipeline scratch area corresponding to the pipeline image are overlapped, and if so, replacing the pixel value corresponding to the pixel point of the pipeline scratch area with the pixel value corresponding to the pixel point of a normal area of the pipeline to obtain a down-sampling pipeline image; if the image is not overlapped, deleting a corresponding target area in the pipeline image to obtain a pipeline down-sampling image, wherein the target area comprises rows and columns where all pixel points of the pipeline scratch area are located;
replacing pixel values corresponding to pixel points of a pipeline scratch area in the pipeline image with pixel values corresponding to pixel points of a normal area of the pipeline to obtain a new restored image of the pipeline, wherein the normal area of the pipeline is an area which does not include a suspected pipeline crack area and a pipeline scratch area in the pipeline image;
judging whether an area corresponding to a suspected pipeline crack area in the pipeline downsampling image is a pipeline crack area or not by using a target network, and judging whether an area corresponding to the suspected pipeline crack area in the pipeline new restoration image is a pipeline crack area or not by using the target network; and if the judgment results are all pipeline crack areas, judging that the pipeline image has cracks.
Preferably, the acquiring the pipeline image includes:
acquiring an image of a pipeline distribution area;
carrying out graying processing on the image of the pipeline distribution area to obtain a grayed image of the pipeline distribution area;
denoising the grayscale image of the pipeline distribution area to obtain a denoised pipeline grayscale image;
and carrying out image segmentation on the denoised pipeline gray level image to obtain a pipeline image.
Preferably, obtaining a gray scale gradient change curve corresponding to each pixel point on each defect region edge line includes:
making a perpendicular line of a tangent line of each pixel point through each pixel point on the edge line of each defect area;
and constructing a gray gradient change curve corresponding to each pixel point on the edge line of each defect area according to the gray value of each pixel point on the vertical line.
Preferably, the obtaining of the suspected pipeline crack area and the pipeline scratch area corresponding to the pipeline image includes:
acquiring the slope of a gray gradient change curve corresponding to each pixel point on the edge line of each defect area;
calculating the gray average value of each pixel point in each defect area of the pipeline image and the pixel point in the adjacent area corresponding to each pixel point, and calculating the image complexity of each defect area of the pipeline image according to the gray average value of each pixel point in each defect area of the pipeline image and the pixel point in the adjacent area corresponding to each pixel point;
classifying the defect areas of the pipeline image according to the slope of the gray gradient change curve corresponding to each pixel point on the edge line of each defect area and the image complexity of each defect area of the pipeline image to obtain a suspected pipeline crack area and a pipeline scratch area corresponding to the pipeline image.
Preferably, the classifying the defect areas of the pipeline image according to the slope of the gray gradient change curve corresponding to each pixel point on the edge line of each defect area and the image complexity of each defect area of the pipeline image to obtain a suspected pipeline crack area and a pipeline scratch area corresponding to the pipeline image includes:
judging whether the slope of a gray gradient change curve corresponding to each pixel point on the edge line of each defect area is positive and then negative, and whether the image complexity of the area corresponding to the edge line of each defect area is smaller than a set threshold value, if so, judging that the area corresponding to the edge line is a pipeline scratch area; and if the judgment result is not present, judging that the area corresponding to the edge line is a suspected pipeline crack area.
Preferably, the deleting the corresponding target area in the pipeline image to obtain a pipeline downsampling image includes:
acquiring the total row number and the total column number of a pipeline scratch area;
comparing the total line number and the total column number of the pipeline scratch area, if the total line number is smaller than the total column number, deleting the line and the column where the pipeline scratch area is located and a normal area with a set line number in the pipeline image according to the total column number of the pipeline scratch area to obtain a pipeline downsampling image, wherein the set line number is the difference between the total column number and the total line number; if the total row number is equal to the total column number, deleting the rows and columns where the pipeline scratch areas are located in the pipeline image to obtain a pipeline down-sampling image; if the total row number is larger than the total column number, deleting the row and the column where the pipeline scratch area is located in the pipeline image and setting a normal area of the column number according to the total row number of the pipeline scratch area to obtain a pipeline down-sampling image, wherein the set column number is the difference between the total row number and the total column number.
The invention has the following beneficial effects: the method comprises the steps of obtaining edge lines of each defect area of a pipeline image, classifying the edge lines of each defect area according to a gray gradient change curve corresponding to the edge line of each defect area to obtain a suspected pipeline crack area and a pipeline scratch area corresponding to the pipeline image; the method comprises the steps of judging whether the row numbers and the column numbers of pixel points of a suspected pipeline crack area and a pipeline scratch area corresponding to a pipeline image are overlapped, if so, replacing pixel values corresponding to the pixel points of the pipeline scratch area with pixel values corresponding to the pixel points of a normal area of the pipeline to obtain a pipeline down-sampling image, if not, deleting a corresponding target area in the pipeline scratch area in the pipeline image to obtain the pipeline down-sampling image, and on the basis of reserving the suspected pipeline crack area, eliminating the interference of the pipeline scratch area as much as possible, so that the final judgment result is more accurate; replacing a pixel value corresponding to a pixel point in a scratch area of a pipeline image with a pixel value corresponding to a pixel point in a normal area of the pipeline to obtain a new restored image of the pipeline; judging whether an area corresponding to a suspected pipeline crack area in the pipeline downsampling image is a pipeline crack area or not by using a target network, and judging whether an area corresponding to the suspected pipeline crack area in the pipeline new restoration image is a pipeline crack area or not by using the target network; and if the judgment results are all pipeline crack areas, judging that the pipeline image has cracks. According to the method, the down-sampling image of the pipeline and the new restored image of the pipeline are used as the input of the defect identification network, two defect probability distribution maps are obtained for probability matching, and the identification precision of the electric pipeline cracks is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions and advantages of the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a flowchart of an electrical pipeline crack detection method based on image processing according to an embodiment of the present invention.
Detailed Description
To further illustrate the technical means and effects of the present invention for achieving the predetermined objects, the following detailed description of the method for detecting cracks of an electrical pipeline based on image processing according to the present invention is provided with reference to the accompanying drawings and preferred embodiments.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
The following describes a specific scheme of the image processing-based electric pipeline crack detection method specifically with reference to the accompanying drawings.
Embodiment of electric pipeline crack detection method based on image processing
In the prior art, the accuracy rate of detecting the surface cracks of the electric pipeline by using the laser sensor is low. In order to solve the above problem, the present embodiment proposes an electrical pipeline crack detection method based on image processing, and as shown in fig. 1, the electrical pipeline crack detection method based on image processing of the present embodiment includes the following steps:
in step S1, a duct image is acquired.
The camera is installed on the inspection equipment, and the electric pipeline image is collected through the camera. In this embodiment, taking an image of a pipeline distribution area as an example, the following processing is performed, first, graying is performed on the image of the pipeline distribution area to obtain a pipeline grayscale image, the graying is performed by mean graying, the pipeline grayscale image is subjected to image preprocessing, the image preprocessing is performed by median filtering and denoising, salt and pepper noise generated in the image in the signal transmission process is removed, the image is filtered by histogram equalization, the contrast of the image is improved, and the obtained image is the denoised pipeline grayscale image. Graying, median filtering and denoising, and histogram equalization are all known technologies, and are not described herein.
And (3) carrying out image segmentation on the denoised pipeline gray level image by adopting a semantic segmentation network, wherein the network structure of the semantic segmentation network is an Encoder-Decoder, and the loss function is a cross entropy loss function. Specifically, marking the pixel points belonging to the pipeline area in the pipeline gray image as 1, and marking the pixel points of other areas as 0; and inputting the marked image into a semantic segmentation network, performing convolution and pooling by an encoder to obtain a feature vector, performing deconvolution by a decoder to output a semantic segmentation image, wherein the semantic segmentation image is a pipeline image.
And step S2, performing edge detection on the pipeline image to obtain edge lines of each defect area in the pipeline image.
In the embodiment, the pipeline image is segmented, and the size of the segmented pipeline image is
Figure DEST_PATH_IMAGE001
The divided pipeline images are all square graphs due to the division, so that the pipeline images can be subjected to down-sampling processing in the follow-up process. In this embodiment, the pipeline image of the divided region is taken as an example for processing, and the pipeline images of other regions can be processed by the same method.
In order to identify the pipeline crack defect, the embodiment first performs edge detection on the pipeline image. Specifically, edge detection is carried out on the pipeline image by adopting a Canny edge detection algorithm to obtain edge lines of each defect area of the pipeline image.
However, the detected edge may include a pipe scratch in addition to the pipe crack, and in order to avoid the interference of the pipe scratch on the judgment of the subsequent pipe crack, the embodiment further includes the following steps.
And step S3, classifying the edge lines of each defect area according to the gray gradient change curve corresponding to each pixel point on the edge line of each defect area to obtain a suspected pipeline crack area and a pipeline scratch area corresponding to the pipeline image.
In this embodiment, polynomial fitting is performed on the gray values of the pixel points on the edge lines of each defect region of the pipeline image to obtain a function analytic formula of each edge line, derivation is performed on the function analytic formula of each edge line to obtain a slope corresponding to each pixel point on each edge line, a perpendicular line of a tangent line at the pixel point is made for each pixel point on the edge line of each defect region, and a gray gradient change curve corresponding to each pixel point on the edge line of each defect region is constructed according to the gray values of each pixel point on the perpendicular line.
The pipeline scratches are lighter in color and larger in gray value compared with the pixels in the normal area of the pipeline, and the gray values corresponding to the pixels in the normal area of the pipeline are the same, so that when scratches appear in the pipeline image, the gray value is increased, the slope of the corresponding gray gradient change curve is changed, for a pixel on an edge line, the gray gradient change curve of the pixel is increased and then decreased, namely, the slope of the gray gradient change curve of the pixel is positive and then negative, and the embodiment classifies the pipeline defect areas according to the slope change of the gradient change curve corresponding to each pixel on the edge line of each defect area.
In order to improve the identification precision of the pipeline defects, the gray distribution characteristic analysis is carried out on the pipeline defect positions to obtain the image complexity
Figure 945488DEST_PATH_IMAGE002
. Specifically, the gray distribution characteristics are obtained by an image gray co-occurrence matrix. The image pixel points inside the rectangular surrounding frame of the edge line form a gray level co-occurrence matrix, the gray level co-occurrence matrix is different from the traditional gray level co-occurrence matrix in that the gray level co-occurrence matrix is not a square matrix but is in a rectangular frame shape, and gray level binary groups are formed by gray level values of all pixel points inside the gray level co-occurrence matrix and gray level average values of 8 neighborhood pixel points of the gray level co-occurrence matrix
Figure DEST_PATH_IMAGE003
Wherein
Figure 558872DEST_PATH_IMAGE004
is the gray value of the ith pixel point,
Figure DEST_PATH_IMAGE005
obtaining gray level binary group for all pixel points in the rectangular matrix for the gray level mean value of the ith pixel point and 8 adjacent pixel points thereof, and then carrying out frequency counting on the gray level binary group
Figure 13993DEST_PATH_IMAGE006
Carrying out statistics to obtain the distribution probability of different gray level binary groups
Figure DEST_PATH_IMAGE007
Wherein
Figure 396433DEST_PATH_IMAGE008
the gray level co-occurrence matrix is the size of the gray level co-occurrence matrix, namely the product of the number of the row pixels and the number of the column pixels. Calculating the image entropy of the gray level co-occurrence matrix by adopting the following formula:
Figure 498381DEST_PATH_IMAGE010
wherein,
Figure 661378DEST_PATH_IMAGE002
is the image entropy of the gray level co-occurrence matrix,
Figure DEST_PATH_IMAGE011
and normalizing the image entropy of the gray level co-occurrence matrix to obtain the probability of the ith gray level binary group, wherein the image entropy of the gray level co-occurrence matrix after normalization is between 0 and 1.
The gray level co-occurrence matrix reflects texture features of the image, the image entropy reflects information content contained in the aggregation features of the gray level distribution in the image, and the more the information content contained in the aggregation features of the gray level distribution in the image is, the greater the complexity of the image is. The embodiment represents the image complexity of the defect area by using the image entropy of the gray level co-occurrence matrix.
The gray values corresponding to the pixels in the pipeline crack area and the pipeline scratch area are obviously different from the gray values corresponding to the normal area of the pipeline, the pipeline scratch is only the damage of the coating and is the surface damage in general, the occupied area of the scratch area is small, and the gray values of the pixels corresponding to the scratch area are single; the pipeline cracks have certain depth and are different in depth, so that the gray distribution of the acquired image is complex. The embodiment sets the threshold value of the image complexity according to the gray distribution characteristic analysis of the pipeline cracks and the pipeline scratches
Figure 966195DEST_PATH_IMAGE012
When the image complexity is less than
Figure DEST_PATH_IMAGE013
And then, judging that the edge line is the edge line of the pipeline scratch area, wherein in specific application, the image complexity threshold value can be set according to the requirement. And distinguishing the edge lines of the pipeline image defect area by adopting the same method to obtain all the edge lines of the pipeline scratch area, wherein the edge lines of the rest pipeline image defect areas are the edge lines of the suspected pipeline crack area. When the pipe scratch is deep, it may be misjudged as a pipe crack. Thus, a suspected pipe crack region may comprise a partial pipe scratch.
Step S4, acquiring the line number and the column number of each pixel point of the suspected pipeline crack area and the pipeline scratch area corresponding to the pipeline image, judging whether the line number and the column number of the pixel point of the suspected pipeline crack area and the pipeline scratch area corresponding to the pipeline image are overlapped, if so, replacing the pixel value corresponding to the pixel point of the pipeline scratch area with the pixel value corresponding to the pixel point of the normal area of the pipeline to obtain a down-sampling pipeline image; and if not, deleting a corresponding target area in the pipeline image to obtain a pipeline down-sampling image, wherein the target area comprises rows and columns where all pixel points in the pipeline scratch area are located.
The purpose of this embodiment is to determine whether a crack exists in a pipeline image, so that complex pipeline image features are filtered, on the basis of reserving a suspected pipeline crack region, the interference of the pipeline scratch region is eliminated as much as possible, a defect feature image as single as possible is obtained, and the accuracy of the electrical pipeline image crack detection is improved. Because the down-sampling processing of the traditional image is the alternate point sampling, partial pixel points in the pipeline crack area in the pipeline image can be removed, and even the whole pipeline crack area can be removed.
For this situation, the embodiment obtains the row number and the column number of each pixel point in the suspected pipeline crack area and the pipeline scratch area corresponding to the pipeline image, determines whether the row number and the column number of the pixel point in the suspected pipeline crack area and the pipeline scratch area corresponding to the pipeline image are overlapped, and if so, overlaps the pixel point in the pipeline scratch area corresponding to the pixel point in the pipeline crack areaReplacing the value with a pixel value corresponding to a pixel point of a normal area of the pipeline, wherein the normal area of the pipeline does not comprise a suspected pipeline crack area and a pipeline scratch area in the pipeline image; and if the images are not overlapped, deleting the corresponding target area in the pipeline image to obtain a pipeline down-sampling image. Specifically, the process of deleting the corresponding target area in the pipeline image is as follows: counting the number of lines and columns, and assuming that the total number of lines in the scratch area of the pipeline is
Figure 468721DEST_PATH_IMAGE014
Total number of columns being
Figure DEST_PATH_IMAGE015
In order to make the down-sampled image still be a histogram, the comparison is performed
Figure 662942DEST_PATH_IMAGE014
And
Figure 923022DEST_PATH_IMAGE015
in the size of (1)
Figure 673940DEST_PATH_IMAGE014
Is less than
Figure 382306DEST_PATH_IMAGE015
Deleting the row and column of the pipe scratch area in the pipe image and
Figure 826056DEST_PATH_IMAGE016
obtaining a pipeline down-sampling image in a normal area of the line; if it is
Figure 573433DEST_PATH_IMAGE014
Is equal to
Figure 377309DEST_PATH_IMAGE015
Deleting the rows and columns of the pipeline scratch areas in the pipeline image to obtain a pipeline down-sampling image; if it is
Figure 401897DEST_PATH_IMAGE014
Is greater than
Figure 875604DEST_PATH_IMAGE015
Deleting the row and column of the pipe scratch area in the pipe image and
Figure DEST_PATH_IMAGE017
and obtaining a pipeline downsampling image in the normal area of the column.
The traditional down-sampling is generally point-spaced sampling, the down-sampling method of the embodiment is different from the traditional down-sampling method, the embodiment completes down-sampling processing by removing all pixel points in the pipeline scratch area, so that the interference of the pipeline scratch area is eliminated, the defect characteristic image which is as single as possible is obtained, and the detection precision of subsequent pipeline cracks is improved.
And step S5, replacing the pixel values corresponding to the pixel points of the pipeline scratch area in the pipeline image with the pixel values corresponding to the pixel points of the normal area of the pipeline to obtain a new restored image of the pipeline, wherein the normal area of the pipeline is an area which does not include the suspected pipeline crack area and the pipeline scratch area in the pipeline image.
In the embodiment, the pixel values corresponding to the pixel points of the scratch area in the pipeline image are replaced by the pixel values corresponding to the pixel points of the normal area of the pipeline, the obtained image is a new pipeline restoration image, the new pipeline restoration image is different from the pipeline image in that the pipeline scratch area does not exist in the new pipeline restoration image, and the interference on the crack detection result is avoided.
Step S6, judging whether the area corresponding to the suspected pipeline crack area in the pipeline downsampling image is the pipeline crack area by using the target network, and judging whether the area corresponding to the suspected pipeline crack area in the pipeline new recovery image is the pipeline crack area by using the target network; and if the judgment results are that the pipeline crack area exists, judging that the pipeline image has cracks.
In the embodiment, the pipeline downsampling image and the pipeline new restoration image are input into a defect identification network for defect detection, the structure of the defect identification network is an Encoder-Decoder, and a loss function of the defect identification network is a cross entropy loss function. Convolving and pooling a pipeline down-sampling image and a pipeline new restoration image respectively through a defect identification Encoder Encoder to obtain a feature vector of a pipeline crack area, then respectively outputting two defect probability distribution maps through defect identification Decoder Decode deconvolution, and performing probability matching on pixel points identified as defects in the two output defect probability distribution maps.
Because the two output defect probability distribution maps have different sizes, the specific probability matching method of the defect pixel points is as follows: the method comprises the steps of recording the down-sampling size and the down-sampling area of a current down-sampling image, removing pixel points which are not corresponding to positions in the down-sampling image in the pipeline in the new recovery image of the pipeline according to the same down-sampling method, reserving pixel points which are corresponding to the positions in the down-sampling image in the pipeline, carrying out probability matching on the defect probability of the pixel points reserved in the new recovery image of the pipeline and the defect probability of the pixel points in the down-sampling image of the pipeline, and judging that the pixel points are pixel points in a pipeline crack area when the probability of one pixel point corresponding to the two probability distribution maps is greater than a probability threshold value. In this embodiment, the probability threshold is set to 0.7, and in a specific application, the probability threshold is set as required.
In the process of downsampling an image, except for the pixel points in the crack defect area, the pixel points in other areas are removed, the background in the neighborhood of the crack area changes, so that the confidence of the pixel points in the convolution process of the network changes, and the contrast difference between the changed background image and the pixel points in the crack area in the convolution kernel is different, so that the defect identification precision is possibly reduced, and in order to improve the identification precision of the crack defect of the pipeline, the embodiment acquires a new pipeline restored image and inputs the image into the defect identification network to obtain the probability of each pixel point; although the color distribution of each pixel point in the normal area of the pipeline is not uniform, the pixel values of the pixel points in the normal area in the new restored image of the pipeline have certain difference, when the pixel points in the defect area of the new restored image of the pipeline are identified, the interference of the pixel points in the normal area of the pipeline in the new restored image of the pipeline can be possibly received, and the identification precision of the network to the crack defect of the pipeline is reduced, the embodiment takes the down-sampling image of the pipeline and the new restored image of the pipeline as the input of the defect identification network, obtains two defect probability distribution maps and performs probability matching, and improves the identification precision of the crack defect of the pipeline.
In the embodiment of the invention, the edge lines of each defect area of the pipeline image are obtained, and the edge lines of each defect area are classified according to the gray gradient change curve corresponding to the edge line of each defect area to obtain a suspected pipeline crack area and a pipeline scratch area corresponding to the pipeline image; the method comprises the steps of judging whether line numbers and column numbers of pixel points of a suspected pipeline crack area and a pipeline scratch area corresponding to a pipeline image are overlapped or not, if so, replacing pixel values corresponding to pixel points of the pipeline scratch area with pixel values corresponding to pixel points of a normal area of the pipeline to obtain a pipeline down-sampling image, if not, deleting lines and columns where the pixel points of the pipeline scratch area are located in the pipeline image to obtain the pipeline down-sampling image, and on the basis of reserving the suspected pipeline crack area, eliminating the interference of the pipeline scratch area as much as possible, so that the final judgment result is more accurate; in the embodiment, the pixel value corresponding to the pixel point in the pipeline image scratch area is replaced by the pixel value corresponding to the pixel point in the pipeline normal area to obtain a new pipeline restoration image; judging whether an area corresponding to a suspected pipeline crack area in the pipeline downsampling image is a pipeline crack area or not by using a target network, and judging whether an area corresponding to the suspected pipeline crack area in the pipeline new restoration image is a pipeline crack area or not by using the target network; and if the judgment results are all pipeline crack areas, judging that the pipeline image has cracks. In the embodiment, the down-sampling image of the pipeline and the new restored image of the pipeline are used as the input of the defect identification network, and two defect probability distribution maps are obtained for probability matching, so that the identification precision of the electric pipeline cracks is improved.
It should be noted that: the above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (6)

1. An electric pipeline crack detection method based on image processing is characterized by comprising the following steps:
acquiring a pipeline image;
performing edge detection on the pipeline image to obtain edge lines of each defect area in the pipeline image;
classifying the edge lines of the defect areas according to the gray gradient change curves corresponding to the pixel points on the edge lines of the defect areas to obtain suspected pipeline crack areas and pipeline scratch areas corresponding to the pipeline images;
acquiring the row number and the column number of each pixel point of a suspected pipeline crack area and a pipeline scratch area corresponding to a pipeline image, judging whether the row number and the column number of the pixel points of the suspected pipeline crack area and the pipeline scratch area corresponding to the pipeline image are overlapped, and if so, replacing the pixel value corresponding to the pixel point of the pipeline scratch area with the pixel value corresponding to the pixel point of a normal area of the pipeline to obtain a down-sampling pipeline image; if the image is not overlapped, deleting a corresponding target area in the pipeline image to obtain a pipeline down-sampling image, wherein the target area comprises rows and columns where all pixel points of the pipeline scratch area are located;
replacing pixel values corresponding to pixel points of a pipeline scratch area in the pipeline image with pixel values corresponding to pixel points of a normal area of the pipeline to obtain a new restored image of the pipeline, wherein the normal area of the pipeline is an area which does not include a suspected pipeline crack area and a pipeline scratch area in the pipeline image;
judging whether an area corresponding to a suspected pipeline crack area in the pipeline downsampling image is a pipeline crack area or not by using a target network, and judging whether an area corresponding to the suspected pipeline crack area in the pipeline new restoration image is a pipeline crack area or not by using the target network; and if the judgment results are all pipeline crack areas, judging that the pipeline image has cracks.
2. The method of claim 1, wherein the acquiring an image of the pipe comprises:
acquiring an image of a pipeline distribution area;
carrying out graying processing on the image of the pipeline distribution area to obtain a grayed image of the pipeline distribution area;
denoising the grayscale image of the pipeline distribution area to obtain a denoised pipeline grayscale image;
and carrying out image segmentation on the denoised pipeline gray level image to obtain a pipeline image.
3. The method for detecting the crack of the electric pipeline based on the image processing as claimed in claim 1, wherein obtaining the gray gradient change curve corresponding to each pixel point on the edge line of each defect area comprises:
making a perpendicular line of a tangent line of the pixel point through each pixel point on the edge line of each defect area;
and constructing a gray gradient change curve corresponding to each pixel point on the edge line of each defect area according to the gray value of each pixel point on the vertical line.
4. The method according to claim 1, wherein the obtaining of the suspected pipeline crack region and the pipeline scratch region corresponding to the pipeline image comprises:
acquiring the slope of a gray gradient change curve corresponding to each pixel point on the edge line of each defect area;
calculating the gray average value of each pixel point in each defect area of the pipeline image and the pixel point in the adjacent area corresponding to each pixel point, and calculating the image complexity of each defect area of the pipeline image according to the gray average value of each pixel point in each defect area of the pipeline image and the pixel point in the adjacent area corresponding to each pixel point;
classifying the defect areas of the pipeline image according to the slope of the gray gradient change curve corresponding to each pixel point on the edge line of each defect area and the image complexity of each defect area of the pipeline image to obtain a suspected pipeline crack area and a pipeline scratch area corresponding to the pipeline image.
5. The method according to claim 4, wherein the classifying the defect areas of the pipeline image according to the slope of the gray gradient change curve corresponding to each pixel point on the edge line of each defect area and the image complexity of each defect area of the pipeline image to obtain the suspected pipeline crack area and the pipeline scratch area corresponding to the pipeline image comprises:
judging whether the slope of a gray gradient change curve corresponding to each pixel point on the edge line of each defect area is positive and then negative, and whether the image complexity of the area corresponding to the edge line of each defect area is less than a set threshold value, if so, judging that the area corresponding to the edge line is a pipeline scratch area; and if the judgment result is not present, judging that the area corresponding to the edge line is a suspected pipeline crack area.
6. The method for detecting the crack of the electric pipeline based on the image processing as claimed in claim 1, wherein the deleting the corresponding target area in the pipeline image to obtain a down-sampling pipeline image comprises:
acquiring the total row number and the total column number of a pipeline scratch area;
comparing the total line number and the total column number of the pipeline scratch area, if the total line number is smaller than the total column number, deleting the line and the column of the pipeline scratch area in the pipeline image and a normal area with a set line number according to the total column number of the pipeline scratch area to obtain a pipeline down-sampling image, wherein the set line number is the difference between the total column number and the total line number; if the total row number is equal to the total column number, deleting the rows and columns where the pipeline scratch areas are located in the pipeline image to obtain a pipeline down-sampling image; if the total row number is larger than the total column number, deleting the row and the column where the pipeline scratch area is located in the pipeline image and setting a normal area of the column number according to the total row number of the pipeline scratch area to obtain a pipeline down-sampling image, wherein the set column number is the difference between the total row number and the total column number.
CN202210995649.6A 2022-08-19 2022-08-19 Electric pipeline crack detection method based on image processing Active CN115063430B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210995649.6A CN115063430B (en) 2022-08-19 2022-08-19 Electric pipeline crack detection method based on image processing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210995649.6A CN115063430B (en) 2022-08-19 2022-08-19 Electric pipeline crack detection method based on image processing

Publications (2)

Publication Number Publication Date
CN115063430A true CN115063430A (en) 2022-09-16
CN115063430B CN115063430B (en) 2022-10-21

Family

ID=83208197

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210995649.6A Active CN115063430B (en) 2022-08-19 2022-08-19 Electric pipeline crack detection method based on image processing

Country Status (1)

Country Link
CN (1) CN115063430B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116309557A (en) * 2023-05-16 2023-06-23 山东聚宁机械有限公司 Method for detecting fracture of track shoe of excavator
CN116563288A (en) * 2023-07-11 2023-08-08 深圳市欣精艺科技有限公司 Detection method for threaded hole of gear of automobile engine
CN117114420A (en) * 2023-10-17 2023-11-24 南京启泰控股集团有限公司 Image recognition-based industrial and trade safety accident risk management and control system and method
CN117237747A (en) * 2023-11-14 2023-12-15 深圳市明鸿五金制品有限公司 Hardware defect classification and identification method based on artificial intelligence
CN117893532A (en) * 2024-03-14 2024-04-16 山东神力索具有限公司 Die crack defect detection method for die forging rigging based on image processing

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040228432A1 (en) * 2003-05-13 2004-11-18 Glass Samuel W. Remote examination of reactor nozzle j-groove welds
CN112102287A (en) * 2020-09-15 2020-12-18 湖南大学 Image-based green ball crack automatic detection and identification method
CN114723701A (en) * 2022-03-31 2022-07-08 南通博莹机械铸造有限公司 Gear defect detection method and system based on computer vision

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040228432A1 (en) * 2003-05-13 2004-11-18 Glass Samuel W. Remote examination of reactor nozzle j-groove welds
CN112102287A (en) * 2020-09-15 2020-12-18 湖南大学 Image-based green ball crack automatic detection and identification method
CN114723701A (en) * 2022-03-31 2022-07-08 南通博莹机械铸造有限公司 Gear defect detection method and system based on computer vision

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116309557A (en) * 2023-05-16 2023-06-23 山东聚宁机械有限公司 Method for detecting fracture of track shoe of excavator
CN116309557B (en) * 2023-05-16 2023-08-01 山东聚宁机械有限公司 Method for detecting fracture of track shoe of excavator
CN116563288A (en) * 2023-07-11 2023-08-08 深圳市欣精艺科技有限公司 Detection method for threaded hole of gear of automobile engine
CN116563288B (en) * 2023-07-11 2023-09-05 深圳市欣精艺科技有限公司 Detection method for threaded hole of gear of automobile engine
CN117114420A (en) * 2023-10-17 2023-11-24 南京启泰控股集团有限公司 Image recognition-based industrial and trade safety accident risk management and control system and method
CN117114420B (en) * 2023-10-17 2024-01-05 南京启泰控股集团有限公司 Image recognition-based industrial and trade safety accident risk management and control system and method
CN117237747A (en) * 2023-11-14 2023-12-15 深圳市明鸿五金制品有限公司 Hardware defect classification and identification method based on artificial intelligence
CN117237747B (en) * 2023-11-14 2024-01-26 深圳市明鸿五金制品有限公司 Hardware defect classification and identification method based on artificial intelligence
CN117893532A (en) * 2024-03-14 2024-04-16 山东神力索具有限公司 Die crack defect detection method for die forging rigging based on image processing
CN117893532B (en) * 2024-03-14 2024-05-24 山东神力索具有限公司 Die crack defect detection method for die forging rigging based on image processing

Also Published As

Publication number Publication date
CN115063430B (en) 2022-10-21

Similar Documents

Publication Publication Date Title
CN115063430B (en) Electric pipeline crack detection method based on image processing
CN115170576B (en) Aluminum pipe surface defect detection method based on machine vision
CN116168026B (en) Water quality detection method and system based on computer vision
CN106780486B (en) Steel plate surface defect image extraction method
CN111260616A (en) Insulator crack detection method based on Canny operator two-dimensional threshold segmentation optimization
CN115345885A (en) Method for detecting appearance quality of metal fitness equipment
CN116721106A (en) Profile flaw visual detection method based on image processing
CN114972326A (en) Defective product identification method for heat-shrinkable tube expanding process
CN111080582B (en) Method for detecting defects of inner and outer surfaces of workpiece
CN111652857B (en) Infrared detection method for insulator defects
CN115330645B (en) Welding image enhancement method
CN115619793B (en) Power adapter appearance quality detection method based on computer vision
CN110648330B (en) Defect detection method for camera glass
CN116777907A (en) Sheet metal part quality detection method
CN114820625B (en) Automobile top block defect detection method
CN116883408B (en) Integrating instrument shell defect detection method based on artificial intelligence
CN117689655B (en) Metal button surface defect detection method based on computer vision
CN114495098B (en) Diaxing algae cell statistical method and system based on microscope image
CN111489337A (en) Method and system for removing false defects through automatic optical detection
CN117635609B (en) Visual inspection method for production quality of plastic products
CN117974671B (en) Watch dial defect intelligent detection method based on artificial intelligence
CN114881960A (en) Feature enhancement-based cloth linear defect detection method and system
CN118037722A (en) Copper pipe production defect detection method and system
CN115063407A (en) Scratch and crack identification method for annular copper gasket
CN113516619A (en) Product surface flaw identification method based on image processing technology

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