CN111882518A - Magnetic leakage data self-adaptive pseudo-colorization method - Google Patents

Magnetic leakage data self-adaptive pseudo-colorization method Download PDF

Info

Publication number
CN111882518A
CN111882518A CN202010517387.3A CN202010517387A CN111882518A CN 111882518 A CN111882518 A CN 111882518A CN 202010517387 A CN202010517387 A CN 202010517387A CN 111882518 A CN111882518 A CN 111882518A
Authority
CN
China
Prior art keywords
value
gray
image
data
magnetic
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010517387.3A
Other languages
Chinese (zh)
Other versions
CN111882518B (en
Inventor
王建丰
唐建华
林晓
赵可天
王增国
薛申才
王丹丹
王怀江
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
CNOOC Energy Development of Equipment and Technology Co Ltd
CNOOC China Ltd
CNOOC Inspection Technology Co Ltd
Original Assignee
CNOOC Energy Development of Equipment and Technology Co Ltd
CNOOC China Ltd
CNOOC Inspection Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by CNOOC Energy Development of Equipment and Technology Co Ltd, CNOOC China Ltd, CNOOC Inspection Technology Co Ltd filed Critical CNOOC Energy Development of Equipment and Technology Co Ltd
Priority to CN202010517387.3A priority Critical patent/CN111882518B/en
Publication of CN111882518A publication Critical patent/CN111882518A/en
Application granted granted Critical
Publication of CN111882518B publication Critical patent/CN111882518B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Quality & Reliability (AREA)
  • Investigating Or Analyzing Materials By The Use Of Magnetic Means (AREA)

Abstract

The invention discloses a magnetic leakage data self-adaptive pseudo-colorization method, which is used for carrying out base value correction and denoising pretreatment on magnetic leakage data; classifying and graying the preprocessed magnetic flux leakage data to generate a grayscale image; the generated gray level image is divided by two methods, the generated gray level image is divided into two parts according to a gray level threshold value, and the two parts of the image are divided into two parts respectively by adopting an Otsu algorithm to obtain end point values of a gray level interval of a background area; then, the gray level image is segmented according to the class label, and C is obtained2To CkThe maximum value of the gray scale corresponding to the category isA gray scale interval boundary value; merging background area gray scale interval end point value, gray scale interval boundary value and C1Obtaining the extreme value of the gray value of the pixel point corresponding to the category to obtain the value of each end point of the gray interval; and adjusting the pseudo-color codes according to the end point values of the gray scale interval and performing pseudo-colorization treatment on the gray scale image. The false color image has clear defect characteristics, clear boundary and high boundary identification degree.

Description

Magnetic leakage data self-adaptive pseudo-colorization method
Technical Field
The invention relates to the field of pipeline nondestructive testing and data visualization, in particular to a magnetic flux leakage data self-adaptive pseudo-colorization method.
Background
At present, deep sea oil and gas pipelines work in severe submarine environments all year round, are easily influenced by complex environments such as high submarine pressure, high corrosion and the like, once leakage occurs, great ecological pollution and energy waste are caused, and therefore nondestructive detection on the pipelines is particularly necessary.
The magnetic flux leakage detection technology is one of the commonly used technologies for detecting the defects of the pipeline. With the improvement of hardware technology and sensor manufacturing process, remote pipeline detection is realized, the quantity and sensitivity of the arranged sensors are greatly improved, and fine defects or other pipeline state information can be detected more accurately. In order to facilitate visual observation and analysis of pipeline detection data, defect detection, size inversion and the like, a reasonable method is adopted to perform visual processing on magnetic flux leakage data. Common magnetic flux leakage data visualization methods include a curve view, a gray scale view, a pseudo-color view and the like.
In the field of false color image processing of magnetic flux leakage data, the traditional data false color processing method adopting gray value segmentation has single division on gray value boundaries, the processing effect on defect boundary areas is poor mostly, only axial data is considered generally, and the method is not suitable for false colorization under the current triaxial magnetic flux leakage data. The common magnetic flux leakage data pseudo-color view display causes the characteristic loss caused by gray scale linear stretching, so that the small defect region characteristics cannot be normally displayed, the boundary is fuzzy, the pipeline state information cannot be completely represented, and the visual observation, the subsequent pipeline defect detection and the like are not easy to realize.
Disclosure of Invention
Aiming at the problems that the two side regions of the defect presented in the magnetic flux leakage data gray level image pseudo-colorization process by the traditional rainbow coding method are similar to the image background color, and particularly the boundary resolution of a small defect region is not high, the invention provides a magnetic flux leakage data self-adaptive pseudo-colorization method which has higher degree of distinguishing the regions such as the pipeline defect and the welding seam and the boundary color thereof for solving the technical problems in the prior art.
The technical scheme adopted by the invention for solving the technical problems in the prior art is as follows: a magnetic leakage data self-adaptive pseudo colorization method is used for carrying out base value correction and denoising pretreatment on magnetic leakage data; classifying the preprocessed magnetic flux leakage data, setting the classification category number as k, and correspondingly setting the category label as CiI is 1, 2 … k, wherein C1The magnetic leakage data of the types are all located in a defect-free region, and the magnetic leakage data of other types are partially or completely located in the defect region; carrying out graying processing on the preprocessed magnetic flux leakage data to generate a grayscale image; the generated gray level image is divided by two methods respectively, wherein the first division method comprises the following steps: setting a gray threshold, dividing the generated gray image into two parts according to the gray threshold, and respectively carrying out binarization division on the two parts of images by adopting an Otsu algorithm to obtain end point values of a gray interval of a background area; second oneThe segmentation method comprises the following steps: dividing the gray level image according to the magnetic leakage data category label to obtain C2To CkTaking the maximum gray value corresponding to the category magnetic flux leakage data as a gray interval boundary value; merging background area gray scale interval end point value, gray scale interval boundary value and C1Obtaining each end point value of the divided gray scale interval by the category corresponding to the gray value extreme value of the pixel point; and adjusting the pseudo-color codes according to the end point values of the gray scale interval and performing pseudo-colorization treatment on the gray scale image.
Further, the method for performing the base value correction and denoising pretreatment on the leakage magnetic data of each sampling point comprises the following steps:
a-1, performing base value calibration on magnetic flux leakage data of each sampling point by adopting an average median method;
and step A-2, denoising the magnetic flux leakage data after the base value calibration by adopting a wavelet threshold denoising method.
Further, the method for classifying the preprocessed magnetic flux leakage data comprises the following steps:
step B-1, setting classification category number k;
b-2, classifying the axial, radial and circumferential magnetic flux leakage detection data of a pipe section according to the methods in the steps B-2-1 and B-2-2 to obtain the classes of the axial, radial and circumferential magnetic flux leakage data corresponding to the sampling points; wherein:
b-2-1, classifying the magnetic flux leakage data of the sampling points corresponding to any channel according to the following method to obtain the category of the magnetic flux leakage data of the sampling points corresponding to the channel:
setting an amplitude threshold value VSetting the signal median value of the current pipe section as Vs-midJudging whether the magnetic leakage data amplitude of the sampling point is at Vs-mid±VIn the range of/2;
if yes, the magnetic flux leakage data category of the sampling point is as follows:
Figure BDA0002530614520000021
if not, the magnetic flux leakage data category of the sampling point is as follows:
Figure BDA0002530614520000022
in the formula, Ci,jClass label of sampling data of a mileage sampling point j position of a sensor I, Vi,jIs the signal amplitude, V, of the i-number sensor at the position of the mileage sampling point js-midIs the median value of the signal, V, of the current pipe sections-max,Vs-minRespectively corresponding to the maximum value and the minimum value of the signal of the current pipe section, wherein a, b, c and d are all regulating factors smaller than 1;
step B-2-2, for any sampling point, taking the maximum value of each channel category as the category of the sampling point;
and B-3, taking the maximum value of the axial, radial and circumferential categories of the sampling points as the comprehensive category of the magnetic leakage data of the sampling points, and obtaining the final category label of the magnetic leakage data of each sampling point of the pipe section.
Further, in step B-1, the method for setting the classification category number k is as follows:
Figure BDA0002530614520000031
in the formula, Vn_maxAnd Vn_minCorresponding maximum and minimum values, V, of signals representing n segments obtained by random samplingpeakAnd VvalleyPeak and valley values of signal amplitude corresponding to smaller defects in the obtained randomly sampled N pipe sections, N being an intermediate variable, NclassTo indicate the number of quantization layers to be set for the defect, k is the number of classification categories, and floor indicates rounding.
Further, the method for performing graying processing on the preprocessed magnetic leakage data comprises the following steps:
step C-1, setting a window adjustment amplitude threshold, setting the size of an initial sliding window, and performing boundary expansion on magnetic flux leakage data;
c-2, comparing the extreme value difference of the amplitude of the leakage data in the current window with the size of a window adjusting amplitude threshold, and if the extreme value difference is less than or equal to the window adjusting amplitude threshold, adjusting the size of the window until reaching a data boundary; if the extreme value difference is larger than the window adjustment amplitude threshold value, performing the step C-3;
c-3, correcting the extreme value of the amplitude of the magnetic leakage data in the current window by adopting an adjusting factor so as to realize gray value compensation;
and C-4, segmenting the magnetic leakage data of any sampling point in the current window according to the magnitude relation between the amplitude of the magnetic leakage data and the median of the amplitude of the magnetic leakage data in the channel, and performing local segmentation gray mapping.
Further, the magnetic flux leakage data after the segmented gray mapping is further processed by adopting a gray segmentation transformation method, wherein the gray segmentation transformation method comprises the following steps:
is provided with C2Part of the classified magnetic leakage data is located in a non-defective region, and part of the classified magnetic leakage data is located in a defective region; c3To CkThe magnetic leakage data of the category are all located in the defect area;
when the category label is C1、C2The gray scale segment transformation formula is as follows:
Figure BDA0002530614520000041
when the category label is C3To CkThe gray scale segment transformation formula is as follows:
Figure BDA0002530614520000042
in the formula, RsIs a scale factor, RbIs a scale factor, GcvIs the median value of the gray, gi,jIs the gray mapping value G of the i-number sensor at the position of a mileage sampling point ji,j' is the value of the sampling point after the sectional gray mapping, h1、h2For the amplification factor, λ, γ are power exponents.
Further, in step C-3, the method for correcting the extreme value of the amplitude of the leakage data in the current window by using the adjustment factor includes:
Figure BDA0002530614520000043
Figure BDA0002530614520000044
in the formula, Vw-max-cRepresenting the corrected local window maximum amplitude mapping value; vw-min-cRepresenting a corrected local window minimum amplitude mapping value; vw-maxRepresenting a local window maximum amplitude mapping value before correction; vw-minRepresenting a local window minimum amplitude mapping value before correction; alpha and beta are regulating factors; raRepresenting a deviation coefficient; vmaxRepresenting the maximum value, V, in the current pipe section flux leakage dataminAnd representing the minimum value in the current pipe section magnetic leakage data.
Further, in step C-4, the method of local segmentation gray scale mapping comprises:
Figure BDA0002530614520000045
in the formula, Gi,jThe gray value of the i-number sensor after the signal gray level conversion at the position of the mileage sampling point j is obtained; gmIs the maximum gray value; gcvIs the median value of the gray scale; vi,jIs the signal amplitude, V, of the i-number sensor at the position of the mileage sampling point jm_iIs the median amplitude value of channel i, VmaxFor the maximum value of the current pipe section signal amplitude, VminIs the minimum value of the current pipe section signal amplitude.
Further, the first segmentation method includes the steps of:
step D-1, taking the gray median as the gray threshold, dividing the gray image of the magnetic leakage data into two parts, namely an image I1And image I2Wherein, in the step (A),
Figure BDA0002530614520000051
Figure BDA0002530614520000052
in the formula, GcvIs the median value of the gray scale, Gi,jThe gray value of the i-number sensor after the signal gray level conversion at the position of the mileage sampling point j is obtained; i is1(I, j) is a gray scale value of an image having a smaller gray scale value after division, I2(i, j) is the gray value of the image with larger gray value after division;
step D-2, separately for the image I1And image I2Performing binarization segmentation by adopting Otsu algorithm to obtain a background region gray level interval [ gl,gh](ii) a The specific method comprises the following steps:
firstly, an Otsu algorithm is adopted to segment an image I1It has a total of [0, L]Grey scale, calculating image I1The gray value probability distribution of (2);
let image I1There is a gray level threshold GthrImage I1Dividing the gray value of the pixel point into two categories according to the gray threshold value, and respectively setting the two categories as
Figure BDA0002530614520000053
And
Figure BDA0002530614520000054
gray value interval corresponding to [0, G ]thr) And [ G ]thr,L]The gray value of any pixel point is distributed in the class
Figure BDA0002530614520000055
The probability in the interval is distributed in
Figure BDA0002530614520000056
The average value of the gray levels of the interval and the whole image is further obtained
Figure BDA0002530614520000057
Sum of pixel variances of intervals
Figure BDA0002530614520000058
Order to
Figure BDA0002530614520000059
Taking the maximum value to obtain an image I1Gray scale threshold value GthrFrom an image I1Gray scale threshold value GthrObtaining an image I1Gray scale division critical value gl
Using and image I1Same processing method for image I2Performing image segmentation to obtain an image I2Gray scale division critical value gh;[gl,gh]The interval is the background area of the gray level image, gl、ghThe corresponding points are the end point values of the gray scale interval of the background area.
Further, the method for processing the gray-scale image pseudo colorization comprises the following steps:
step E-1, taking C1The minimum and maximum gray values of the pixels corresponding to the category are respectively denoted as cmin、cmaxRespectively take C1The maximum value of the gray value of the corresponding pixel point of other categories is taken as the boundary value of the gray interval and is recorded as (c)2,c3,...,ck) (ii) a Wherein k is the number of classification categories;
step E-2, merging the end point value of the gray scale interval of the background area, the boundary value of the gray scale interval and C according to the following method1Obtaining the gray value extreme value of the pixel point corresponding to the category to obtain the gray interval end point value l1、l2、l3、l4
l1=max(gl,cmin),l2=max(gh,cmax),l3=min(c2,c3),l4=min(c4,c5);
E-3, adjusting the pseudo-color codes according to the end point values of the gray scale interval by adopting the following method, and performing pseudo-colorization treatment on the gray scale image of the magnetic flux leakage data;
the mapping relation of the R component is adjusted as follows:
Figure BDA0002530614520000061
the G component mapping relationship is adjusted as follows:
Figure BDA0002530614520000062
the component B mapping relation is adjusted as follows:
Figure BDA0002530614520000063
in the formula, CB(i, j) is the pixel value of the B component of the mapped false-color image at point (i, j), CG(i, j) is the pixel value of the G component of the mapped false-color image at point (i, j), CR(i, j) is the pixel value of the R component of the mapped false-color image at point (i, j), l1、l2、l3、l4As end point values of the gray scale interval, Gi,jThe gray value of the i-number sensor after the signal gray conversion at the position of the mileage sampling point j is obtained.
The invention has the advantages and positive effects that: on the basis of a rainbow coding method, the gray level interval of the gray level image is acquired in a self-adaptive manner by taking the defect region characteristics of the gray level image of the magnetic leakage data into consideration and combining the three-axis class labels of the axial direction, the radial direction and the circumferential direction with the maximum class variance method, so that the gray level interval of the magnetic leakage data is acquired in a self-adaptive manner, the mapping interval can be adjusted in a self-adaptive manner as far as possible, and the gray level interval has higher adaptability to different magnetic leakage data, and has the advantages that:
firstly, compared with the original rainbow coding method, the magnetic flux leakage data false color image processed by the improved algorithm has clear defect characteristics, clear boundary and higher boundary identification degree.
Secondly, compared with the original rainbow coding method, the pseudo color image obtained by the improved algorithm of the invention obviously weakens the contact ratio of the image background color and the defect area, so that the defect boundary is clear and visible.
Thirdly, the improved pseudo colorization method has self-adaptive property and improves the color discrimination.
Drawings
FIG. 1 is a flow chart of a magnetic leakage data adaptive pseudo-colorization method according to the present invention;
FIG. 2 is an image obtained by dividing a gray scale image of flux leakage data of a pipeline by a gray scale image binary division method;
FIG. 3 is an image of FIG. 2 after undergoing Otsu algorithm segmentation processing;
FIG. 4 is a pseudo-color image of the pipeline axial magnetic flux leakage data after pseudo-color visualization processing by using the improved pseudo-color coding method of the present invention;
fig. 5 is a comparison graph of the effect of pseudo-color visualization processing on the pipeline radial magnetic flux leakage data by using a common rainbow coding method and the improved pseudo-color coding method of the present invention.
Fig. 6 is a comparison graph of the effect of the visual pseudo-color processing on the circumferential magnetic flux leakage data of the pipeline by using the common rainbow coding method and the improved pseudo-color coding method of the present invention.
Detailed Description
For further understanding of the contents, features and effects of the present invention, the following embodiments are enumerated in conjunction with the accompanying drawings, and the following detailed description is given:
referring to fig. 1 to 6, a magnetic flux leakage data adaptive pseudo-colorization method performs a base value correction and a denoising pre-processing on magnetic flux leakage data; classifying the preprocessed magnetic flux leakage data, setting the classification category number as k, and correspondingly setting the category label as CiI is 1, 2 … k, wherein C1The magnetic leakage data of the types are all located in a defect-free region, and the magnetic leakage data of other types are partially or completely located in the defect region; carrying out graying processing on the preprocessed magnetic flux leakage data to generate a grayscale image; the generated gray level image is segmented by two methods, wherein the first segmentation method comprises the following steps: setting a gray threshold, dividing the generated gray image into two parts according to the gray threshold, and respectively carrying out binarization division on the two parts of images by adopting an Otsu algorithm to obtain end point values of a gray interval of a background area; the second segmentation method comprises the following steps: dividing the gray level image according to the magnetic leakage data category label to obtain C2To CkTaking the maximum gray value corresponding to the category magnetic flux leakage data as a gray interval boundary value; merging background region gray scale interval endsPoint value, gray scale interval boundary value and C1Obtaining each end point value of the divided gray scale interval by the category corresponding to the gray value extreme value of the pixel point; and adjusting the pseudo-color codes according to the end point values of the gray scale interval and performing pseudo-colorization treatment on the gray scale image.
The gray level image gray level interval is obtained in a self-adaptive mode by combining a category label and a maximum inter-category variance method, the pseudo color coding is adjusted according to each endpoint value of the gray level interval, and the traditional pseudo color coding method is adjusted and improved.
Taking the magnetic leakage data amplitude with stable signal amplitude and no defect region as an amplitude reference value, and dividing and setting a class label of the sampling point magnetic leakage data according to the difference value of the sampling point magnetic leakage data amplitude and the reference value, wherein the larger the difference value is, the larger the class number is; c is the magnetic flux leakage data class label of the non-defective region1。CiThe larger the value of i in the sampling point is, the larger the difference value between the sampling point magnetic leakage data amplitude and the reference value is.
Preferably, the method for performing the fundamental value correction and the denoising pre-processing on the leakage flux data of each sampling point may include the following steps:
step A-1, performing base value calibration on magnetic flux leakage data of each sampling point by adopting an average median method;
and step A-2, denoising the magnetic flux leakage data after the base value calibration by adopting a wavelet threshold denoising method.
Preferably, the method for classifying the preprocessed magnetic leakage data may include the steps of:
step B-1, setting classification category number k;
b-2, classifying the axial, radial and circumferential magnetic flux leakage detection data of a pipe section according to the methods in the steps B-2-1 and B-2-2 to obtain the classes of the axial, radial and circumferential magnetic flux leakage data corresponding to the sampling points; wherein:
b-2-1, classifying the magnetic flux leakage data of the sampling points corresponding to any channel according to the following method to obtain the category of the magnetic flux leakage data of the sampling points corresponding to the channel:
setting an amplitude threshold value VSetting the signal median value of the current pipe section as Vs-midJudging whether the magnetic leakage data amplitude of the sampling point is at Vs-mid±VIn the range of/2;
if yes, the magnetic flux leakage data category of the sampling point is as follows:
Figure BDA0002530614520000081
if not, the magnetic flux leakage data category of the sampling point is as follows:
Figure BDA0002530614520000082
in the formula, Ci,jClass label of sampling data of a mileage sampling point j position of a sensor I, Vi,jIs the signal amplitude, V, of the i-number sensor at the position of the mileage sampling point js-midIs the median value of the signal, V, of the current pipe sections-max,Vs-minRespectively corresponding to the maximum value and the minimum value of the signal of the current pipe section, wherein a, b, c and d are all regulating factors smaller than 1; the values of a and b are 0.8-0.99. And c and d are 0.8-1.1.
Step B-2-2, for any sampling point, taking the maximum value of each channel category as the category of the sampling point;
and B-3, taking the maximum value of the axial, radial and circumferential categories of the sampling points as the comprehensive category of the magnetic leakage data of the sampling points, and obtaining the final category label of the magnetic leakage data of each sampling point of the pipe section.
Preferably, in step B-1, the method for setting the classification category number k is as follows:
Figure BDA0002530614520000091
in the formula, Vn_maxAnd Vn_minCorresponding maximum and minimum values, V, of signals representing n segments obtained by random samplingpeakAnd VvalleyCorresponding to n pipe sections obtained for the resulting random samplingThe peak value and the valley value of the signal amplitude corresponding to the medium and small defects are generally 5-20, N is an intermediate variable, and N is an intermediate variableclassNumber of quantization layers to be set for indicating the defect, NclassGenerally, 4 to 6 are taken, k is the number of classification categories, and floor represents rounding by rounding.
Preferably, the method for performing graying processing on the preprocessed leakage flux data includes the following steps:
step C-1, setting a window adjustment amplitude threshold, setting the size of an initial sliding window, and performing boundary expansion on magnetic flux leakage data; the effectiveness of window adjustment is ensured, and the size of the window adjustment amplitude threshold depends on the amplitude of the defects in the acquired pipeline original data, and is generally 0.3-0.5. The size of the initial sliding window can be set, and the length is LwWidth of WwIn order to avoid the problem that the logarithmic matrix boundary cannot be processed due to boundary overflow, boundary extension is firstly carried out on preprocessed to-be-processed leakage magnetic data, and L is respectively extended on the left side and the right sidewA/2 mileage point, W is expanded from the upper and lower sideswAnd 2, a channel. According to the fluctuation characteristics of the amplitude of the magnetic leakage signal and the distribution characteristics of the sensors in the internal detector, the window length LwMainly depends on the defect length, and is usually 20-60; width W of windowwMainly depending on the depth of the defect, generally 6-18;
c-2, comparing the extreme value difference of the magnetic leakage data amplitude in the current window with the window adjusting amplitude threshold value, if the extreme value difference is less than or equal to the window adjusting amplitude threshold value, adaptively adjusting the window size, and expanding the window length by deltalWide extensible deltawAnd judging and expanding again until reaching the data boundary. Mileage point delta with single adjustment of window sizelIn the range of about 5 to 20, the number of channels DeltawThe range is about 2-6, and if the extreme value difference is larger than the window adjustment amplitude threshold value, the step C-3 is carried out;
c-3, correcting the extreme value of the amplitude of the magnetic leakage data in the current window by adopting an adjusting factor so as to realize gray value compensation;
and C-4, segmenting the magnetic leakage data of any sampling point in the current window according to the magnitude relation between the amplitude of the magnetic leakage data and the median of the amplitude of the magnetic leakage data in the channel, and performing local segmentation gray mapping.
Preferably, the magnetic leakage data after the segmented gray mapping is further processed by using a gray segmentation transformation method, wherein the gray segmentation transformation method is as follows:
is provided with C2Part of the classified magnetic leakage data is located in a non-defective region, and part of the classified magnetic leakage data is located in a defective region; c3To CkThe magnetic leakage data of the category are all located in the defect area;
when the category label is C1、C2The gray scale segment transformation formula is as follows:
Figure BDA0002530614520000101
when the category label is C3To CkThe gray scale segment transformation formula is as follows:
Figure BDA0002530614520000102
in the formula, RsIs a scale factor, and is generally 2-8; rbThe scale factor is generally 2-8. GcvIs the median value of the gray, gi,jIs the gray mapping value G of the i-number sensor at the position of a mileage sampling point ji,j' is the value of the sampling point after the sectional gray mapping, h1、h2For the amplification factor, λ, γ are power exponents. h is1、h2Usually 0.7 to 1.4; the lambda and the gamma are usually 0.8-1.2, and are generally near 1, so that the lambda and the gamma are not too large or too small, otherwise, image distortion is easily caused; rbGenerally, the amount is 2 to 8.
Preferably, in step C-3, the method for correcting the extreme value of the amplitude of the leakage data in the current window by using the adjustment factor may be:
Figure BDA0002530614520000103
Figure BDA0002530614520000111
in the formula, Vw-max-cRepresenting the corrected local window maximum amplitude mapping value; vw-min-cRepresenting a corrected local window minimum amplitude mapping value; vw-maxRepresenting a local window maximum amplitude mapping value before correction; vw-minRepresenting a local window minimum amplitude mapping value before correction; alpha and beta are regulating factors, and the values are usually 0.8-1.4; raThe value of the deviation coefficient is 2-10VmaxRepresenting the maximum value, V, in the current pipe section flux leakage dataminAnd representing the minimum value in the current pipe section magnetic leakage data.
Preferably, in step C-4, the method of local segmentation gray scale mapping may be:
Figure BDA0002530614520000112
in the formula, Gi,jThe gray value of the i-number sensor after the signal gray level conversion at the position of the mileage sampling point j is obtained; gmThe value is 255 for the 8-bit pixel with the maximum gray value; gcvIs the median value of the gray scale; the value is usually 50-100; vi,jIs the signal amplitude, V, of the i-number sensor at the position of the mileage sampling point jm_iIs the median amplitude value of channel i, VmaxFor the maximum value of the current pipe section signal amplitude, VminIs the minimum value of the current pipe section signal amplitude.
Preferably, the first segmentation method may comprise the steps of:
step D-1, taking the gray median as the gray threshold, dividing the gray image of the magnetic leakage data into two parts, namely an image I1And image I2Wherein, I1(i, j) is a gray scale value of an image having a smaller gray scale value after division. I is2(i, j) is a gray scale value of an image having a large gray scale value after division.
Figure BDA0002530614520000113
Figure BDA0002530614520000114
In the formula, GcvIs the median value of the gray scale, Gi,jIs the gray value of the I-number sensor after the signal gray conversion at the mileage sampling point j position, I1(I, j) is a gray scale value of an image having a smaller gray scale value after division, I2(i, j) is the gray value of the image with larger gray value after division;
step D-2, separately for the image I1And image I2Performing binarization segmentation by adopting Otsu algorithm to obtain a background region gray level interval [ gl,gh](ii) a The specific method comprises the following steps:
firstly, an Otsu algorithm is adopted to segment an image I1May be given a total of [0, L ]]Grey scale, calculating image I1The gray value probability distribution of (2);
can be provided with an image I1There is a gray level threshold GthrImage I1Dividing the gray value of the pixel point into two categories according to the gray threshold value, and respectively setting the two categories as
Figure BDA0002530614520000121
And
Figure BDA0002530614520000122
gray value interval corresponding to [0, G ]thr) And [ G ]thr,L]The gray value of any pixel point is distributed in the class
Figure BDA0002530614520000123
The probability in the interval is distributed in
Figure BDA0002530614520000124
The average value of the gray levels of the interval and the whole image is further obtained
Figure BDA0002530614520000125
Sum of pixel variances of intervals
Figure BDA0002530614520000126
Order to
Figure BDA0002530614520000127
Taking the maximum value to obtain an image I1Gray scale threshold value GthrFrom an image I1Gray scale threshold value GthrObtaining an image I1Gray scale division critical value gl
Using and image I1Same processing method for image I2Performing image segmentation to obtain an image I2Gray scale division critical value gh;[gl,gh]The interval is the background area of the gray level image, gl、ghThe corresponding points are the end point values of the gray scale interval of the background area.
Preferably, the adaptive pseudo-colorization processing may be performed on a gray-scale image, and the method of adaptive pseudo-colorization processing on a gray-scale image may include:
step E-1, taking C1The minimum and maximum gray values of the pixels corresponding to the category are respectively denoted as cmin、cmaxRespectively take C1The maximum value of the gray value of the corresponding pixel point of other categories is taken as the boundary value of the gray interval and is recorded as (c)2,c3,...,ck) (ii) a Wherein k is the number of classification categories;
step E-2, the end point value of the gray scale interval of the background area, the boundary value of the gray scale interval and C can be merged according to the following method1Obtaining the gray value extreme value of the pixel point corresponding to the category to obtain the gray interval end point value l1、l2、l3、l4
l1=max(gl,cmin),l2=max(gh,cmax),l3=min(c2,c3),l4=min(c4,c5);
E-3, adjusting the pseudo-color codes by adopting the following method on the basis of rainbow codes according to the end point values of the gray scale interval, and performing pseudo-colorization treatment on the gray scale image of the magnetic flux leakage data;
the mapping relation of the R component is adjusted as follows:
Figure BDA0002530614520000128
the G component mapping relationship is adjusted as follows:
Figure BDA0002530614520000131
the component B mapping relation is adjusted as follows:
Figure BDA0002530614520000132
in the formula, CB(i, j) is the pixel value of the B component of the mapped false-color image at point (i, j), CG(i, j) is the pixel value of the G component of the mapped false-color image at point (i, j), CR(i, j) is the pixel value of the R component of the mapped false-color image at point (i, j), l1、l2、l3、l4As end point values of the gray scale interval, Gi,jThe gray value of the i-number sensor after the signal gray conversion at the position of the mileage sampling point j is obtained.
The working process and working principle of the present invention are further explained by a preferred embodiment of the present invention as follows:
fig. 1 is a flowchart of an adaptive pseudo-colorization method for leakage magnetic data according to the present invention. The method comprises the steps of setting category labels for a magnetic flux leakage detection data set according to three categories of axial direction, radial direction and circumferential direction of magnetic flux leakage data, performing data graying processing, combining an Ostu image segmentation algorithm and a category label image segmentation algorithm, performing adaptive gray interval combination, and improving pseudo-color codes, so that the adaptive visualization of the pseudo-color image is realized.
The invention relates to a magnetic flux leakage data self-adaptive pseudo colorization method, which specifically comprises the following steps of:
step 1, magnetic flux leakage data are preprocessed.
And 1.1, calibrating a base value.
To avoid the amplitude adjustment of the leakage magnetic signal caused by the deviation of the advancing direction of the inner detector or the sliding of the sensorBody drift, so that
Figure BDA0002530614520000133
Taking 500 sampling points (corresponding to the actual pipe length of 1m) as a unit (if the actual pipe length is not enough, taking the actual pipe length completely) as a pipe section, and performing data base value calibration by adopting an average median method, namely processing by taking a signal median value in the pipe section as a reference value, as shown in the following formula
Figure BDA0002530614520000134
Figure BDA0002530614520000135
In the formula, Bi(j)ansThe method comprises the steps of calibrating a position of a mileage sampling point j for a detection magnetic field intensity of a sensor I; b isi(j) The uncalibrated detected magnetic field intensity of the sensor I at the mileage j sampling position; k represents the total number of sensors; b isiThe magnetic field intensity median value of the sensor I; vi-medianThe median output voltage in the pipe section of the sensor I is obtained; vrefThe reference voltage value of the Hall sensor is 2.5V; p is the voltage amplification factor of the detection circuit (usually taken as 3); sens is the sensitivity of the Hall sensor to the input magnetic field strength and the output voltage (3.125 mv/Gs).
And 1.2, denoising the magnetic flux leakage data by adopting a wavelet threshold.
Step 1.2.1, selecting a proper wavelet basis function, determining the number of decomposition layers NN, wherein the wavelet basis function is selected from sym3, sym4 or sym10 functions in a symN wavelet family, and the number of decomposition layers N is generally 5. Performing N-layer wavelet decomposition on a signal to be processed by adopting discrete wavelet transform, wherein the result W (j, k) of the discrete wavelet transform of a single-channel leakage flux signal f (t) is as follows:
Figure BDA0002530614520000141
in the formula, #(j,k)(t)*Is psi(j,k)Complex conjugate result of (t), psi(j,k)(t) represents a discrete wavelet function.
And step 1.2.2, applying a soft threshold method to the wavelet coefficient obtained by decomposition for quantization processing, wherein the obtained wavelet coefficient after filtering is shown as a formula 4.
Figure BDA0002530614520000142
In the formula, sign is a sign function, W (j, k) is a wavelet coefficient after wavelet transformation, and lambda is a threshold value. The specific value of the threshold may be determined by searching for maxima of the wavelet coefficients after wavelet transform, then finding a minimum value among the maxima, and setting the minimum value as the threshold.
Step 1.2.3, taking the low-frequency signal component of the Nth layer and the high-frequency signal component of each processed layer as initial input, and completing signal reconstruction according to a wavelet basis function and a wavelet decomposition result, as shown in the following formula 5:
Figure BDA0002530614520000143
where W represents the compatibility condition of the wavelet function. Thus, the single-channel leakage magnetic signal f' (t) after noise reduction can be obtained.
And 2, carrying out graying processing to generate a grayscale image.
Step 2.1, setting the size of an initial sliding window with the length of LwWidth of WwIn order to avoid the problem that the logarithmic matrix boundary cannot be processed due to boundary overflow, boundary extension is firstly carried out on preprocessed to-be-processed leakage magnetic data, and L is respectively extended on the left side and the right sidewA/2 mileage point, W is expanded from the upper and lower sideswAnd 2, a channel. According to the fluctuation characteristics of the amplitude of the magnetic leakage signal and the distribution characteristics of the sensors in the internal detector, the window length LwMainly depends on the defect length, and is usually 20-60; width W of windowwThe defect depth is mainly determined, and the defect depth is generally 6-18.
Step 2.2, judging whether the amplitude extreme value difference in the current window is larger than an amplitude threshold value VIf the value is smaller than the preset value, the window size is adjusted in a self-adaptive mode, and the length is expanded by deltalWide extension of deltawRe-judging, straightAnd if not, performing step 2.3. Mileage point delta with single adjustment of window sizelIn the range of about 5 to 20, the number of channels DeltawThe range is about 2-6 to ensure the effectiveness of window adjustment, and the amplitude threshold value VThe size of the defect is determined by the amplitude of the defect in the acquired pipeline original data, and is generally 0.3-0.5.
Step 2.3, the maximum value V of the amplitude in the current window is calculated by formulas 6 and 7w-maxMinimum value Vw-minCarrying out amplitude correction to obtain a corrected maximum value Vw-max-cMinimum value Vw-min-cTo achieve gray value compensation;
Figure BDA0002530614520000151
Figure BDA0002530614520000152
in the formula, Vw-max-cRepresenting the corrected local window maximum amplitude mapping value; vw-min-cRepresenting a corrected local window minimum amplitude mapping value; alpha and beta are regulating factors, and the values are usually 0.8-1.4; raThe value of the deviation coefficient is usually 2-10. VmaxRepresenting the maximum value in the magnetic flux leakage data of the current pipe section, and, for the same reason, VminAnd representing the minimum value in the current pipe section magnetic leakage data.
Step 2.4, local segmentation gray mapping is carried out on any data point by adopting a formula 8 according to the magnitude relation between the amplitude of the data point and the median of the channel amplitude;
Figure BDA0002530614520000153
in the formula, Gi,jThe gray value of the i-number sensor after the signal gray level conversion at the position of the mileage sampling point j is obtained; gmThe value is 255 for the 8-bit pixel with the maximum gray value; gcvThe value is a median gray value, and is usually 50-100; vi,jIs the signal amplitude, V, of the i-number sensor at the position of the mileage sampling point jm_iIs the median amplitude value of channel i, VmaxFor the maximum value of the current pipe section signal amplitude, VminIs the minimum value of the current pipe section signal amplitude.
Step 2.5, judging whether any data sampling point in the channel is positioned at V or nots-mid±VIn the range of/2, if the data is in the range, the data is classified according to the formula 9, otherwise, the data is classified according to the formula 10.
Figure BDA0002530614520000161
Figure BDA0002530614520000162
In the above formula Ci,jAnd the category label of the sampling data of the sensor I at the position of the mileage sampling point j is shown. Vi,jIs the signal amplitude, V, of the i-number sensor at the position of the mileage sampling point js-midIs the median value of the signal, V, of the current pipe sections-max,Vs-minRespectively the maximum value and the minimum value of the signal of the current pipe section. a and b are regulating factors, and the value of a is 0.8-0.99. c and d are also regulating factors, and the value is 0.8-1.1. K is the number of classification categories, and the value is shown in the following formula 11.
Figure BDA0002530614520000163
Vn_maxAnd Vn_minRespectively representing the maximum value and the minimum value of signals of n pipe sections obtained by random sampling, wherein n is generally 5-20VpeakAnd VvalleyThe peak and valley of the amplitude of the smaller defects of the N tube sections obtained for the random sampling obtained, NclassThe number of layers to be set for quantization of the defect is generally 4 to 6, K is the number of classes to be classified, and floor represents rounding.
For any sampling point, the maximum value of each channel category is taken as the classification category of the current mileage sampling point, and in addition, the radial and circumferential magnetic flux leakage detection data of the pipe section are respectively processed according to the stepsObtaining a radial data category label CrCircumferential data category label CcAnd taking the maximum value of the triaxial class label to correct the class label to obtain the final class label C of the magnetic flux leakage data of each sampling point of the pipe section. The three-axis class label refers to a composite class label that combines axial, radial, and circumferential class labels.
And 2.6, according to the three-axis data category label obtained in the step 2.5, performing classified adaptive gray scale conversion on the gray scale value obtained by mapping according to formulas 12 and 13 respectively to obtain a final gray scale image after gray scale conversion processing (in the step, the original magnetic leakage data can be processed after the step 2.3 and before the step 2.4, so that a basically consistent gray scale effect can be obtained, and the processing efficiency is improved at the same time).
When the label is C1、C2The formula of the gray scale segment transformation is shown as follows:
Figure BDA0002530614520000171
in the formula, RsThe scale factor is generally 2-8. GcvIs the median value of the gray, gi,jIs the gray mapping value G of the i-number sensor at the position of a mileage sampling point ji,j' is the value of the sampling point after the segmented gray mapping.
When the label is C3~C7The formula of the gray scale segment transformation is as follows:
Figure BDA0002530614520000172
in the formula, h1、h2The amplification factor is usually 0.7-1.4; the lambda and the gamma are power exponents, are usually 0.8-1.2, are generally near 1, and are not suitable to be too large or too small, otherwise, image distortion is easily caused. RbThe scale factor is generally 2-8.
And 2.7, visualizing the magnetic flux leakage data gray level image.
Step 3, taking the gray median GcvThe leakage flux data gray image to be processed is segmented for gray threshold values, as shown in figure 2,obtaining an image I1、I2
The segmented image is:
Figure BDA0002530614520000173
Figure BDA0002530614520000174
in the formula Gi,jIs the gray value of the I-number sensor after the signal gray conversion at the mileage sampling point j position, I1(i,j),I2(i, j) are the gray values of the image with the smaller and larger gray values after division, respectively.
Step 4, respectively aligning the images I1、I2Performing binarization segmentation by adopting Otsu algorithm to obtain processed image as shown in FIG. 3, and simultaneously obtaining background region gray scale interval [ g ]l,gh]。
Firstly, an Otsu algorithm is adopted to segment an image I1Is given a total of [0, L]Gray level, and n is the total number of pixels with iiThen the total number N of the current gray level image pixel points can be obtainediComprises the following steps:
Ni=n0+n1+,,,+nL(16);
at the same time, an image I is obtained1I.e. the probability p of the occurrence of an arbitrary gray value iiComprises the following steps:
Figure BDA0002530614520000181
image I1At a certain gray level threshold GthrDividing the gray value of pixel point into two categories
Figure BDA0002530614520000182
Gray value interval is [0, Gthr) And [ G ]thr,L]Then, for any pixel gray value, it is distributed in class
Figure BDA0002530614520000183
The probabilities of (a) are respectively:
Figure BDA0002530614520000184
Figure BDA0002530614520000185
at the same time, according to the above formula, the distribution can be obtained
Figure BDA0002530614520000186
The average value of the gray levels of the interval and the whole image is:
Figure BDA0002530614520000187
Figure BDA0002530614520000188
Figure BDA0002530614520000189
from the above results, it is possible to obtain
Figure BDA00025306145200001810
Sum of inter-class variance of intervals
Figure BDA00025306145200001811
Comprises the following steps:
Figure BDA00025306145200001812
order to
Figure BDA00025306145200001813
Obtaining the maximum value to obtain the image I1Gray scale threshold value Gthr
For image I2The image segmentation can also be carried out by adopting the procedures to obtain the best resultLarge sum of class variance
Figure BDA00025306145200001814
The following were used:
Figure BDA00025306145200001815
accordingly, a gray-scale division critical value g of two images can be obtainedl、ghWherein, the image I1Gray scale threshold value GthrIs the gray scale division critical value glImage I2Gray scale threshold value GthrIs the gray scale division critical value gh. It is apparent that the gray value lies in [ g ]l,gh]The interval belongs to a signal stationary segment, namely a background area of the gray image.
Step 5, obtaining a leakage magnetic data triaxial class label according to the algorithm of the step 2.5, and taking C1The minimum and maximum gray values of the pixels corresponding to the category are respectively denoted as cmin、cmaxRespectively take C2~C8The maximum class gray value is recorded as a boundary value of the gray interval as (c)2,c3,...,c8)。
Step 6, combining the gray critical values obtained by the two methods to obtain the point value l of each end point of the divided gray value interval1=max(gl,cmin),l2=max(gh,cmax),l3=min(c2,c3),l4=min(c4,c5). Wherein (0, l)1]Is a weld or the like component region (l)1,l2]Is the left and right regions of the defect (l)2,l3]As background region (l)3,l4]Is the upper and lower regions of the defect (l)4,255]The central region of the defect.
Step 7, improving a pseudo-color coding mode, and carrying out self-adaptive pseudo-colorization processing on the gray level images of different magnetic flux leakage data;
r component mapping modification
Figure BDA0002530614520000191
G component mapping modification
Figure BDA0002530614520000192
B component mapping modification
Figure BDA0002530614520000193
And 8, displaying the magnetic flux leakage data pseudo color image. Fig. 4 shows an axial pseudo-color image after the pseudo-color coding is improved, and fig. 5 and 6 show the pseudo-color image contrast obtained by the pseudo-color coding method before and after the radial and circumferential leakage flux data are improved.
The above-mentioned embodiments are only for illustrating the technical ideas and features of the present invention, and the purpose thereof is to enable those skilled in the art to understand the contents of the present invention and to carry out the same, and the present invention shall not be limited to the embodiments, i.e. the equivalent changes or modifications made within the spirit of the present invention shall fall within the scope of the present invention.

