CN117152137A - Welded pipe corrosion state detection method based on image processing - Google Patents
Welded pipe corrosion state detection method based on image processing Download PDFInfo
- Publication number
- CN117152137A CN117152137A CN202311413614.8A CN202311413614A CN117152137A CN 117152137 A CN117152137 A CN 117152137A CN 202311413614 A CN202311413614 A CN 202311413614A CN 117152137 A CN117152137 A CN 117152137A
- Authority
- CN
- China
- Prior art keywords
- corrosion
- boundary
- connected domain
- image block
- image
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000005260 corrosion Methods 0.000 title claims abstract description 172
- 230000007797 corrosion Effects 0.000 title claims abstract description 172
- 238000001514 detection method Methods 0.000 title claims abstract description 31
- 238000012545 processing Methods 0.000 title claims abstract description 22
- 229910000831 Steel Inorganic materials 0.000 claims abstract description 94
- 239000010959 steel Substances 0.000 claims abstract description 94
- 230000007547 defect Effects 0.000 claims abstract description 66
- 238000000034 method Methods 0.000 claims abstract description 57
- 238000003466 welding Methods 0.000 claims abstract description 37
- 230000011218 segmentation Effects 0.000 claims abstract description 28
- 238000000605 extraction Methods 0.000 claims abstract description 9
- 238000003709 image segmentation Methods 0.000 claims abstract description 6
- 238000005259 measurement Methods 0.000 claims description 22
- 239000000203 mixture Substances 0.000 claims description 14
- 238000005452 bending Methods 0.000 claims description 6
- 238000009826 distribution Methods 0.000 claims description 3
- 238000012163 sequencing technique Methods 0.000 claims description 2
- 230000008569 process Effects 0.000 description 17
- 238000004519 manufacturing process Methods 0.000 description 8
- 238000003708 edge detection Methods 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 5
- 230000000694 effects Effects 0.000 description 4
- 238000011161 development Methods 0.000 description 3
- 230000018109 developmental process Effects 0.000 description 3
- 238000011156 evaluation Methods 0.000 description 3
- 238000001914 filtration Methods 0.000 description 3
- 238000004220 aggregation Methods 0.000 description 2
- 230000002776 aggregation Effects 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 2
- 238000005520 cutting process Methods 0.000 description 2
- 238000005530 etching Methods 0.000 description 2
- 239000011241 protective layer Substances 0.000 description 2
- 210000001525 retina Anatomy 0.000 description 2
- 241001048891 Jatropha curcas Species 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 230000002950 deficient Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000005286 illumination Methods 0.000 description 1
- JEIPFZHSYJVQDO-UHFFFAOYSA-N iron(III) oxide Inorganic materials O=[Fe]O[Fe]=O JEIPFZHSYJVQDO-UHFFFAOYSA-N 0.000 description 1
- 230000001788 irregular Effects 0.000 description 1
- 239000002184 metal Substances 0.000 description 1
- 239000007769 metal material Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 230000001105 regulatory effect Effects 0.000 description 1
- 230000003014 reinforcing effect Effects 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
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/20—Image enhancement or restoration using local operators
- G06T5/30—Erosion or dilatation, e.g. thinning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/40—Image enhancement or restoration using histogram techniques
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/11—Region-based segmentation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/136—Segmentation; Edge detection involving thresholding
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/187—Segmentation; Edge detection involving region growing; involving region merging; involving connected component labelling
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)
Abstract
The invention relates to the technical field of image data processing, and provides a welded pipe corrosion state detection method based on image processing, which comprises the following steps: acquiring a gray level map of the surface of the steel pipe; acquiring a connected domain extraction result in an image block by adopting a region growing algorithm; acquiring corrosion boundary tortuosity according to corrosion characteristics in eight adjacent areas of the boundary point on each connected domain; acquiring corrosion defect influence coefficients according to the complexity of image information in each corner adjacent region in each connected region and the corrosion boundary tortuosity; obtaining a segmentation threshold according to corrosion defect influence coefficients of all connected domains in each image block; obtaining a steel pipe welding enhancement map based on a segmentation threshold by adopting a limited contrast histogram enhancement algorithm; and obtaining a corrosion state detection result of the welded part of the steel pipe based on the steel pipe welding enhancement graph by using an image segmentation algorithm. According to the method, the segmentation threshold value in the contrast ratio limiting histogram enhancement algorithm is obtained in a self-adaptive mode by analyzing corrosion characteristics in different image blocks of the welded part of the steel pipe, so that the detection precision of the corrosion state is improved.
Description
Technical Field
The invention relates to the technical field of image data processing, in particular to a welded pipe corrosion state detection method based on image processing.
Background
Among the developments in various industries, the development of manufacturing industry is a major part. The development of the steel pipe industry is an important part of manufacturing industry, in the steel pipe production process, due to the non-standardization of the production process and the welding environment, various defects such as undercut, weld flash, pit, corrosion, poor forming and the like are very easy to occur in the steel pipe welding process, and the quality of welding is related to the production quality and the safety of the steel pipe.
The lower detection precision of the defects of the steel pipes can lead the welded steel pipes with the defects to enter the subsequent processing and production process, and the damage degree of the steel pipes can be further increased due to the defects on the surfaces of the steel pipes in the subsequent use process. At present, defect detection of the welded part of the steel pipe is mainly finished in an image processing mode, and a machine vision detection means is added in steel pipe detection to realize automatic identification of the steel pipe defect. However, due to the complexity of the scene, the quality of the acquired steel pipe image is affected by illumination and other noise, so that the defect detection of the steel pipe is inaccurate, and the quality of the acquired steel pipe surface image needs to be enhanced, so that the defect detection accuracy of the steel pipe is improved. The image enhancement algorithms commonly used at present comprise a dark channel enhancement algorithm, a retina enhancement algorithm, gamma transformation and the like, wherein the dark channel enhancement algorithm needs to carry out parameter setting according to priori knowledge; gamma conversion can only achieve linear enhancement; the retina enhancement algorithm needs to perform convolution filtering on the image, and has the problem of image information loss.
Disclosure of Invention
The invention provides a welded pipe corrosion state detection method based on image processing, which aims to solve the problem that a corrosion defect detection error occurs at a welded part of a steel pipe due to a single threshold value of a limited contrast enhancement algorithm, and adopts the following technical scheme:
the invention relates to a welded pipe corrosion state detection method based on image processing, which comprises the following steps:
acquiring a steel tube surface gray scale map, and dividing the steel tube surface gray scale map into a preset number of image blocks;
acquiring a connected domain extraction result in each image block based on the image characteristics of the edge points in each image block by adopting a region growing algorithm; acquiring the corrosion boundary tortuosity of each connected domain according to the corrosion characteristics in eight adjacent areas of the upper boundary point of each connected domain;
acquiring corrosion defect influence coefficients of each connected domain according to the complexity of the image information in each corner adjacent domain in each connected domain and the corrosion boundary tortuosity of each connected domain;
obtaining a segmentation threshold value of each image block according to corrosion defect influence coefficients of all connected domains in each image block; obtaining a steel pipe welding enhancement map based on the segmentation threshold by adopting a limited contrast histogram enhancement algorithm; and obtaining a corrosion state detection result of the welded part of the steel pipe based on the steel pipe welding enhancement map by using an image segmentation algorithm.
Preferably, the method for acquiring the connected domain extraction result in each image block based on the image features of the edge points in each image block by adopting the region growing algorithm comprises the following steps:
respectively acquiring gradient amplitude values and gradient angles of each edge point in each image block, and taking the square of the absolute value of the difference value between the gradient amplitude values of any two edge points as a first measurement value; taking the square of the absolute value of the difference between the gradient angles of any two edge points as a second measurement value, taking the square root of the sum of the first measurement value and the second measurement value as a measurement distance between the two edge points, and taking the measurement distance smaller than a preset threshold value as a growth criterion;
and randomly selecting a preset number of edge points in each image block as seed points for region growth, and obtaining a connected domain extraction result in each image block by adopting a region growth algorithm based on the growth criterion.
Preferably, the method for obtaining the etching boundary tortuosity of each connected domain according to the etching characteristics in the eight adjacent areas of the boundary point on each connected domain comprises the following steps:
acquiring a boundary tortuosity difference coefficient of each boundary point on each connected domain according to corrosion characteristics in eight adjacent areas of the boundary point on each connected domain;
and taking the mean square error of the boundary tortuosity difference coefficients of all boundary points on each connected domain as the corrosion boundary tortuosity of each connected domain.
Preferably, the method for obtaining the boundary tortuosity difference coefficient of each boundary point on each connected domain according to the corrosion characteristics in eight adjacent areas of the boundary point on each connected domain comprises the following steps:
taking a sequence formed by LBP values of all the pixel points in the eight adjacent domains taken by each edge pixel point in each connected domain as a boundary characteristic sequence of each edge pixel point;
acquiring characteristic points in each connected domain by using a corner detection algorithm; taking a sequence formed by all edge pixel points in each connected domain according to a clockwise sequence as a boundary sequencing sequence of each connected domain;
taking the sum of the number of feature points in eight adjacent domains of each boundary point and the next boundary point in the boundary sorting sequence as a first composition factor;
taking the measurement distance between each boundary point in the boundary sorting sequence and the boundary feature sequence of the next adjacent boundary point as a second composition factor;
the boundary bending difference coefficient of each boundary point consists of a first composition factor and a second composition factor, wherein the boundary bending difference coefficient is in direct proportion to the first composition factor and the second composition factor.
Preferably, the method for obtaining the corrosion defect influence coefficient of each connected domain according to the complexity of the image information in each corner point adjacent domain in each connected domain and the corrosion boundary tortuosity of each connected domain comprises the following steps:
acquiring Euclidean distance between any two angular points in each communicating domain, and taking a sequence formed by all the Euclidean distances in each communicating domain as a corrosion surface distance sequence of each communicating domain;
taking the average value of the gray values of the pixel points in each angular point eight-neighborhood in each connected domain as the center complexity of the characteristic point of each angular point;
acquiring a corrosion significant coefficient of each connected domain according to the corrosion surface distance sequence of each connected domain and the complexity of the characteristic point center of each corner point;
the corrosion defect influence coefficient of each connected domain consists of corrosion boundary tortuosity and corrosion significant coefficient, wherein the corrosion defect influence coefficient is in direct proportion to the corrosion boundary tortuosity and the corrosion significant coefficient.
Preferably, the method for obtaining the corrosion significant coefficient of each connected domain according to the corrosion surface distance sequence of each connected domain and the complexity of the characteristic point center of each corner point comprises the following steps:
taking the product of the number of the corner points in each corner point eight adjacent areas in each connected area and the complexity of the center of each corner point characteristic point as a corrosion influence factor of each corner point; taking the average value of corrosion influence factors of all corner points in each connected domain as a first average value;
taking the average value of all elements in the corrosion surface distance sequence of each connected domain as a second average value;
the corrosion significant coefficient of each connected domain consists of a first average value and a second average value, wherein the corrosion significant coefficient is in a direct proportion relation with the first average value, and the corrosion significant coefficient is in an inverse proportion relation with the second average value.
Preferably, the method for obtaining the segmentation threshold of each image block according to the corrosion defect influence coefficients of all connected domains in each image block comprises the following steps:
acquiring the welding corrosion saliency of each image block according to the corrosion defect influence coefficients of all the connected domains in each image block, and taking the sum of the welding corrosion saliency of each image block and preset parameters as a denominator;
obtaining the maximum value of all peaks in the probability distribution curve of the gray level histogram corresponding to each image block as a molecule; the ratio of the numerator to the denominator is taken as the segmentation threshold for each image block.
Preferably, the method for obtaining the welding corrosion saliency of each image block according to the corrosion defect influence coefficients of all the connected domains in each image block comprises the following steps:
acquiring variation coefficients of an array formed according to corrosion defect influence coefficients of all connected domains in each image block;
taking the ratio of the corrosion defect influence coefficient of each connected domain in each image block to the maximum value of the corrosion defect influence coefficients of all connected domains in each image block as the normalized contribution degree of each connected domain;
and taking the ratio of the average value of the normalized contribution degrees of all the connected domains in each image block to the variation coefficient as the welding corrosion significance of each image block.
Preferably, the method for obtaining the steel pipe welding enhancement map based on the segmentation threshold by adopting the limiting contrast histogram enhancement algorithm comprises the following steps:
the segmentation threshold value of each image block on the steel pipe gray level map is respectively obtained, the steel pipe gray level map is used as input of a limiting contrast histogram enhancement algorithm, and the enhancement result of the steel pipe gray level map obtained by adopting the limiting contrast histogram enhancement algorithm is used as a steel pipe welding enhancement map.
Preferably, the method for obtaining the corrosion state detection result of the welded part of the steel pipe based on the steel pipe welding enhancement map by using an image segmentation algorithm comprises the following steps:
dividing the steel pipe welding enhancement map into a preset number of super pixel blocks by adopting a super pixel segmentation algorithm, and respectively obtaining a gradient histogram corresponding to each super pixel block by utilizing an HOG operator;
obtaining a measurement distance between gradient histograms of any two super pixel blocks; and obtaining the corrosion defect area on the steel pipe gray scale graph according to the comparison result of the histogram measurement distance and the preset threshold value.
The beneficial effects of the invention are as follows: according to the method, corrosion defect influence coefficients are constructed according to boundary characteristics of the connected domains and local image information by analyzing the corrosion defect conditions in different connected domains in each image block. The corrosion defect influence coefficient considers the influence degree of the corrosion defect in the connected domain, and solves the problem that the enhancement effect of the steel pipe surface gray scale image is poor due to single cutting threshold value in each block in the traditional contrast limiting algorithm; the corrosion defect influence coefficient can represent the influence coefficient of the corrosion defect in each image block on the enhancement effect, so that the enhancement effect on the gray level map of the steel pipe surface is improved according to the size of the cutting threshold value of the defect characteristic self-adaption adjustment in the image block, and the detection precision of the corrosion defect at the welded part of the steel pipe is improved.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions of the prior art, the drawings which are used in the description of the embodiments or the prior art will be briefly described, it being obvious that the drawings in the description below are only some embodiments of the invention, and that other drawings can be obtained according to these drawings without inventive faculty for a person skilled in the art.
FIG. 1 is a schematic flow chart of a method for detecting corrosion state of welded pipe based on image processing according to an embodiment of the present invention;
FIG. 2 is a schematic view of the boundary of an etched area according to one embodiment of the present invention;
FIG. 3 is a flowchart of a method for detecting a corrosion state of a welded pipe based on image processing according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Referring to fig. 1, a flowchart of a method for detecting a corrosion state of a welded pipe based on image processing according to an embodiment of the invention is shown, the method includes the following steps:
and S001, acquiring a steel tube surface gray scale map based on the image acquisition device.
The invention aims to realize detection of the welding corrosion state of the steel pipe, so that when the welded steel pipe is in a stable state, a CCD industrial camera is used for shooting the surface image of the produced steel pipe, the obtained surface image is an RGB image, and the shooting environment is complex, so that the shot image is poor in quality and has more noise, and the image needs to be preprocessed. The corrosion information of the surface of the steel pipe needs to be analyzed, and the edge information in the image of the surface of the steel pipe needs to be reserved. In the invention, firstly, the steel pipe surface image is subjected to noise reduction treatment in a median filtering mode, secondly, the denoised steel pipe surface image is converted into a gray scale image, the obtained gray scale image is recorded as the steel pipe surface gray scale image, the median filtering and the gray scale are known techniques, and the specific process is not repeated.
And obtaining a steel pipe gray scale image of the welded part of the steel pipe, and obtaining a detection result of the corrosion state of the welded part of the steel pipe subsequently.
Step S002, obtaining the connected domain extraction result in each image block by adopting a region growing algorithm, and obtaining the corrosion boundary tortuosity according to the corrosion characteristics in the eight adjacent regions of the boundary point on each connected domain.
In the production process of the steel pipe, because of the influence of the production process and the environment in the later transportation process, more defects appear on the surface of the steel pipe, mainly marked by scratches, corrosion and the like, and because textures, corrosion defects, welding marks, defects and the like on the surface of the steel pipe appear at the welded part of the steel pipe, the accuracy of directly detecting the corrosion state of the gray level map on the surface of the steel pipe is not high, so the invention considers the enhancement treatment of the gray level map on the surface of the steel pipe, and realizes the detection of the corrosion state through the enhanced image.
Because the steel pipe is made of metal materials and the surface is provided with a protective layer, the existence of scratches can lead to a longer gully, and the edges of the gully are more regular; the corrosion is caused by the lack of a protective layer on the surface of the steel pipe, so that the metal surface is rusted, the surface of the corrosion area is rugged, and the irregularity degree of the edge shape is high.
Firstly, an edge detection result of a gray scale image of the surface of the steel pipe is obtained by using a Canny edge detection technology, wherein Canny edge detection is a known technology, and a specific process is not repeated. Secondly, the surface ash of the steel pipeThe image blocks are divided into blocks, and in the method, the number of the image blocks is performed according to the resolution of the gray level map of the surface of the steel pipe, for example, if the resolution of the gray level map of the surface of the steel pipe is 512×512, the gray level map of the surface of the steel pipe is divided into 32×32 image blocks, and the practitioner can set according to the actual resolution of the gray level map of the surface of the steel pipe when determining the number of the image blocks. Acquiring the gradient amplitude and gradient direction of each edge point in the edge detection result by utilizing a Sobel operator, and respectively marking the gradient amplitude and the angle value of the gradient direction of the pixel point i as、/>The use of Sobel operator is a well-known technique, and the specific process is not described in detail.
Further, n edge points are randomly selected as initial seed points for region growth, the criterion of the region growth is that the measurement distance between two adjacent pixel points is smaller than a threshold value y, the sizes of n and y are respectively 20 and 10, a region growth algorithm is adopted to obtain a connected domain extraction result of a gray map of the surface of the steel tube, and the region growth is a known technology, and the specific process is not repeated. The calculation formula of the measurement distance between the two adjacent pixel points is as follows:
in the method, in the process of the invention,is the measurement distance between the pixel points i and j in the region growing process, j is the j-th adjacent pixel point of the pixel point i,/and a>、/>Gradient magnitude of pixel i, j, < >>、/>The angle values of the gradient directions of the pixel points i and j are respectively.
Wherein, the larger the difference of the image information of the pixel points i and j in the gray level diagram of the steel pipe surface is, the first metric valueThe greater the value of (2); second measurement value->The greater the value of (2); i.e. measure distance->The larger the value of (c), the lower the likelihood that the growth criterion is fulfilled between the pixel points i, j.
Since corrosion caused by rust occurs on the surface of the steel pipe and the surface of the corroded area is in an uneven state, the boundary of the corrosion defect is in an irregular form, and the shape of the boundary in the image block is disordered by taking the image block containing the corrosion defect as an example, as shown in fig. 2. According to the boundary characteristics of the corrosion defect, the irregularity of the boundary of each connected domain in each image block can be calculated, the edge detection result in each image block is processed by utilizing a Harris corner detection algorithm, the corner in each image block is obtained, and each corner in each connected domain is used as a characteristic point. With the a-th connected domain in the first image blockFor example, the connected domain->The sequence of all the edge pixels in the inner part in clockwise order is used as a communicating domain +.>Boundary ordering sequence>Calculating connected domain->LBP value for each pixel in the boundary ordered sequence +.>Any edge pixel point in the image is used as a boundary feature sequence of each edge pixel point, for example, a boundary feature sequence of an edge pixel point p, wherein the sequence consists of LBP values of eight neighborhood pixel points of each edge pixel pointWherein->Is the LBP value of the nth pixel point within the eight neighbors of the edge pixel point p.
Based on the analysis, a boundary tortuosity difference coefficient V is constructed here and used for representing the tortuosity degree of the boundary of the connected domain in the neighborhood range of each edge pixel point and calculating the boundary tortuosity difference coefficient of the edge pixel point p:
In the method, in the process of the invention,is the border ordering sequence +.>Boundary meandering difference coefficient of inner edge pixel point p, p+1 is boundary sorting sequence +.>Next adjacent pixel point of the inner edge pixel point p +.>Is the sum of the number of corner points in the eight neighborhoods of the edge pixel point p, p+1, +.>、/>The boundary feature sequences of the edge pixel points p and p+1 respectively,is the sequence->、/>The DTW distance between the two is a known technology, and the specific process is not repeated
Wherein, the connected domainThe more serious the corrosion state is in the eight neighborhood of the edge pixel points p and p+1, the more the connected domain is->The higher the irregularity degree of the boundary line in the eight neighbours of the edge pixel points p, p+1, the greater the number of corner points in the eight neighbours of the edge pixel points p, p+1, the first composition factor +>The greater the value of (2); the boundary of the connected domain in the eight adjacent domains where the edge pixel points p and p+1 are positioned is affected differently by corrosion defects, and the boundary characteristic sequence is +.>、/>The greater the difference between the second composition factorThe greater the value of (2); i.e. < ->The larger the value of (a), the edge pixel point p is corrodedThe more severe the effect of the etch defect.
According to the above steps, boundary sorting sequences are calculated respectivelyBoundary zigzag difference coefficient of each edge pixel point in the frame, boundary ordering sequence with length of n +.>N-1 boundary meandering difference coefficients can be obtained, and the connected domain is acquired based on the n-1 boundary meandering difference coefficients>Corrosion boundary tortuosity->:
In the method, in the process of the invention,is a communicating domain->Corrosion boundary tortuosity of->、/>Respectively boundary sorting sequence->Boundary meandering difference coefficient of inner edge pixel points p+1, p, n is boundary sorting sequence +.>The number of inner edge pixels.
Wherein, the connected domainThe greater the possibility of the presence of corrosion defect boundaries in the interior, the +.>The lower the internal flatness is, the more connected domain is->The more the inner bulge is, the higher the degree of boundary irregularity is, the more the edge line is bent, the larger the difference of boundary bending difference coefficients of the edge pixel points is, and the +.>The greater the value of (2).
And obtaining the corrosion boundary tortuosity of each connected domain in each image block for obtaining the segmentation threshold value of each image block subsequently.
And S003, acquiring corrosion defect influence coefficients based on corrosion boundary tortuosity of the connected domains, and acquiring a segmentation threshold according to the corrosion defect influence coefficients of all the connected domains in each image block.
According to the difference between the corrosion area on the surface of the steel pipe and the flat surface, if corrosion defects appear in the area, angular points appear more intensively. If more bulges appear on the corroded surface, the aggregation degree of the bulges can be calculated according to the angular points, and the denser the bulges are, the larger the analysis influence of the corroded area on the contrast in the image block is. For any one connected domain, the connected domainFor example, calculate connected domain +.>The Euclidean distance between any two angular points in the interior is used for allowing the connected domain +.>The sequence consisting of all of said Euclidean distances is used as a corrosion surface distance sequence +.>Secondly by communicating domains->Each corner point in the array is taken as a central pixel point, a neighborhood window with the size of 3*3 is constructed, the average value of gray values in the neighborhood window taken by each corner point is taken as the central complexity of the characteristic point of each corner point, and the central complexity of the characteristic point of the b-th corner point is recorded as->Calculating corrosion defect influence coefficient of the connected domain according to aggregation degree of corner points in the connected domain, and calculating +.>Corrosion defect influence coefficient->:
In the method, in the process of the invention,is a communicating domain->Corrosion coefficient of>Is a communicating domain->The number of corner points within the interior,feature point center complexity, which is the b-th corner point,/->Is the number of corner points in the eighth corner point neighborhood;m is the corrosion surface distance sequence +.>The number of elements in->Is the corrosion surface distance sequence->The k-th element value of (a);
is a communicating domain->Is a corrosion defect influence coefficient of->Is a communicating domain->Corrosion boundary tortuosity of (c).
Wherein, the connected domainThe greater the possibility of the presence of corrosion defects, the +.>The greater the number of inner corners, the corrosion influencing factor +.>The larger the value of (2), the first mean +.>The greater the value of (2); connected domain->The larger the number of inner corner points, the smaller the Euclidean distance between the corner points, the second mean +.>The smaller the value of (2) the corrosion significant coefficient +.>The greater the value of (2); connected domain->The more serious the inner corrosion state is, the higher the boundary irregularity degree is, the larger the difference of boundary bending difference coefficients of angular points is, and the +.>The greater the value of (2), the corresponding, +.>The greater the value of (2).
According to the steps, corrosion defect influence coefficients of each connected domain in each image block are respectively obtained, and the self-adaptive obtaining of the threshold value limiting the contrast in the region is carried out according to the corrosion defect influence coefficients of the whole region. Firstly, counting the distribution range of pixel point gray values in each image block and the occurrence frequency of each gray level to construct a gray level histogram of each image block, taking the gray level in the gray level histogram of each image block as an abscissa, and obtaining a fitting curve based on the gray level histogram of each image block by utilizing a least square fitting algorithm. Calculating a segmentation threshold for an h-th image block:
In the method, in the process of the invention,is the weld corrosion significance of the h image block,/>The variation coefficients of the array are formed by the corrosion defect influence coefficients of all the connected domains in the h image block; />Is the average value of the normalized contribution degrees of all connected domains in the h image block, and the obtaining process of the normalized contribution degrees is as follows: taking the ratio of the corrosion defect influence coefficient of each connected domain in the h image block to the maximum value of the corrosion defect influence coefficients of all connected domains in the h image block as the normalized contribution degree of each connected domain in the h image block;
is the segmentation threshold of the h-th image block, is->Is the maximum value of all peaks on the fitted curve obtained by the gray level histogram of the image block,/is>Is a parameter regulating factor, and is a herb of Jatropha curcas>The function of (2) is to prevent the denominator from being 0, < >>The size of (2) is 0.001.
Wherein, the more corrosion defects exist in the h image block, the more the corrosion defect influence coefficients of all connected domains in the h image block are close, the coefficient of variation isThe smaller the value of (2), the more significant the weld corrosion in the h image block +.>The larger the value of (c) is, correspondingly, the segmentation threshold of the h-th image block +.>The smaller the value of (2), the more the detail information within the h-th image block is highlighted; whereas the contrast of the defective area with the normal area should be enhanced.
So far, the segmentation threshold value of each image block is obtained and used for the subsequent enhancement treatment of the steel pipe gray level map.
And S004, obtaining a steel pipe welding enhancement map by adopting a limited contrast histogram enhancement algorithm, and obtaining a corrosion state detection result of the welded part of the steel pipe based on the steel pipe welding enhancement map by utilizing an image segmentation algorithm.
According to the above steps, the segmentation threshold value of each image block on the steel tube surface gray level map is obtained respectively, the steel tube surface gray level map is input as an algorithm, a reinforced image of the steel tube surface gray level map is obtained based on the segmentation threshold value of each image block on the steel tube surface gray level map by adopting a limiting contrast histogram reinforcing algorithm, the reinforced image is recorded as a steel tube welding reinforced map, and the implementation flow for realizing corrosion state detection based on the steel tube welding reinforced map is shown in fig. 3.
Further, the steel pipe welding enhancement graph is segmented into M super-pixel blocks by utilizing a simple iterative linear segmentation SLIC super-pixel segmentation algorithm, wherein the size of M is checked to be 200, the SLIC super-pixel segmentation algorithm is a known technology, the specific process is not repeated, then gradient histograms corresponding to each super-pixel block are respectively obtained by utilizing an HOG operator, and the gradient histogram of the 1 st super-pixel block is marked as. Two main types of super-pixel blocks with corrosion areas and normally welded super-pixel blocks exist in the steel pipe welding enhancement chart, so that the Babbitt distance between gradient histograms of any two super-pixel blocks is calculated respectively, for any one super-pixel block, the average value of the Babbitt distances between the gradient histograms of each super-pixel block and the remaining M-1 super-pixel blocks is used as the corrosion evaluation value of each super-pixel block, the threshold value of the corrosion evaluation values of the M super-pixel blocks is obtained by using the Ojin threshold algorithm>Will corrodeThe evaluation value is greater than the threshold +.>The super pixel block of (2) is used as a corrosion area in a steel pipe welding enhancement chart. The reason for this detection is that if the 1 st super pixel block is a normal welding area,/there is>The Babbitt distances among the gradient histograms of the super pixel blocks corresponding to all the normal welding areas are almost consistent, the Babbitt distance value fluctuation among the gradient histograms of the super pixel blocks corresponding to the corrosion areas is larger, and the average value of M-1 Babbitt distances corresponding to the 1 st super pixel block is smaller; if there is a corrosion region in the 1 st super pixel block +.>The difference of the value ranges of the Pasteur distances between the gradient histograms of the super pixel blocks corresponding to all the normal welding areas is large, the average value of M-1 Pasteur distances corresponding to the 1 st super pixel block is large, wherein the Pasteur distance and the Sedrin threshold algorithm are known techniques, and the specific process is not repeated.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. The foregoing description of the preferred embodiments of the present invention is not intended to be limiting, but rather, any modifications, equivalents, improvements, etc. that fall within the principles of the present invention are intended to be included within the scope of the present invention.
Claims (9)
1. The welded pipe corrosion state detection method based on image processing is characterized by comprising the following steps of:
acquiring a steel tube surface gray scale map, and dividing the steel tube surface gray scale map into a preset number of image blocks;
acquiring a connected domain extraction result in each image block based on the image characteristics of the edge points in each image block by adopting a region growing algorithm; acquiring the corrosion boundary tortuosity of each connected domain according to the corrosion characteristics in eight adjacent areas of the upper boundary point of each connected domain;
acquiring corrosion defect influence coefficients of each connected domain according to the complexity of the image information in each corner adjacent domain in each connected domain and the corrosion boundary tortuosity of each connected domain;
obtaining a segmentation threshold value of each image block according to corrosion defect influence coefficients of all connected domains in each image block; obtaining a steel pipe welding enhancement map based on the segmentation threshold by adopting a limited contrast histogram enhancement algorithm; obtaining a corrosion state detection result of the welded part of the steel pipe based on the steel pipe welding enhancement map by using an image segmentation algorithm;
the method for acquiring the corrosion defect influence coefficient of each connected domain according to the complexity of the image information in each corner adjacent domain in each connected domain and the corrosion boundary tortuosity of each connected domain comprises the following steps:
acquiring Euclidean distance between any two angular points in each communicating domain, and taking a sequence formed by all the Euclidean distances in each communicating domain as a corrosion surface distance sequence of each communicating domain;
taking the average value of the gray values of the pixel points in each angular point eight-neighborhood in each connected domain as the center complexity of the characteristic point of each angular point;
acquiring a corrosion significant coefficient of each connected domain according to the corrosion surface distance sequence of each connected domain and the complexity of the characteristic point center of each corner point;
the corrosion defect influence coefficient of each connected domain consists of corrosion boundary tortuosity and corrosion significant coefficient, wherein the corrosion defect influence coefficient is in direct proportion to the corrosion boundary tortuosity and the corrosion significant coefficient.
2. The method for detecting the corrosion state of the welded pipe based on the image processing according to claim 1, wherein the method for acquiring the connected domain extraction result in each image block based on the image characteristics of the edge point in each image block by adopting the region growing algorithm is as follows:
respectively acquiring gradient amplitude values and gradient angles of each edge point in each image block, and taking the square of the absolute value of the difference value between the gradient amplitude values of any two edge points as a first measurement value; taking the square of the absolute value of the difference between the gradient angles of any two edge points as a second measurement value, taking the square root of the sum of the first measurement value and the second measurement value as a measurement distance between the two edge points, and taking the measurement distance smaller than a preset threshold value as a growth criterion;
and randomly selecting a preset number of edge points in each image block as seed points for region growth, and obtaining a connected domain extraction result in each image block by adopting a region growth algorithm based on the growth criterion.
3. The method for detecting the corrosion state of the welded pipe based on the image processing according to claim 1, wherein the method for acquiring the corrosion boundary tortuosity of each connected domain according to the corrosion characteristics in the eight adjacent areas of the boundary point on each connected domain is as follows:
acquiring a boundary tortuosity difference coefficient of each boundary point on each connected domain according to corrosion characteristics in eight adjacent areas of the boundary point on each connected domain;
and taking the mean square error of the boundary tortuosity difference coefficients of all boundary points on each connected domain as the corrosion boundary tortuosity of each connected domain.
4. The method for detecting the corrosion state of a welded pipe based on image processing according to claim 3, wherein the method for obtaining the boundary meandering difference coefficient of each boundary point on each connected domain according to the corrosion characteristics in the eight adjacent regions of the boundary point on each connected domain is as follows:
taking a sequence formed by LBP values of all the pixel points in the eight adjacent domains taken by each edge pixel point in each connected domain as a boundary characteristic sequence of each edge pixel point;
acquiring characteristic points in each connected domain by using a corner detection algorithm; taking a sequence formed by all edge pixel points in each connected domain according to a clockwise sequence as a boundary sequencing sequence of each connected domain;
taking the sum of the number of feature points in eight adjacent domains of each boundary point and the next boundary point in the boundary sorting sequence as a first composition factor;
taking the measurement distance between each boundary point in the boundary sorting sequence and the boundary feature sequence of the next adjacent boundary point as a second composition factor;
the boundary bending difference coefficient of each boundary point consists of a first composition factor and a second composition factor, wherein the boundary bending difference coefficient is in direct proportion to the first composition factor and the second composition factor.
5. The method for detecting the corrosion state of the welded pipe based on the image processing according to claim 1, wherein the method for obtaining the corrosion significant coefficient of each connected domain according to the corrosion surface distance sequence of each connected domain and the characteristic point center complexity of each corner point is as follows:
taking the product of the number of the corner points in each corner point eight adjacent areas in each connected area and the complexity of the center of each corner point characteristic point as a corrosion influence factor of each corner point; taking the average value of corrosion influence factors of all corner points in each connected domain as a first average value;
taking the average value of all elements in the corrosion surface distance sequence of each connected domain as a second average value;
the corrosion significant coefficient of each connected domain consists of a first average value and a second average value, wherein the corrosion significant coefficient is in a direct proportion relation with the first average value, and the corrosion significant coefficient is in an inverse proportion relation with the second average value.
6. The method for detecting the corrosion state of the welded pipe based on the image processing according to claim 1, wherein the method for obtaining the segmentation threshold value of each image block according to the corrosion defect influence coefficients of all the connected domains in each image block is as follows:
acquiring the welding corrosion saliency of each image block according to the corrosion defect influence coefficients of all the connected domains in each image block, and taking the sum of the welding corrosion saliency of each image block and preset parameters as a denominator;
obtaining the maximum value of all peaks in the probability distribution curve of the gray level histogram corresponding to each image block as a molecule; the ratio of the numerator to the denominator is taken as the segmentation threshold for each image block.
7. The method for detecting the corrosion state of the welded pipe based on the image processing according to claim 6, wherein the method for obtaining the welding corrosion saliency of each image block according to the corrosion defect influence coefficients of all the connected domains in each image block is as follows:
acquiring variation coefficients of an array formed according to corrosion defect influence coefficients of all connected domains in each image block;
taking the ratio of the corrosion defect influence coefficient of each connected domain in each image block to the maximum value of the corrosion defect influence coefficients of all connected domains in each image block as the normalized contribution degree of each connected domain;
and taking the ratio of the average value of the normalized contribution degrees of all the connected domains in each image block to the variation coefficient as the welding corrosion significance of each image block.
8. The method for detecting the corrosion state of the welded pipe based on the image processing according to claim 1, wherein the method for obtaining the welding enhancement map of the steel pipe based on the segmentation threshold by adopting a limiting contrast histogram enhancement algorithm is as follows:
the segmentation threshold value of each image block on the steel pipe gray level map is respectively obtained, the steel pipe gray level map is used as input of a limiting contrast histogram enhancement algorithm, and the enhancement result of the steel pipe gray level map obtained by adopting the limiting contrast histogram enhancement algorithm is used as a steel pipe welding enhancement map.
9. The welded pipe corrosion state detection method based on image processing according to claim 1, wherein the method for obtaining the welded pipe corrosion state detection result based on the steel pipe welding enhancement map by using an image segmentation algorithm is as follows:
dividing the steel pipe welding enhancement map into a preset number of super pixel blocks by adopting a super pixel segmentation algorithm, and respectively obtaining a gradient histogram corresponding to each super pixel block by utilizing an HOG operator;
obtaining a measurement distance between gradient histograms of any two super pixel blocks; and obtaining the corrosion defect area on the steel pipe gray scale graph according to the comparison result of the histogram measurement distance and the preset threshold value.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311413614.8A CN117152137B (en) | 2023-10-30 | 2023-10-30 | Welded pipe corrosion state detection method based on image processing |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311413614.8A CN117152137B (en) | 2023-10-30 | 2023-10-30 | Welded pipe corrosion state detection method based on image processing |
Publications (2)
Publication Number | Publication Date |
---|---|
CN117152137A true CN117152137A (en) | 2023-12-01 |
CN117152137B CN117152137B (en) | 2024-01-26 |
Family
ID=88904662
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311413614.8A Active CN117152137B (en) | 2023-10-30 | 2023-10-30 | Welded pipe corrosion state detection method based on image processing |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117152137B (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117541605A (en) * | 2024-01-09 | 2024-02-09 | 山东华中重钢有限公司 | Rapid segmentation method for rusted image area of steel structure |
CN117689637A (en) * | 2023-12-14 | 2024-03-12 | 广东昭明电子集团股份有限公司 | Visual detection method for processing quality of new energy battery hardware |
CN117764992A (en) * | 2024-02-22 | 2024-03-26 | 山东乔泰管业科技有限公司 | Plastic pipe quality detection method based on image processing |
CN117893541A (en) * | 2024-03-18 | 2024-04-16 | 济南玖通志恒信息技术有限公司 | Fruit tree leaf mosaic analysis method based on edge detection |
CN117893532A (en) * | 2024-03-14 | 2024-04-16 | 山东神力索具有限公司 | Die crack defect detection method for die forging rigging based on image processing |
CN118115499A (en) * | 2024-04-29 | 2024-05-31 | 深圳市金利源绝缘材料有限公司 | Visual detection method for production quality of electric power copper bar |
CN118172296A (en) * | 2024-05-16 | 2024-06-11 | 大连希尔德安全技术有限公司 | Fire source accurate positioning method based on image processing |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110378950A (en) * | 2019-06-18 | 2019-10-25 | 上海同岩土木工程科技股份有限公司 | A kind of tunnel structure crack identification method merged based on gray scale and gradient |
CN115330783A (en) * | 2022-10-13 | 2022-11-11 | 启东谷诚不锈钢制品有限公司 | Steel wire rope defect detection method |
WO2023134792A2 (en) * | 2022-12-15 | 2023-07-20 | 苏州迈创信息技术有限公司 | Led lamp wick defect detection method |
-
2023
- 2023-10-30 CN CN202311413614.8A patent/CN117152137B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110378950A (en) * | 2019-06-18 | 2019-10-25 | 上海同岩土木工程科技股份有限公司 | A kind of tunnel structure crack identification method merged based on gray scale and gradient |
CN115330783A (en) * | 2022-10-13 | 2022-11-11 | 启东谷诚不锈钢制品有限公司 | Steel wire rope defect detection method |
WO2023134792A2 (en) * | 2022-12-15 | 2023-07-20 | 苏州迈创信息技术有限公司 | Led lamp wick defect detection method |
Cited By (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117689637A (en) * | 2023-12-14 | 2024-03-12 | 广东昭明电子集团股份有限公司 | Visual detection method for processing quality of new energy battery hardware |
CN117689637B (en) * | 2023-12-14 | 2024-06-07 | 广东昭明电子集团股份有限公司 | Visual detection method for processing quality of new energy battery hardware |
CN117541605A (en) * | 2024-01-09 | 2024-02-09 | 山东华中重钢有限公司 | Rapid segmentation method for rusted image area of steel structure |
CN117541605B (en) * | 2024-01-09 | 2024-03-29 | 山东华中重钢有限公司 | Rapid segmentation method for rusted image area of steel structure |
CN117764992A (en) * | 2024-02-22 | 2024-03-26 | 山东乔泰管业科技有限公司 | Plastic pipe quality detection method based on image processing |
CN117764992B (en) * | 2024-02-22 | 2024-04-30 | 山东乔泰管业科技有限公司 | Plastic pipe quality detection method based on image processing |
CN117893532A (en) * | 2024-03-14 | 2024-04-16 | 山东神力索具有限公司 | Die crack defect detection method for die forging rigging based on image processing |
CN117893532B (en) * | 2024-03-14 | 2024-05-24 | 山东神力索具有限公司 | Die crack defect detection method for die forging rigging based on image processing |
CN117893541A (en) * | 2024-03-18 | 2024-04-16 | 济南玖通志恒信息技术有限公司 | Fruit tree leaf mosaic analysis method based on edge detection |
CN117893541B (en) * | 2024-03-18 | 2024-05-28 | 济南玖通志恒信息技术有限公司 | Fruit tree leaf mosaic analysis method based on edge detection |
CN118115499A (en) * | 2024-04-29 | 2024-05-31 | 深圳市金利源绝缘材料有限公司 | Visual detection method for production quality of electric power copper bar |
CN118172296A (en) * | 2024-05-16 | 2024-06-11 | 大连希尔德安全技术有限公司 | Fire source accurate positioning method based on image processing |
Also Published As
Publication number | Publication date |
---|---|
CN117152137B (en) | 2024-01-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN117152137B (en) | Welded pipe corrosion state detection method based on image processing | |
CN112419250B (en) | Pavement crack digital image extraction, crack repair and crack parameter calculation method | |
CN107507208B (en) | Image feature point extraction method based on curvature estimation on contour | |
CN116740070B (en) | Plastic pipeline appearance defect detection method based on machine vision | |
CN116310360A (en) | Reactor surface defect detection method | |
CN111814867A (en) | Defect detection model training method, defect detection method and related device | |
CN116664559B (en) | Machine vision-based memory bank damage rapid detection method | |
CN115063423B (en) | Self-adaptive identification method for cold and hot cracks of mechanical castings based on computer vision | |
CN115082462A (en) | Method and system for detecting appearance quality of fluid conveying pipe | |
CN116993731B (en) | Shield tunneling machine tool bit defect detection method based on image | |
CN115100203A (en) | Steel bar polishing and rust removing quality detection method | |
CN115096206B (en) | High-precision part size measurement method based on machine vision | |
CN113963042A (en) | Metal part defect degree evaluation method based on image processing | |
CN116993742B (en) | Nickel alloy rolling defect detection method based on machine vision | |
CN116612112B (en) | Visual inspection method for surface defects of bucket | |
CN117974637B (en) | Intelligent detection method and system for guide wheel crack defects based on image features | |
CN107657620B (en) | Method and system for identifying metal solidification region with texture | |
CN111353981B (en) | Gear detection method and system based on machine vision and storage medium | |
CN116703251A (en) | Rubber ring production quality detection method based on artificial intelligence | |
CN116503462A (en) | Method and system for quickly extracting circle center of circular spot | |
CN117372422B (en) | Material bending degree detection method for part production | |
CN116485884B (en) | Real-time positioning method and system for finish brewing beer bottle mouth based on computer vision | |
CN116993740A (en) | Concrete structure surface defect detection method based on image data | |
CN111192261A (en) | Method for identifying lens defect types | |
CN118229673B (en) | Pipeline inner wall defect detection method and system based on image recognition |
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 |