CN115063430B - 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
CN115063430B
CN115063430B CN202210995649.6A CN202210995649A CN115063430B CN 115063430 B CN115063430 B CN 115063430B CN 202210995649 A CN202210995649 A CN 202210995649A CN 115063430 B CN115063430 B CN 115063430B
Authority
CN
China
Prior art keywords
pipeline
image
area
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.)
Active
Application number
CN202210995649.6A
Other languages
Chinese (zh)
Other versions
CN115063430A (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)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Computing Systems (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Multimedia (AREA)
  • Quality & Reliability (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 by using the pixel value of the normal area to obtain a new restored image, and judging whether a suspected pipeline crack area in the pipeline image under the pipeline image is a 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 pipeline scratch defect can cause certain interference on the crack detection, 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 prior art, 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 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;
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 the 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 target areas are not overlapped, deleting the corresponding target areas in the pipeline image to obtain a pipeline down-sampling image, wherein the target areas comprise rows and columns where all pixel points in 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 pipeline normal area to obtain a new pipeline recovery image, wherein the pipeline normal area 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 image of the pipeline 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 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.
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 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.
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 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.
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, and obtaining 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 down-sampling 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 recovery 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 adopted to achieve the predetermined object, the following detailed description of a 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 cracks on the surface 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:
step S1, acquiring a pipeline image.
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 to remove salt and pepper noise generated in the image during signal transmission, the image is filtered by histogram equalization to improve the contrast of the image, 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 again.
And (3) performing 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 S2, carrying out 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 segmentation enables all the segmented pipeline images to be square graphs so as to facilitate the subsequent down-sampling processing of the pipeline images. 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 S3, 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.
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 level distribution characteristics are obtained through an image gray level co-occurrence matrix. The image pixel points in the rectangular surrounding frame of the edge line form a gray level co-occurrence matrix, and the gray level co-occurrence matrix and the image pixel points form a gray level co-occurrence matrixThe gray level co-occurrence matrix is different from a square matrix in that the gray level co-occurrence matrix is in a rectangular frame shape, and gray level binary groups are formed by gray level values of all pixel points in 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, in the process,
Figure 558872DEST_PATH_IMAGE004
is the gray value of the ith pixel point,
Figure DEST_PATH_IMAGE005
for the gray mean value of the ith pixel point and the 8 neighborhood pixel points, acquiring gray binary groups for all the pixel points in the rectangular matrix, and then, acquiring the frequency of the gray binary groups
Figure 13993DEST_PATH_IMAGE006
Carrying out statistics to obtain the distribution probability of different gray level binary groups
Figure DEST_PATH_IMAGE007
Wherein, in the process,
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 the content of the first and second substances,
Figure 661378DEST_PATH_IMAGE002
is the image entropy of the gray level co-occurrence matrix,
Figure DEST_PATH_IMAGE011
normalizing the image entropy of the gray level co-occurrence matrix for the probability of the ith gray level binary groupThe image entropy of the gray level co-occurrence matrix 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, an image complexity threshold value can be set according to requirements. 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.
S4, acquiring the row 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 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 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 the 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, judges 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, if so, replaces the pixel value corresponding to the pixel point in the pipeline scratch area with the pixel value corresponding to the pixel point in the normal area of the pipeline, and the normal area of the pipeline does not include the suspected pipeline crack area and the 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 the total number of lines in the scratch area of the pipeline
Figure 468721DEST_PATH_IMAGE014
The 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, the column and the sum of the scratch area of the pipeline in the pipeline image
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 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 pipeline normal area to obtain a new pipeline restored image, wherein the pipeline normal area 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.
S6, judging whether an area corresponding to the 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 new pipeline restoration image is a pipeline crack area or not 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 graphs have different sizes, the specific probability matching method of the defect pixel points comprises the following steps: 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 do not correspond to positions in the down-sampling image in the new pipeline restoration image according to the same down-sampling method, reserving pixel points which correspond 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 pipeline restoration image and the defect probability of the pixel points in the down-sampling image in the pipeline, and when the probability that one pixel point corresponds to two probability distribution maps is larger than a probability threshold value, judging the pixel points to be pipeline crack areas. 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, so that a suspected pipeline crack area and a pipeline scratch area corresponding to the pipeline image are obtained; 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 this embodiment, the pixel values corresponding to the pixel points in the pipeline image scratch area are replaced with the pixel values corresponding to the pixel points in the pipeline normal area 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. 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 target areas are not overlapped, deleting the corresponding target areas in the pipeline image to obtain a pipeline down-sampling image, wherein the target areas comprise rows and columns where all pixel points in 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 down-sampling 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 recovery 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 image processing-based electric pipeline crack detection method according to claim 1, wherein obtaining a gray gradient change curve corresponding to each pixel point on each defect region edge line 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;
and 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 as claimed in claim 4, wherein the step of 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 yes, 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 pipeline down-sampling 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 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.
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 CN115063430A (en) 2022-09-16
CN115063430B true 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)

Families Citing this family (5)

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

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6856662B2 (en) * 2003-05-13 2005-02-15 Framatome Anp, Inc. Remote examination of reactor nozzle J-groove welds
CN112102287B (en) * 2020-09-15 2021-10-29 湖南大学 Image-based green ball crack automatic detection and identification method
CN114723701B (en) * 2022-03-31 2023-04-18 厦门力和行自动化有限公司 Gear defect detection method and system based on computer vision

Also Published As

Publication number Publication date
CN115063430A (en) 2022-09-16

Similar Documents

Publication Publication Date Title
CN115063430B (en) Electric pipeline crack detection method based on image processing
CN113538433B (en) Mechanical casting defect detection method and system based on artificial intelligence
CN115170576B (en) Aluminum pipe surface defect detection method based on machine 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
CN114972326A (en) Defective product identification method for heat-shrinkable tube expanding process
CN116168026A (en) Water quality detection method and system based on computer vision
CN111027546B (en) Character segmentation method, device and computer readable storage medium
CN111489337B (en) Automatic optical detection pseudo defect removal method and system
CN116777907A (en) Sheet metal part quality detection method
CN115619793B (en) Power adapter appearance quality detection method based on computer vision
CN115100221A (en) Glass defect segmentation method
CN110648330B (en) Defect detection method for camera glass
CN115330645B (en) Welding image enhancement method
CN114549981A (en) Intelligent inspection pointer type instrument recognition and reading method based on deep learning
CN111738256B (en) Composite CT image segmentation method based on improved watershed algorithm
CN114820625B (en) Automobile top block defect detection method
CN116883408B (en) Integrating instrument shell defect detection method based on artificial intelligence
CN114495098B (en) Diaxing algae cell statistical method and system based on microscope image
CN112017109B (en) Online ferrographic video image bubble elimination method
CN115205223A (en) Visual detection method and device for transparent object, computer equipment and medium
CN115063407A (en) Scratch and crack identification method for annular copper gasket
CN113516619A (en) Product surface flaw identification method based on image processing technology
CN112508913A (en) Cable section edge detection method based on image detection

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