Claims (10)

1. A magnetic leakage data self-adaptive pseudo colorization method is characterized in that the magnetic leakage data is subjected to base value correction and denoising pretreatment; classifying the preprocessed magnetic flux leakage data, setting the classification category number as k, and correspondingly setting the category label as CiI is 1, 2 … k, wherein C1The magnetic leakage data of the types are all located in a defect-free region, and the magnetic leakage data of other types are partially or completely located in the defect region; carrying out graying processing on the preprocessed magnetic flux leakage data to generate a grayscale image; the generated gray level image is divided by two methods respectively, wherein the first division method comprises the following steps: setting a gray threshold, dividing the generated gray image into two parts according to the gray threshold, and respectively carrying out binarization division on the two parts of images by adopting an Otsu algorithm to obtain end point values of a gray interval of a background area; the second segmentation method comprises the following steps: label to grey scale map according to magnetic leakage data categoryDividing the image into C2To CkTaking the maximum gray value corresponding to the category magnetic flux leakage data as a gray interval boundary value; merging background area gray scale interval end point value, gray scale interval boundary value and C1Obtaining each end point value of the divided gray scale interval by the category corresponding to the gray value extreme value of the pixel point; and adjusting the pseudo-color codes according to the end point values of the gray scale interval and performing pseudo-colorization treatment on the gray scale image.
2. The leakage flux data adaptive pseudo-colorization method according to claim 1, wherein the method for performing the fundamental value correction and the denoising pre-processing on the leakage flux data of each sampling point comprises the following steps:
a-1, performing base value calibration on magnetic flux leakage data of each sampling point by adopting an average median method;
and step A-2, denoising the magnetic flux leakage data after the base value calibration by adopting a wavelet threshold denoising method.
3. The adaptive pseudo-colorization method of leakage flux data according to claim 1, wherein the method of classifying the pre-processed leakage flux data comprises the steps of:
step B-1, setting classification category number k;
b-2, classifying the axial, radial and circumferential magnetic flux leakage detection data of a pipe section according to the methods in the steps B-2-1 and B-2-2 to obtain the classes of the axial, radial and circumferential magnetic flux leakage data corresponding to the sampling points; wherein:
b-2-1, classifying the magnetic flux leakage data of the sampling points corresponding to any channel according to the following method to obtain the category of the magnetic flux leakage data of the sampling points corresponding to the channel:
setting an amplitude threshold value VSetting the signal median value of the current pipe section as Vs-midJudging whether the magnetic leakage data amplitude of the sampling point is at Vs-mid±VIn the range of/2;
if yes, the magnetic flux leakage data category of the sampling point is as follows:
Figure FDA0002530614510000021
if not, the magnetic flux leakage data category of the sampling point is as follows:
Figure FDA0002530614510000022
in the formula, Ci,jClass label of sampling data of a mileage sampling point j position of a sensor I, Vi,jIs the signal amplitude, V, of the i-number sensor at the position of the mileage sampling point js-midIs the median value of the signal, V, of the current pipe sections-max、Vs-minRespectively corresponding to the maximum value and the minimum value of the signal of the current pipe section, wherein a, b, c and d are all regulating factors smaller than 1;
step B-2-2, for any sampling point, taking the maximum value of each channel category as the category of the sampling point;
and B-3, taking the maximum value of the axial, radial and circumferential categories of the sampling points as the comprehensive category of the magnetic leakage data of the sampling points, and obtaining the final category label of the magnetic leakage data of each sampling point of the pipe section.
4. The adaptive pseudo-colorization method for the leakage magnetic data according to claim 3, wherein in the step B-1, the method for setting the classification class number k comprises the following steps:
Figure FDA0002530614510000023
in the formula, Vn_maxAnd Vn_minCorresponding maximum and minimum values, V, of signals representing n segments obtained by random samplingpeakAnd VvalleyPeak and valley values of signal amplitude corresponding to smaller defects in the obtained randomly sampled N pipe sections, N being an intermediate variable, NclassTo indicate the number of quantization layers to be set for the defect, k is the number of classification categories, and floor indicates rounding.
5. The adaptive pseudo-colorization method of leakage flux data according to claim 1, wherein the method of graying the preprocessed leakage flux data comprises the steps of:
step C-1, setting a window adjustment amplitude threshold, setting the size of an initial sliding window, and performing boundary expansion on magnetic flux leakage data;
c-2, comparing the extreme value difference of the amplitude of the leakage data in the current window with the size of a window adjusting amplitude threshold, and if the extreme value difference is less than or equal to the window adjusting amplitude threshold, adjusting the size of the window until reaching a data boundary; if the extreme value difference is larger than the window adjustment amplitude threshold value, performing the step C-3;
c-3, correcting the extreme value of the amplitude of the magnetic leakage data in the current window by adopting an adjusting factor so as to realize gray value compensation;
and C-4, segmenting the magnetic leakage data of any sampling point in the current window according to the magnitude relation between the amplitude of the magnetic leakage data and the median of the amplitude of the magnetic leakage data in the channel, and performing local segmentation gray mapping.
6. The leakage magnetic data adaptive pseudo-colorization method according to claim 5, wherein the leakage magnetic data after the segmented gray mapping is further processed by a gray segmentation transformation method, wherein the gray segmentation transformation method comprises the following steps:
is provided with C2Part of the classified magnetic leakage data is located in a non-defective region, and part of the classified magnetic leakage data is located in a defective region; c3To CkThe magnetic leakage data of the category are all located in the defect area;
when the category label is C1、C2The gray scale segment transformation formula is as follows:
Figure FDA0002530614510000031
when the category label is C3To CkThe gray scale segment transformation formula is as follows:
Figure FDA0002530614510000032
in the formula, RsIs a scale factor, RbIs a scale factor, GcvIs the median value of the gray, gi,jIs the gray mapping value G of the i-number sensor at the position of a mileage sampling point ji,j' is the value of the sampling point after the sectional gray mapping, h1、h2For the amplification factor, λ, γ are power exponents.
7. The leakage magnetic data adaptive pseudo-colorization method according to claim 5, wherein in the step C-3, the method for correcting the extreme value of the leakage magnetic data amplitude in the current window by using the adjustment factor comprises the following steps:
Figure FDA0002530614510000041
Figure FDA0002530614510000042
in the formula, Vw-max-cRepresenting the corrected local window maximum amplitude mapping value; vw-min-cRepresenting a corrected local window minimum amplitude mapping value; vw-maxRepresenting a local window maximum amplitude mapping value before correction; vw-minRepresenting a local window minimum amplitude mapping value before correction; alpha and beta are regulating factors; raRepresenting a deviation coefficient; vmaxRepresenting the maximum value, V, in the current pipe section flux leakage dataminAnd representing the minimum value in the current pipe section magnetic leakage data.
8. The leakage magnetic data adaptive pseudo-colorization method according to claim 5, wherein in the step C-4, the local segmentation gray scale mapping method comprises the following steps:
Figure FDA0002530614510000043
in the formula, Gi,jIs the signal of the i-number sensor at the position of the mileage sampling point jGray value after gray conversion; gmIs the maximum gray value; gcvIs the median value of the gray scale; vi,jIs the signal amplitude, V, of the i-number sensor at the position of the mileage sampling point jm_iIs the median amplitude value of channel i, VmaxFor the maximum value of the current pipe section signal amplitude, VminIs the minimum value of the current pipe section signal amplitude.
9. The leakage flux data adaptive pseudo-colorization method according to claim 1, wherein the first segmentation method comprises the steps of:
step D-1, taking the gray median as the gray threshold, dividing the gray image of the magnetic leakage data into two parts, namely an image I1And image I2Wherein, in the step (A),
Figure FDA0002530614510000044
Figure FDA0002530614510000045
in the formula, GcvIs the median value of the gray scale, Gi,jIs the gray value of the I-number sensor after the signal gray conversion at the mileage sampling point j position, I1(I, j) is a gray scale value of an image having a smaller gray scale value after division, I2(i, j) is the gray value of the image with larger gray value after division;
step D-2, separately for the image I1And image I2Performing binarization segmentation by adopting Otsu algorithm to obtain a background region gray level interval [ gl,gh](ii) a The specific method comprises the following steps:
firstly, an Otsu algorithm is adopted to segment an image I1It has a total of [0, L]Grey scale, calculating image I1The gray value probability distribution of (2);
let image I1There is a gray level threshold GthrImage I1Dividing the gray value of the pixel point into two categories according to the gray threshold value, and respectively setting the two categories as
Figure FDA0002530614510000051
And
Figure FDA0002530614510000052
gray value interval corresponding to [0, G ]thr) And [ G ]thr,L]The gray value of any pixel point is distributed in the class
Figure FDA0002530614510000053
The probability in the interval is distributed in
Figure FDA0002530614510000054
The average value of the gray levels of the interval and the whole image is further obtained
Figure FDA0002530614510000055
Sum of pixel variances of intervals
Figure FDA0002530614510000056
Order to
Figure FDA0002530614510000057
Taking the maximum value to obtain an image I1Gray scale threshold value GthrFrom an image I1Gray scale threshold value GthrObtaining an image I1Gray scale division critical value gl
Using and image I1Same processing method for image I2Performing image segmentation to obtain an image I2Gray scale division critical value gh;[gl,gh]The interval is the background area of the gray level image, gl、ghThe corresponding points are the end point values of the gray scale interval of the background area.
10. The leakage magnetic data adaptive pseudo-colorization method according to claim 9, wherein the method of pseudo-colorizing the gray-scale image comprises:
step E-1, taking C1The minimum and maximum gray values of the pixels corresponding to the category are respectively denoted as cmin、cmaxRespectively take C1The maximum value of the gray value of the corresponding pixel point of other categories is taken as the boundary value of the gray interval and is recorded as (c)2,c3,...,ck) (ii) a Wherein k is the number of classification categories;
step E-2, merging the end point value of the gray scale interval of the background area, the boundary value of the gray scale interval and C according to the following method1Obtaining the gray value extreme value of the pixel point corresponding to the category to obtain the gray interval end point value l1、l2、l3、l4
l1=max(gl,cmin),l2=max(gh,cmax),l3=min(c2,c3),l4=min(c4,c5);
E-3, adjusting the pseudo-color codes according to the end point values of the gray scale interval by adopting the following method, and performing pseudo-colorization treatment on the gray scale image of the magnetic flux leakage data;
the mapping relation of the R component is adjusted as follows:
Figure FDA0002530614510000058
the G component mapping relationship is adjusted as follows:
Figure FDA0002530614510000061
the component B mapping relation is adjusted as follows:
Figure FDA0002530614510000062
in the formula, CB(i, j) is the pixel value of the B component of the mapped false-color image at point (i, j), CG(i, j) is the pixel value of the G component of the mapped false-color image at point (i, j), CR(i, j) is the pixel value of the R component of the mapped false-color image at point (i, j), l1、l2、l3、l4Is the end of the gray scale intervalPoint value, Gi,jThe gray value of the i-number sensor after the signal gray conversion at the position of the mileage sampling point j is obtained.
CN202010517387.3A 2020-06-09 2020-06-09 Self-adaptive pseudo-colorization method for magnetic flux leakage data Active CN111882518B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010517387.3A CN111882518B (en) 2020-06-09 2020-06-09 Self-adaptive pseudo-colorization method for magnetic flux leakage data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010517387.3A CN111882518B (en) 2020-06-09 2020-06-09 Self-adaptive pseudo-colorization method for magnetic flux leakage data

