CN109035249B - Pipeline fault parallel global threshold detection method based on image processing - Google Patents
Pipeline fault parallel global threshold detection method based on image processing Download PDFInfo
- Publication number
- CN109035249B CN109035249B CN201811050122.6A CN201811050122A CN109035249B CN 109035249 B CN109035249 B CN 109035249B CN 201811050122 A CN201811050122 A CN 201811050122A CN 109035249 B CN109035249 B CN 109035249B
- Authority
- CN
- China
- Prior art keywords
- threshold
- image
- images
- detection
- interval
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 58
- 238000012545 processing Methods 0.000 title claims abstract description 35
- 238000000034 method Methods 0.000 claims abstract description 22
- 238000000605 extraction Methods 0.000 claims abstract description 17
- 238000004458 analytical method Methods 0.000 claims abstract description 12
- 238000006243 chemical reaction Methods 0.000 claims abstract description 7
- 238000003708 edge detection Methods 0.000 claims description 8
- 238000005286 illumination Methods 0.000 claims description 8
- 230000008569 process Effects 0.000 claims description 8
- 238000009499 grossing Methods 0.000 claims description 3
- 238000001914 filtration Methods 0.000 claims description 2
- 230000007547 defect Effects 0.000 abstract description 8
- 238000010586 diagram Methods 0.000 abstract description 8
- 238000011156 evaluation Methods 0.000 abstract description 4
- 230000009467 reduction Effects 0.000 abstract description 3
- 230000007613 environmental effect Effects 0.000 abstract description 2
- 239000002184 metal Substances 0.000 abstract description 2
- 230000000694 effects Effects 0.000 description 6
- VNWKTOKETHGBQD-UHFFFAOYSA-N methane Chemical compound C VNWKTOKETHGBQD-UHFFFAOYSA-N 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 3
- 206010047571 Visual impairment Diseases 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 230000018109 developmental process Effects 0.000 description 2
- 238000002474 experimental method Methods 0.000 description 2
- 239000003345 natural gas Substances 0.000 description 2
- 238000007781 pre-processing Methods 0.000 description 2
- 238000005070 sampling Methods 0.000 description 2
- 238000012935 Averaging Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000003745 diagnosis Methods 0.000 description 1
- 230000004907 flux Effects 0.000 description 1
- 239000007789 gas Substances 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 239000011159 matrix material Substances 0.000 description 1
- 230000000877 morphologic effect Effects 0.000 description 1
- 238000009659 non-destructive testing Methods 0.000 description 1
- 230000000737 periodic effect Effects 0.000 description 1
- 230000008439 repair process Effects 0.000 description 1
- 238000012216 screening Methods 0.000 description 1
- 230000011218 segmentation Effects 0.000 description 1
- 239000000126 substance Substances 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
- G06T7/0004—Industrial image inspection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/70—Denoising; Smoothing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/90—Dynamic range modification of images or parts thereof
- G06T5/92—Dynamic range modification of images or parts thereof based on global image properties
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/12—Edge-based segmentation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/13—Edge detection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/136—Segmentation; Edge detection involving thresholding
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20024—Filtering details
- G06T2207/20032—Median filtering
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30108—Industrial image inspection
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Quality & Reliability (AREA)
- Image Processing (AREA)
- Image Analysis (AREA)
Abstract
The invention provides a pipeline fault parallel global threshold detection method based on image processing, which comprises the following steps: acquiring a three-channel color image of the pipeline in real time; conversion to a grey scale space; calculating an optimal threshold value; fuzzy noise reduction; setting a central interval, equally dividing a threshold interval, and detecting a plurality of thresholds in parallel to obtain a binary image under the plurality of thresholds; detecting edges; extracting each outline in the image; removing contours that are not within a length threshold; and performing comprehensive analysis, extraction and detection on the parallel global threshold. The invention solves the problem of excessive noise in the traditional image processing to a great extent, provides a more accurate comprehensive fault detection diagram for pipeline fault analysis and improves the accuracy of defect detection and evaluation; the method helps the detection personnel to diagnose the pipeline safety problem in time, maintain in time, prolong the service life of metal equipment, simplify the detection and evaluation of the complex and complicated environmental safety problem in the pipeline, reduce unnecessary loss in pipeline engineering and create social and economic benefits.
Description
Technical Field
The invention belongs to the technical field of nondestructive testing, and particularly relates to a pipeline fault parallel global threshold detection method based on image processing.
Background
With the development of social economy, oil and natural gas become indispensable important energy sources in the world at present, and pipeline transportation is the most safe and effective mode of oil and natural gas, so that pipelines occupy more and more important positions in economic development of various countries at present. However, as traditional engineering equipment, various defects may be generated in the pipeline in each stage of manufacturing, laying and operation, the quality of the pipeline is directly related to the safety of oil and gas transmission, and the extraction and detection of the periodic pipeline fault are important for avoiding the problems of pipeline leakage and the like as much as possible.
At present, methods applied to pipeline fault detection at home and abroad and working principles are different, and main detection methods include ultrasonic guided wave, electromagnetic valve detection, magnetic flux leakage detection, current attenuation method and the like. The methods are generally only suitable for pipelines made of a certain material or specific geological and construction conditions, and have obvious technical limitations.
In order to enhance the universality of the fault detection technology, the traditional image processing algorithm is favored by more engineering detection workers. The pipeline detection technology based on image processing is that a camera is installed on a pipeline detecting instrument or a robot, and after images or video information of the inner surface of a pipeline is shot, the images or the video information is transmitted to a computer on the ground. The method realizes real-time display on a monitor after image preprocessing such as graying, fuzzy noise reduction, binarization, edge detection, contour extraction and the like.
In the image preprocessing series steps, the extraction of the effective fault information is the most critical and difficult step. The morphological segmentation method based on the edge detection can effectively extract fault information to a certain extent, but because the pipeline environment is complex and the interference noise points are numerous, the situation that faults and the noise points are wrongly divided easily occurs when a single threshold value is directly set; meanwhile, the repeated threshold setting processing of the transmission image for a plurality of times inevitably generates a huge amount of engineering data. The feature extraction of the effective information of the faults in the pipeline becomes an important step of the detection and diagnosis of the faults in the pipeline. Therefore, a reasonable fault characteristic information extraction and analysis method is found, which plays a crucial role in improving the accuracy and the efficiency of pipeline detection, and the extraction efficiency of the existing algorithm technology is not high.
Disclosure of Invention
Aiming at the defects in the prior art, the invention provides a pipeline fault parallel global threshold detection method based on image processing, which comprises the following specific processes:
step 1: acquiring a pipeline three-channel color image file in real time;
step 2: converting the three-channel color image file into a gray scale space to obtain a gray scale image, wherein the conversion formula is as follows:
Y←K1·R+K2·G+K3·B
wherein R is a red numerical value in the three-channel color image, G is a green numerical value in the three-channel color image, B is a blue numerical value in the three-channel color image, Y is the obtained gray image, and K is1、K2、K3Respectively corresponding red, green and blue conversion coefficients to the gray level image;
and step 3: calculating to obtain the optimal threshold value of binarization detection in the image by using a self-adaptive binarization threshold value selection algorithm, wherein the specific process comprises the following steps of 3.1-3.4:
step 3.1: intercepting a reasonable size area from the gray level image obtained by processing in the step 2 to obtain an effective gray level image: intercepting to obtain a central effective area with the length and the width respectively being q times of the length and the width of the original image, wherein q is less than 1, so as to eliminate an ineffective area which is not illuminated;
step 3.2: judging whether the effective gray level image meets the illumination condition: when it is satisfied withAnd (3) if the condition is met, continuing the step 3.3, otherwise, immediately stopping detection, and reminding that the illumination is insufficient and the detection is not suitable for continuing. Wherein, λ is the image reference gray value, α is the total number of pixels with gray value greater than λ in the effective region,the total number of pixel points in the effective area;
step 3.3: defining the gray scale light intensity ratio:respectively has four special points alpha1,α2,α3,α4And satisfies the relation:
β1,β2,β3,β4are each alpha1,α2,α3,α4Gray scale light intensity ratios corresponding to the four special points; solving the relation to obtain:
step 3.4: according to the total number alpha of the pixels with the gray value larger than lambda in the effective area, an optimal threshold delta is obtained by applying a function delta to delta (alpha);
in which e is a specially set threshold compensation quantity, alpha1,α2,α3,α4And respectively calculating delta according to the segment function interval where alpha is positioned for the segment end points of the segment interval of the optimal threshold function of the three-channel color image.
And 4, step 4: smoothing the gray level image obtained in the step (2) by adopting a mean filtering method to obtain a noise-reduced image;
and 5: setting a central interval and equally dividing a threshold interval for the denoised image by using an optimal gray threshold delta, and detecting a highlight threshold and a shadow threshold under p thresholds in parallel to obtain a binarized image under 2 x p thresholds, wherein the fault only has two expression forms of highlight and shadow after binarization processing;
step 5.1: setting a central interval: constructing highlight threshold value interval [ delta-n ] for gray level optimal threshold value delta0,δ+n0],n0The parameters determined manually are positive integers; simultaneously constructing a shadow threshold interval [ delta-n ]0-m0,δ+n0-m0],m0The parameters determined manually are positive integers, and the difference between the upper limit and the lower limit of the two intervals is m0The interval length of both intervals is 2n0;
Step 5.2: equally dividing a threshold interval: removing a left end point or a right end point, respectively and uniformly collecting p threshold points in two threshold intervals, and sequentially arranging the threshold points from small to large; the image columns of the highlight threshold interval with p threshold points processed from small to large according to the threshold values are highlight groups which are respectively named as image1-1, image1-2, … and image 1-p; the image columns of the shadow threshold interval which are processed by p threshold points from small to large are shadow groups: respectively named as image2-1, image2-2, … and image 2-p;
step 5.3: respectively carrying out binarization processing on the gray-valued images by using the collected 2 Xp threshold points to obtain 2 Xp binarization-processed images, and arranging the images according to the size of the threshold points from small to large;
step 6: sequentially applying Canny operators to the 2 Xp images obtained in the step 5.3 to carry out edge detection;
and 7: setting a contour function sigma (x, y) and a { contour i } set as all pixel sets of the ith contour, and extracting each contour in the image for 2 x p images after edge detection:
σ1(x, y) 255; (x, y) is e { contour 1 };
σ2(x, y) 255; (x, y) is e { contour 2 };
…
σn(x, y) 255; (x, y) is e { profile n };
wherein (x, y) represents the position of the pixel in the image;
and 8: in each contour, the contours with the total number of pixels not within the length threshold are filtered out: η (i) is the total number of pixels in the profile i, length ({ profile i }) is the function value reflecting the total number of pixels included in the profile i, t1、t2Respectively, according to the length threshold value upper and lower limits manually determined by the pixel points, the following operations are carried out on the outline:
…
after processing, the method screens and removes the contours of which the total number of pixels is not within the range of the length threshold, only retains the real fault information, and screens most invalid information.
And step 9: carrying out parallel global threshold value comprehensive analysis, extraction and detection on 2 Xp processing graphs, and specifically comprising the following steps:
step 9.1: the highlight group images are sequentially divided into p/2 subgroups according to the size of a threshold value, namely, images 1-1 and 1-2, images 1-3 and 1-4, … images 1- (p-1) and images 1-p; the shadow group images are treated the same: the shadow group images are arranged and divided into p/2 subgroups according to the threshold value size sequence: images 2-1 and 2-2, 2-3 and 2-4, … and 2-p;
step 9.2: respectively carrying out outline comparison extraction on images between the upper two groups and each group in the shadow group, reserving overlapped outline partial images, and determining common faults under the processing of the two adjacent threshold values; deleting the non-overlapped contour part images;
step 9.3: and (3) placing the images obtained by the superposition operation of the groups of fault outlines obtained in the step (9.2) into a final image file. And restoring all the images to new images with the same size as the original image to obtain a comprehensive fault detection image after the images are subjected to parallel global threshold comprehensive analysis. If the image has no fault, the fault detection image is pure black.
The beneficial technical effects are as follows:
1. the invention provides a pipeline fault parallel global threshold detection method based on image processing, which solves the problem of excessive noise in the traditional image processing to a great extent and provides a more accurate comprehensive fault detection diagram for pipeline fault analysis, thereby improving the accuracy of defect detection and evaluation;
2. the method includes the steps that light source light intensity information is obtained through defining a gray light intensity proportion parameter in an indirect qualitative mode, a set of function formulas are provided for directly calculating the indirect light intensity information, and an optimal threshold value interval of pipeline fault detection under a specific illumination condition is obtained; the light intensity information of a light source in the pipeline is qualitatively detected, automatic early warning is carried out under the condition that the illumination is weak and effective image information is not transmitted, and the information is timely fed back to engineering personnel, so that the working reliability of the detection equipment is improved;
3. the device helps the detection personnel to diagnose the pipeline safety problem in time, and repair the defects of the pipeline in time, prolongs the service life of metal equipment, simplifies the detection and evaluation of the complex and complicated environmental safety problem in the pipeline, reduces unnecessary loss in pipeline engineering, and further creates considerable social and economic benefits.
Drawings
FIG. 1 is a flowchart of a system and method for parallel global threshold detection of pipeline failures based on image processing according to an embodiment of the present invention;
FIG. 2 is a flowchart of the center interval setting, threshold interval averaging, and binarization processing according to the embodiment of the present invention;
FIG. 3 is a flow chart of the parallel global threshold value comprehensive analysis, extraction and detection according to the embodiment of the present invention;
FIG. 4 is a gray scale processing diagram of an embodiment of the present invention;
FIG. 5 is a diagram illustrating the effect of fuzzy denoising processing according to an embodiment of the present invention;
FIG. 6 is a diagram illustrating the effect of binarization processing under the condition of a threshold value of 199 according to the embodiment of the present invention;
FIG. 7 is a distribution histogram of the binarization threshold range for highlight fault detection according to the embodiment of the present invention;
FIG. 8 is a distribution histogram of a binary threshold range for shadow fault detection according to an embodiment of the present invention;
FIG. 9 is a diagram illustrating the effect of the edge detection process according to the embodiment of the present invention;
FIG. 10 is a diagram illustrating the effect of the contour extraction and screening process according to the embodiment of the present invention;
fig. 11 is a diagram illustrating the effect of the multi-threshold comprehensive extraction process according to the embodiment of the present invention.
Detailed Description
The invention is further described with reference to the accompanying drawings and specific embodiments, and the invention provides a pipeline fault parallel global threshold detection method based on image processing, as shown in the flowchart of fig. 1, the specific process includes:
step 1: acquiring a pipeline three-channel color image file in real time;
the experimental environment is as follows: the pipe diameter is 204 mm's semicircular pipeline, and the defect on the pipeline is known artificial defect, and the last camera of pipeline robot is installed at the shooting position that is 87mm from the pipeline minimum vertical distance, 150 and 250mm apart from the defect horizontal distance, and the light source power that is located the pipeline centre of a circle is 10W. Under the experimental environment, a three-channel color image file of the pipeline fault is shot and acquired in real time;
step 2: calling a cvtColor () library function and a CV _ BGR2GRAY parameter in an OpenCV visual library, performing color space conversion operation on the collected three-channel color image file, and converting the three-channel color image file into a GRAY scale space to obtain a GRAY scale image, wherein the conversion formula is as follows:
Y←0.299·R+0.587·G+0.114·B
wherein, R is a red numerical value in the three-channel color image, G is a green numerical value in the three-channel color image, B is a blue numerical value in the three-channel color image, and Y is the obtained grayscale image, as shown in fig. 4;
and step 3: calculating to obtain the optimal threshold value of binarization detection in the image by using a self-adaptive binarization threshold value selection algorithm, wherein the specific process comprises the following steps of 3.1-3.4:
step 3.1: intercepting an area with a reasonable size in the gray level image to obtain an effective gray level image: intercepting to obtain central effective areas with the length and the width respectively being 0.6 times of the length and the width of the original image, wherein the reasonable size is selected to eliminate the areas which are not illuminated, through a plurality of experiments, the length and the width of the original image which are 0.6 times of the length and the width of the original image are enough to eliminate the areas which are not illuminated, and the number of sampling points is not too small, 110591 sampling points are adopted in the embodiment, and the requirement of detection is met.
Step 3.2: judging whether the effective gray level image meets the illumination condition: when it is satisfied withAnd (3) if the condition is met, continuing the step 3.3, otherwise, immediately stopping detection and reminding that the illumination is insufficient and the detection is not suitable for continuing. Wherein the content of the first and second substances,the total number of pixels in the effective area. Setting the image reference gray-scale value as λ as 200, according to step 3.1: total number of pixels in effective areaAnd simultaneously recording the total number of pixel points with the gray value larger than lambda in the effective area, recording the total number as alpha, and solving the following steps: α is 14948.
Step 3.3: defining the gray scale light intensity ratio:to obtainRespectively has four special points alpha1,α2,α3,α4And satisfies the relation:
β1,β2,β3,β4are each alpha1,α2,α3,α4Gray scale light intensity ratios corresponding to the four special points; solving the relation to obtain:
obtaining by solution: alpha is alpha1=1106,α2=554,α3=368,α4276, the number of pixel points is an integer, and the decimal part is rounded;
step 3.4: according to the total number alpha of the pixels with the gray value larger than lambda in the effective area, an optimal threshold delta is obtained by applying a function delta to delta (alpha);
the epsilon in the function is a specially set threshold compensation quantity which can be set to be 0, ± 10, ± 15, ± 20; alpha is alpha1,α2,α3,α4The interval end points of the segment intervals of the optimal threshold function of the target image are respectively when alpha is<α4Stopping the calculation of the optimal threshold value; calculating delta according to the piecewise function interval where the alpha is located, obtaining delta (199) according to the function delta (delta), and obtaining the compensation epsilon (0), namely the optimal threshold value of the image fault extraction is 199;
and 4, step 4: smoothing the gray level image obtained in the step 2 by using a kernel matrix with the size of 7 multiplied by 7 by adopting a blu () library function to obtain an image after noise reduction, as shown in fig. 5;
and 5: performing center interval setting, threshold interval equipartition and multiple threshold parallel detection on the denoised image by utilizing the optimal gray threshold delta to obtain a binary image under multiple thresholds, as shown in a flow chart 2, and a result is shown in fig. 6, wherein a fault has two expression forms of highlight and shadow after binarization processing, and after multiple times of same condition experiments, data rules are counted to obtain fig. 7 and fig. 8, which respectively reflect the distribution frequency of each binary threshold interval of highlight and dark fault detection, and a function formula in the step 3 is proved;
step 5.1: constructing a highlight threshold interval [ delta-15, delta +15] to obtain [184,214] and a shadow threshold interval [ delta-65, delta-35 ] to obtain [134,164] for the optimal gray threshold value delta-199, wherein the threshold span of the two intervals is 30, and the difference between the upper limit and the lower limit of the two intervals is 50;
step 5.2: equally dividing a threshold interval: removing a left end point or a right end point, respectively and uniformly collecting p threshold points in two threshold intervals, and sequentially arranging the threshold points from small to large; the image columns of 10 threshold points in the highlight threshold interval after being processed from small threshold value to large threshold value are highlight groups: respectively named as image1-1, image1-2, … and image 1-10; the 10 threshold points in the shadow threshold interval are arranged as shadow groups according to the image columns processed from small threshold to large threshold: respectively named as image2-1, image2-2, … and image 2-10;
step 5.3: using a threshold () library function, using the CV _ THRESH _ BINARY parameter, the maximum value is 255, and the specific threshold value is referred to the threshold interval of step 5.1. Respectively carrying out binarization processing on the gray level images by using 20 collected threshold points to obtain 20 binarization processed images, arranging the images according to the size of the threshold points from small to large in sequence, and preparing for parallel data processing of the next step;
step 6: adopting a Canny () library function, setting the low threshold parameter to be 3, the high threshold parameter to be 9 and the Sobel kernel size to be 3, and sequentially applying a Canny operator to the 20 images obtained in the step 5 for edge detection, as shown in FIG. 9;
and 7: adopting findContours () library function, respectively making mode parameter CV _ RETR _ TREE, method parameter CV _ CHAIN _ APPROX _ SIMPLE and offset parameter Point (0,0), setting outline function sigma (x, y), and { outline i } set as all pixel sets of ith outline, and carrying out the following operations on the image obtained in step 6:
σ1(x, y) 255; (x, y) is e { contour 1 };
σ2(x, y) 255; (x, y) is e { contour 2 };
…
σn(x, y) 255; (x, y) is e { profile n };
wherein (x, y) represents the position of the pixel in the image, and each contour in the image is extracted through the operation and is stored in the hierarchy vector;
and 8: in each contour, the contours with the total number of pixels not within the length threshold are filtered out: η (i) is the total number of pixels in the profile i, length ({ profile i }) is the function value reflecting the total number of pixels included in the profile i, t1、t2Respectively, according to the length threshold value upper and lower limits manually determined by the pixel points, the following operations are carried out on the outline:
…
reading the length of each contour by means of an arcLength () library function; after processing, the draw Contours () library function is adopted to output the effective contour in the hierarchy vector (the parameters color in the library function is Scalar (255), thickness is 1, lineTpye is 8, maxLevel is 0, and offset is Point (0, 0).
The method screens and removes the outline of which the total number of pixels is not within the range of the length threshold value, so that only the real fault information is reserved, and most of invalid information such as noise and the like is screened out, as shown in FIG. 10;
and step 9: performing parallel global threshold value comprehensive analysis, extraction and detection on the 20 processing graphs, wherein a flow chart is shown in fig. 3, and the specific steps are as follows:
step 9.1: the highlight group images are sequentially divided into 5 groups according to the size of a threshold, namely, image1-1, image1-2, image1-3, image1-4, … image1-9 and image 1-10; the shadow group images are treated the same: the shadow group images are divided into 5 subgroups in order of threshold size: image2-1 and image2-2, image2-3 and image2-4, … image2-9 and image 2-10;
step 9.2: respectively carrying out outline comparison and extraction on images between the groups in the highlight group and the shadow group, reserving overlapped outline partial images, and determining common faults under the processing of the two adjacent threshold values; deleting the non-overlapped contour part images; step 9.3: and (3) placing the images obtained in the step (9.2) after the superposition operation is performed on each group of fault outlines into a final image file, and restoring all the images into new images with the same size as the original images to obtain a comprehensive fault detection image of the images after parallel global threshold comprehensive analysis, as shown in fig. 11. If the image has no fault, the fault detection image is pure black.
And (3) test results:
and detecting 15 faults totally, detecting 3 groups of no faults, and accumulating 45 faults, wherein the number of effective detections is 39, 6 faults cannot be detected under the influence of experimental light source conditions, the number of successful detections is 37, and the success rate is 94.9%.
Claims (2)
1. A pipeline fault parallel global threshold detection method based on image processing is characterized by comprising the following processes:
step 1: acquiring a pipeline three-channel color image file in real time;
step 2: converting the three-channel color image file into a gray scale space to obtain a gray scale image, wherein the conversion formula is as follows:
Y←K1·R+K2·G+K3·B
wherein R is a red numerical value in the three-channel color image, G is a green numerical value in the three-channel color image, B is a blue numerical value in the three-channel color image, Y is the obtained gray image, and K is1、K2、K3Respectively corresponding red, green and blue conversion coefficients to the gray level image;
and step 3: calculating to obtain the optimal threshold value of binarization detection in the image by using a self-adaptive binarization threshold value selection algorithm, wherein the specific process comprises the following steps of 3.1-3.4:
step 3.1: intercepting a reasonable size area in the gray level image to obtain an effective gray level image: intercepting to obtain a central effective area with the length and the width being q times of the length and the width of the original image respectively, wherein q is less than 1, and the central effective area is used for excluding an ineffective area which is not illuminated;
step 3.2: judging whether the effective gray level image meets the illumination condition: when it is satisfied withIf so, continuing the step 3.3, otherwise, immediately stopping detection, and reminding that the illumination is insufficient and the detection is not suitable for continuing; wherein, λ is the image reference gray value, α is the total number of pixels with gray value greater than λ in the effective region,the total number of pixel points in the effective area;
step 3.3: defining the gray scale light intensity ratio:respectively has four special points alpha1,α2,α3,α4And satisfies the relation:
β1,β2,β3,β4are each alpha1,α2,α3,α4Gray scale light intensity ratios corresponding to the four special points; solving the relation to obtain:
step 3.4: according to the total number alpha of the pixels with the gray value larger than lambda in the effective area, an optimal threshold delta is obtained by applying a function delta to delta (alpha);
in which e is a specially set threshold compensation quantity, alpha1,α2,α3,α4Respectively serving as interval endpoints of a segment interval of the optimal threshold function of the three-channel color image, and calculating delta according to the segment function interval where alpha is located;
and 4, step 4: smoothing the gray level image obtained in the step (2) by adopting a mean filtering method to obtain a noise-reduced image;
and 5: setting a central interval and equally dividing a threshold interval for the denoised image by using an optimal gray threshold delta, and detecting a highlight threshold and a shadow threshold under p thresholds in parallel to obtain a binarized image under 2 x p thresholds, wherein the fault only has two expression forms of highlight and shadow after binarization processing; the method comprises the following steps:
step 5.1: setting a central interval: constructing highlight threshold value interval [ delta-n ] for gray level optimal threshold value delta0,δ+n0],n0The parameters determined manually are positive integers; simultaneously constructing a shadow threshold interval [ delta-n ]0-m0,δ+n0-m0],m0The parameters determined manually are positive integers, and the difference between the upper limit and the lower limit of the two intervals is m0The interval length of both intervals is 2n0;
Step 5.2: equally dividing a threshold interval: removing a left end point or a right end point, respectively and uniformly collecting p threshold points in two threshold intervals, and sequentially arranging the threshold points from small to large; the image columns of the highlight threshold interval with p threshold points processed from small to large according to the threshold values are highlight groups which are respectively named as image1-1, image1-2, … and image 1-p; the image columns of the shadow threshold interval which are processed by p threshold points from small to large are shadow groups: respectively named as image2-1, image2-2, … and image 2-p;
step 5.3: respectively carrying out binarization processing on the gray-valued images by using the collected 2 Xp threshold points to obtain 2 Xp binarization-processed images, and arranging the images according to the size of the threshold points from small to large;
step 6: carrying out edge detection on 2 Xp binary images;
and 7: setting a contour function alpha (x, y) and a { contour i } set as all pixel sets of the ith contour, and extracting each contour in the image for 2 x p images after edge detection:
σ1(x, y) 255; (x, y) is e { contour 1 };
σ2(x, y) 255; (x, y) is e { contour 2 };
…
σn(x, y) 255; (x, y) is e { profile n };
where (x, y) represents the position of the pixel in the image, σn(x, y) is the nth profile function;
and 8: in each contour, the contours with the total number of pixels not within the length threshold are filtered out: eta (i) is the total number of pixels in the profile i, and length ({ profile i }) is a function value reflecting the total number of pixels in the profile iTotal number of pixels included, t1、t2Respectively, according to the length threshold value upper and lower limits manually determined by the pixel points, the following operations are carried out on the outline:
and step 9: carrying out parallel global threshold comprehensive analysis, extraction and detection on 2 Xp processing images to obtain a comprehensive fault detection image after the parallel global threshold comprehensive analysis of the images, wherein the specific flow is as follows:
step 9.1: the highlight group images are sequentially divided into p/2 subgroups according to the size of a threshold value, namely, images 1-1 and 1-2, images 1-3 and 1-4, … images 1- (p-1) and images 1-p; the shadow group images are treated the same: the shadow group images are arranged and divided into p/2 subgroups according to the threshold value size sequence: images 2-1 and 2-2, 2-3 and 2-4, … image2- (p-1) and 2-p;
step 9.2: respectively carrying out outline comparison extraction on images between each group in the highlight group and each group in the shadow group, reserving overlapped outline partial images, and determining common faults under the processing of the two adjacent threshold values; deleting the non-overlapped contour part images; step 9.3: and (3) placing the images obtained in the step (9.2) after the superposition operation is carried out on each group of fault outlines into a final image file, and restoring all the images into new images with the same size as the original images to obtain a comprehensive fault detection image after the images are subjected to parallel global threshold comprehensive analysis.
2. The parallel global threshold detection method for pipeline faults based on image processing according to claim 1, wherein the comprehensive fault detection image obtained in step 9 is pure black if no fault exists in the image.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811050122.6A CN109035249B (en) | 2018-09-10 | 2018-09-10 | Pipeline fault parallel global threshold detection method based on image processing |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811050122.6A CN109035249B (en) | 2018-09-10 | 2018-09-10 | Pipeline fault parallel global threshold detection method based on image processing |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109035249A CN109035249A (en) | 2018-12-18 |
CN109035249B true CN109035249B (en) | 2021-08-24 |
Family
ID=64620775
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811050122.6A Active CN109035249B (en) | 2018-09-10 | 2018-09-10 | Pipeline fault parallel global threshold detection method based on image processing |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109035249B (en) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109900363A (en) * | 2019-01-02 | 2019-06-18 | 平高集团有限公司 | A kind of object infrared measurement of temperature method and apparatus based on contours extract |
CN109961409B (en) * | 2019-02-26 | 2024-02-27 | 平安科技(深圳)有限公司 | Method and device for linearly enhancing image contrast |
CN111311525A (en) * | 2019-11-20 | 2020-06-19 | 重庆邮电大学 | Image gradient field double-interval equalization algorithm based on histogram probability correction |
CN110992331A (en) * | 2019-11-27 | 2020-04-10 | 中国地质大学(武汉) | Quantitative evaluation device and method for pore structure characteristics of two-dimensional porous medium |
CN111292293B (en) * | 2020-01-19 | 2023-04-25 | 佛山科学技术学院 | Intelligent manipulator fault detection method and system |
CN112184588A (en) * | 2020-09-29 | 2021-01-05 | 哈尔滨市科佳通用机电股份有限公司 | Image enhancement system and method for fault detection |
Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101246467A (en) * | 2007-11-19 | 2008-08-20 | 清华大学 | Leakage locating method combining self-adapting threshold value leak detection and multi-dimension fast delay time search |
CN101886744A (en) * | 2010-06-25 | 2010-11-17 | 东北大学 | Ultrasonic positioning device and positioning method of portable internal pipeline fault detection equipment |
GB2500592A (en) * | 2012-03-25 | 2013-10-02 | Dehao Ju | Multi-threshold algorithm for analyzing out of focus particles and droplets |
CN103400365A (en) * | 2013-06-26 | 2013-11-20 | 成都金盘电子科大多媒体技术有限公司 | Automatic segmentation method for lung-area CT (Computed Tomography) sequence |
CN105184788A (en) * | 2015-08-31 | 2015-12-23 | 广州杰赛科技股份有限公司 | Pipeline detection terminal and method |
US9235878B1 (en) * | 2013-10-03 | 2016-01-12 | Allen Gene Hirsh | Method for retaining edges in an enlarged digital image |
CN107013811A (en) * | 2017-04-12 | 2017-08-04 | 武汉科技大学 | A kind of pipeline liquid leakage monitoring method based on image procossing |
CN107169983A (en) * | 2017-04-13 | 2017-09-15 | 西安电子科技大学 | Multi-threshold image segmentation method based on cross and variation artificial fish-swarm algorithm |
CN107178710A (en) * | 2017-04-11 | 2017-09-19 | 东北大学 | Discrimination method inside and outside a kind of defect of pipeline based on inside and outside detection signal characteristic abstraction |
CN107358585A (en) * | 2017-06-30 | 2017-11-17 | 西安理工大学 | Misty Image Enhancement Method based on fractional order differential and dark primary priori |
CN107516318A (en) * | 2017-08-25 | 2017-12-26 | 四川长虹电器股份有限公司 | Multi-Level Threshold Image Segmentation method based on pattern search algorithm and glowworm swarm algorithm |
CN107862677A (en) * | 2017-10-16 | 2018-03-30 | 中铁第四勘察设计院集团有限公司 | The Tunnel Lining Cracks recognition methods of thresholding algorithm and system between a kind of class based on gradient |
CN108470345A (en) * | 2017-02-23 | 2018-08-31 | 南宁市富久信息技术有限公司 | A kind of method for detecting image edge of adaptive threshold |
-
2018
- 2018-09-10 CN CN201811050122.6A patent/CN109035249B/en active Active
Patent Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101246467A (en) * | 2007-11-19 | 2008-08-20 | 清华大学 | Leakage locating method combining self-adapting threshold value leak detection and multi-dimension fast delay time search |
CN101886744A (en) * | 2010-06-25 | 2010-11-17 | 东北大学 | Ultrasonic positioning device and positioning method of portable internal pipeline fault detection equipment |
GB2500592A (en) * | 2012-03-25 | 2013-10-02 | Dehao Ju | Multi-threshold algorithm for analyzing out of focus particles and droplets |
CN103400365A (en) * | 2013-06-26 | 2013-11-20 | 成都金盘电子科大多媒体技术有限公司 | Automatic segmentation method for lung-area CT (Computed Tomography) sequence |
US9235878B1 (en) * | 2013-10-03 | 2016-01-12 | Allen Gene Hirsh | Method for retaining edges in an enlarged digital image |
CN105184788A (en) * | 2015-08-31 | 2015-12-23 | 广州杰赛科技股份有限公司 | Pipeline detection terminal and method |
CN108470345A (en) * | 2017-02-23 | 2018-08-31 | 南宁市富久信息技术有限公司 | A kind of method for detecting image edge of adaptive threshold |
CN107178710A (en) * | 2017-04-11 | 2017-09-19 | 东北大学 | Discrimination method inside and outside a kind of defect of pipeline based on inside and outside detection signal characteristic abstraction |
CN107013811A (en) * | 2017-04-12 | 2017-08-04 | 武汉科技大学 | A kind of pipeline liquid leakage monitoring method based on image procossing |
CN107169983A (en) * | 2017-04-13 | 2017-09-15 | 西安电子科技大学 | Multi-threshold image segmentation method based on cross and variation artificial fish-swarm algorithm |
CN107358585A (en) * | 2017-06-30 | 2017-11-17 | 西安理工大学 | Misty Image Enhancement Method based on fractional order differential and dark primary priori |
CN107516318A (en) * | 2017-08-25 | 2017-12-26 | 四川长虹电器股份有限公司 | Multi-Level Threshold Image Segmentation method based on pattern search algorithm and glowworm swarm algorithm |
CN107862677A (en) * | 2017-10-16 | 2018-03-30 | 中铁第四勘察设计院集团有限公司 | The Tunnel Lining Cracks recognition methods of thresholding algorithm and system between a kind of class based on gradient |
Non-Patent Citations (2)
Title |
---|
基于多阈值归一化分割的模糊图像边缘分割算法;黄爱华 等;《半导体光电》;20170228;第38卷(第01期);第142-151页 * |
管道焊缝检测视觉图像处理的研究;廖志华 等;《工艺与新技术》;20111231;第40卷(第6期);第33-36页 * |
Also Published As
Publication number | Publication date |
---|---|
CN109035249A (en) | 2018-12-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109035249B (en) | Pipeline fault parallel global threshold detection method based on image processing | |
CN111402248B (en) | Power transmission line wire defect detection method based on machine vision | |
Moon et al. | Intelligent crack detecting algorithm on the concrete crack image using neural network | |
CN111260616A (en) | Insulator crack detection method based on Canny operator two-dimensional threshold segmentation optimization | |
CN115082418B (en) | Precise identification method for automobile parts | |
CN114549522A (en) | Textile quality detection method based on target detection | |
CN109190624B (en) | Kitchen oil smoke concentration detection method based on image processing | |
Oliveira et al. | Road surface crack detection: Improved segmentation with pixel-based refinement | |
CN106934801A (en) | A kind of fluorescentmagnetic particle(powder) defect inspection method based on Laws texture filterings | |
JP2012202858A (en) | Closure crack detection method of concrete surface | |
Ye et al. | Diagnosis of sewer pipe defects on image recognition of multi-features and support vector machine in a southern Chinese city | |
CN109239073A (en) | A kind of detection method of surface flaw for body of a motor car | |
CN113935666B (en) | Building decoration wall tile abnormity evaluation method based on image processing | |
CN103674968A (en) | Method and device for evaluating machine vision original-value detection of exterior corrosion appearance characteristics of material | |
CN111192273A (en) | Digital shot blasting coverage rate measuring method based on computer vision technology | |
Lyasheva et al. | Detection and recognition of pavement cracks based on computer vision technology | |
CN114298983A (en) | Intelligent identification and measurement method for defects of anticorrosive layer | |
Li et al. | An improved water surface images segmentation algorithm based on the Otsu method | |
CN112964437A (en) | Oil microleakage recognition method | |
Yan et al. | Multi-scale multi-intensity defect detection in ray image of weld bead | |
CN116363522A (en) | Coastal zone reclamation sea change remote sensing monitoring method based on deep learning | |
Hashmi et al. | Computer-vision based visual inspection and crack detection of railroad tracks | |
JPH09119900A (en) | Method for automatically evaluating concrete defect | |
CN111626104B (en) | Cable hidden trouble point detection method and device based on unmanned aerial vehicle infrared thermal image | |
CN112396618A (en) | Grain boundary extraction and grain size measurement method based on image processing |
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 |