Publications (2)

Publication Number Publication Date
CN111882518A true CN111882518A (en) 2020-11-03
CN111882518B CN111882518B (en) 2023-12-19

Family

ID=73157767

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010517387.3A Active CN111882518B (en) 2020-06-09 2020-06-09 Self-adaptive pseudo-colorization method for magnetic flux leakage data

Country Status (1)

Country Link
CN (1) CN111882518B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112539843A (en) * 2020-12-11 2021-03-23 平安科技(深圳)有限公司 Method and device for detecting temperature and computer equipment

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020114503A1 (en) * 2001-02-17 2002-08-22 Siemens Aktiengesellschaft Method and apparatus for processing a computed tomography image of a lung obtained using contrast agent
CN105225256A (en) * 2015-06-10 2016-01-06 西安交通大学 A kind of display packing of high gray depth image
CN105425123A (en) * 2015-11-20 2016-03-23 国网福建省电力有限公司泉州供电公司 Method and system for collaboratively detecting power equipment failure through ultraviolet imaging and infrared imaging
CN105976342A (en) * 2015-09-01 2016-09-28 南京理工大学 Adaptive gray-level image pseudo-color processing method
CN106404893A (en) * 2016-12-16 2017-02-15 北京华航无线电测量研究所 Automatic axial magnetic flux leakage defect signal detection method
CN107392912A (en) * 2017-07-25 2017-11-24 哈尔滨工业大学 Image partition method based on pseudo-color coding and DISCOV codings
CN108428225A (en) * 2018-01-30 2018-08-21 李家菊 Image department brain image fusion identification method based on multiple dimensioned multiple features
CN109147005A (en) * 2018-08-24 2019-01-04 电子科技大学 It is a kind of for the adaptive colouring method of infrared image, system, storage medium, terminal
CN110146589A (en) * 2019-06-17 2019-08-20 东北大学 A kind of high definition method for visualizing of pipe leakage data

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020114503A1 (en) * 2001-02-17 2002-08-22 Siemens Aktiengesellschaft Method and apparatus for processing a computed tomography image of a lung obtained using contrast agent
CN105225256A (en) * 2015-06-10 2016-01-06 西安交通大学 A kind of display packing of high gray depth image
CN105976342A (en) * 2015-09-01 2016-09-28 南京理工大学 Adaptive gray-level image pseudo-color processing method
CN105425123A (en) * 2015-11-20 2016-03-23 国网福建省电力有限公司泉州供电公司 Method and system for collaboratively detecting power equipment failure through ultraviolet imaging and infrared imaging
CN106404893A (en) * 2016-12-16 2017-02-15 北京华航无线电测量研究所 Automatic axial magnetic flux leakage defect signal detection method
CN107392912A (en) * 2017-07-25 2017-11-24 哈尔滨工业大学 Image partition method based on pseudo-color coding and DISCOV codings
CN108428225A (en) * 2018-01-30 2018-08-21 李家菊 Image department brain image fusion identification method based on multiple dimensioned multiple features
CN109147005A (en) * 2018-08-24 2019-01-04 电子科技大学 It is a kind of for the adaptive colouring method of infrared image, system, storage medium, terminal
CN110146589A (en) * 2019-06-17 2019-08-20 东北大学 A kind of high definition method for visualizing of pipe leakage data

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
LIJIAN YANG等: "Pipeline Magnetic Flux Leakage Image Detection Algorithm Based on Multiscale SSD Network", IEEE TRANSACTIONS ON INDUSTRIAL INFORMATICS, pages 501 *
YUELIANGINTELLIGENCE: "漏磁成像", pages 1, Retrieved from the Internet <URL:https://blog.csdn.net/yueliangintelligence/article/details/89153629> *
杨理践等: "管道漏磁内检测缺陷可视化方法", 无损探伤, vol. 36, no. 2, pages 1 - 3 *
王增国等: "管道漏磁内检测信号的自适应成像算法研究", 石油工程建设, vol. 45, no. 3, pages 5 - 9 *
黄方佑: "管道漏磁内检测数据的自适应可视化及增强方法研究", 万方, pages 1 - 93 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112539843A (en) * 2020-12-11 2021-03-23 平安科技(深圳)有限公司 Method and device for detecting temperature and computer equipment

Also Published As

Publication number Publication date
CN111882518B (en) 2023-12-19

Similar Documents

Publication Publication Date Title
CN113362326B (en) Method and device for detecting defects of welding spots of battery
US5345514A (en) Method for inspecting components having complex geometric shapes
CN114937055A (en) Image self-adaptive segmentation method and system based on artificial intelligence
CN110146589B (en) High-definition visualization method for pipeline magnetic flux leakage data
CN115457031A (en) Method for identifying internal defects of integrated box based on X-ray
CN112215803B (en) Aluminum plate eddy current inspection image defect segmentation method based on improved generation countermeasure network
CN115719332A (en) Welding quality detection method
CN117351019A (en) Welding defect detection method
CN111882518B (en) Self-adaptive pseudo-colorization method for magnetic flux leakage data
CN114972397A (en) Infrared image defect contour detection method for wind power blade composite material
Valeti et al. Automated detection of corrosion damage in power transmission lattice towers using image processing
CN117237364B (en) Welded pipe quality detection method based on image characteristics
CN110084786B (en) Automatic defect identification method for digital X-ray image with gradually-changed background
CN117351017A (en) Visual defect detection method for photovoltaic steel structure component
CN111831872A (en) Magnetic flux leakage data self-adaptive gray scale visualization method with enhanced small defect characteristics
CN113393440B (en) Method for automatically enhancing and identifying weld defects based on magneto-optical imaging
CN114998346B (en) Waterproof cloth quality data processing and identifying method
CN115266774B (en) Artificial intelligence-based weld joint ray detection and evaluation method
JP3788586B2 (en) Pattern inspection apparatus and method
CN112508862B (en) Method for enhancing magneto-optical image of crack by improving GAN
CN115311287A (en) Method for detecting production abnormity of common rail oil injector
CN109285144B (en) Mura detection method and device
CN113313709A (en) Method and device for detecting defects of industrial parts
EP4231227A3 (en) Method for denoising an electron microscope image
CN117036205B (en) Injection molding production quality detection method based on image enhancement

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