CN113393440B - Method for automatically enhancing and identifying weld defects based on magneto-optical imaging - Google Patents

Method for automatically enhancing and identifying weld defects based on magneto-optical imaging Download PDF

Info

Publication number
CN113393440B
CN113393440B CN202110659599.XA CN202110659599A CN113393440B CN 113393440 B CN113393440 B CN 113393440B CN 202110659599 A CN202110659599 A CN 202110659599A CN 113393440 B CN113393440 B CN 113393440B
Authority
CN
China
Prior art keywords
point
extreme
extreme point
peak
magneto
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110659599.XA
Other languages
Chinese (zh)
Other versions
CN113393440A (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.)
University of Electronic Science and Technology of China
Original Assignee
University of Electronic Science and Technology of China
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 University of Electronic Science and Technology of China filed Critical University of Electronic Science and Technology of China
Priority to CN202110659599.XA priority Critical patent/CN113393440B/en
Publication of CN113393440A publication Critical patent/CN113393440A/en
Application granted granted Critical
Publication of CN113393440B publication Critical patent/CN113393440B/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
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N27/00Investigating or analysing materials by the use of electric, electrochemical, or magnetic means
    • G01N27/72Investigating or analysing materials by the use of electric, electrochemical, or magnetic means by investigating magnetic variables
    • G01N27/82Investigating or analysing materials by the use of electric, electrochemical, or magnetic means by investigating magnetic variables for investigating the presence of flaws
    • G01N27/83Investigating or analysing materials by the use of electric, electrochemical, or magnetic means by investigating magnetic variables for investigating the presence of flaws by investigating stray magnetic fields
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R33/00Arrangements or instruments for measuring magnetic variables
    • G01R33/02Measuring direction or magnitude of magnetic fields or magnetic flux
    • G01R33/032Measuring direction or magnitude of magnetic fields or magnetic flux using magneto-optic devices, e.g. Faraday or Cotton-Mouton effect
    • 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
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Chemical & Material Sciences (AREA)
  • Theoretical Computer Science (AREA)
  • Electrochemistry (AREA)
  • Power Engineering (AREA)
  • Condensed Matter Physics & Semiconductors (AREA)
  • Quality & Reliability (AREA)
  • Chemical Kinetics & Catalysis (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Analytical Chemistry (AREA)
  • Biochemistry (AREA)
  • General Health & Medical Sciences (AREA)
  • Immunology (AREA)
  • Pathology (AREA)
  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)

Abstract

The invention discloses a magneto-optical imaging-based on-line automatic weld defect enhancing and identifying method, which comprises the steps of obtaining magneto-optical images of weld defects by using a magneto-optical detector, enabling the direction of magnetic induction lines of magneto-optical imaging to be the horizontal direction of the magneto-optical images, traversing each row of the magneto-optical images to detect a defect extreme value region, taking pixel points in the defect extreme value region obtained by each row in the magneto-optical images as target pixel points of the weld defects, and obtaining a connected domain to obtain the weld defect region. The method has the advantages of low complexity and high recognition speed, and can effectively improve the anti-interference capability of the weld defect recognition.

Description

Method for automatically enhancing and identifying weld defects based on magneto-optical imaging
Technical Field
The invention belongs to the technical field of nondestructive testing, and particularly relates to a method for automatically enhancing and identifying weld defects based on magneto-optical imaging.
Background
The processing of ferromagnetic materials is the foundation of modern industry and has been widely applied to the fields of metallurgical energy, automation, mechanical automobiles, railways, bridges, petrochemical industry and the like, so that the detection of equipment related to ferromagnetic materials has very important significance for the development of modern industry. During and before the ferromagnetic material is welded, failure or aging inevitably occurs, wherein the weld joint is most susceptible to defects and damage.
When the current mainstream nondestructive testing technology is applied to the detection of the defects of the welding seams of ferromagnetic workpieces, the problems of weaker signal correlation, poorer resolution, poorer anti-interference capability, complex data visualization processing algorithm and poorer detection effect on the defects of the welding seams exist. The magneto-optical imaging nondestructive testing technology is a magnetic leakage signal detection technology based on a novel sensor, and through converting magnetic field information into luminosity information, the visual detection of defects can be realized without complex data processing, the resolution ratio of detection is high, the correlation among single image pixel points is strong, the magneto-optical imaging nondestructive testing technology can be applied to the nondestructive testing of ferromagnetic materials, and the magneto-optical imaging nondestructive testing technology also has strong applicability to weld joint detection.
The current defect identification methods aiming at magneto-optical images are few, and mainly comprise a principal component analysis method, an adaptive threshold segmentation method and the like, the magneto-optical image processing methods are usually only used for carrying out characteristic analysis and target identification on a single image and a single defect, the experimental conditions are ideal, the magneto-optical detection working condition of a welding line is complex, various interference conditions such as welding line height, sensor lift-off and defect direction exist, the purpose of identifying the defect cannot be achieved through simple image characteristics such as gray value characteristics and gradient characteristics, and the complex image processing mode cannot meet the requirement of online detection.
Disclosure of Invention
The invention aims to overcome the defects of the prior art, provides an online automatic weld defect enhancing and identifying method based on magneto-optical imaging, identifies the magneto-optical image defects according to the leakage magnetic field characteristics of the weld defects, has low algorithm complexity and high identification speed, and can effectively improve the anti-interference capability of weld defect identification.
In order to realize the aim, the online automatic enhancement and identification method for the weld defects based on magneto-optical imaging comprises the following steps:
s1: obtaining a magneto-optical image of a welding line by using a magneto-optical detector, enabling the direction of a magnetic induction line of magneto-optical imaging to be the horizontal direction of the magneto-optical image, and recording the magneto-optical image as X:
Figure GDA0003593971090000021
wherein x ismnThe gray value of the pixel point at the mth row and the nth column in the magneto-optical image X is represented, wherein M is 1,2, …, M, N is 1,2, …, N, and M × N is the size of the magneto-optical image X;
s2: making the row sequence number m equal to 1;
s3: scanning N pixel points in the mth row of the magneto-optical image X, namely sequentially solving the mean value p of the gray values of the pixel points in a window with each pixel point as a central point and the side length as Wm,nThe value of W is determined according to actual conditions, and the mean value sequence P corresponding to the mth row is obtainedm=[pm,1,pm,2,…,pm,N]Then the mean sequence P is obtainedmThe extreme points are arranged in ascending order according to the corresponding row serial numbers, and the extreme point sequence is recorded
Figure GDA0003593971090000022
sm,kRepresents a mean sequence PmK is 1,2, …, Km,KmRepresents a mean sequence PmThe number of extreme points in;
s4: in the extreme points obtained in step S3, the maximum point is selected as the peak extreme point A of the mth rowm
S5: peak extreme point AmAs starting points, respectively to extreme point sequences SmSearching in the middle and left and right directions to obtain the extreme point of the alternative valley on the right side
Figure GDA0003593971090000023
And left alternative trough extreme points
Figure GDA0003593971090000024
The searching method comprises the following steps:
1) initialization starting point R ═ amInitializing a wave trough extreme point B ═ R, and initializing an extreme point sequence
Figure GDA0003593971090000025
2) Presetting a spacing threshold u, and setting a current extreme point sequence
Figure GDA0003593971090000026
Deleting the trough extreme point with the distance from the R point smaller than the threshold value u;
3) when towards peak extreme point AmRight side searchDuring searching, selecting a trough extreme point B which is closest to the row serial number of the R point from trough extreme points with the row serial numbers larger than the R point;
when towards peak extreme point AmWhen searching for the left side, selecting a trough extreme point B which is closest to the row sequence number of the R point from trough extreme points with the row sequence numbers smaller than the R point;
4) if the trough extreme point B exists, entering the step 5), otherwise, entering the step 7);
5) from the mean sequence PmObtaining the values of the trough extreme point B and the trough extreme point R, if the value of the trough extreme point B is less than or equal to the value of the trough extreme point R, entering the step 6), and if not, entering the step 7);
6) updating the starting point R ═ B, and returning to the step 2);
7) when towards peak extreme point AmWhen searching for the right side, the current valley extreme point B is taken as the right side alternative valley extreme point of the defect
Figure GDA0003593971090000031
When towards peak extreme point AmWhen searching for the left side, the current trough extreme point B is taken as the left side alternative trough extreme point of the defect
Figure GDA0003593971090000032
S6: respectively using the alternative trough extreme points on the right side
Figure GDA0003593971090000033
And left alternative trough extreme points
Figure GDA0003593971090000034
As a starting point, continuously searching to obtain an extreme point of the alternative peak on the right side
Figure GDA0003593971090000035
And left alternative peak extreme point
Figure GDA0003593971090000036
The searching method comprises the following steps:
1) initialization starting point
Figure GDA0003593971090000037
Or
Figure GDA0003593971090000038
Initializing the next peak extreme point C-R', and initializing the extreme point sequence
Figure GDA0003593971090000039
2) At the current extreme point sequence
Figure GDA00035939710900000310
Deleting the trough extreme point with the distance from the R' point smaller than the threshold u;
3) when the starting point is the right alternative trough extreme point
Figure GDA00035939710900000311
Then searching to the right, and selecting a peak extreme point C which is closest to the row number of the R 'point from the trough extreme points with the row numbers larger than the R' point;
when the starting point is the left alternative trough extreme point
Figure GDA00035939710900000312
Searching leftwards, and selecting a peak extreme point C which is closest to the row number of the R 'point from the trough extreme points with the row number smaller than the R' point;
4) if the peak extreme point C exists, entering the step 5), otherwise, entering the step 7);
5) from the mean sequence PmObtaining the values of the peak extreme point C and the R ', if the value of the peak extreme point C is more than or equal to the value of the R', entering the step 6), otherwise, entering the step 7);
6) updating the starting point R' ═ C, and returning to the step 2);
7) when the starting point is the right alternative trough extreme point
Figure GDA00035939710900000313
Taking the current peak extreme point C as the right candidate peak extreme point of the defect
Figure GDA00035939710900000314
When the starting point is the left alternative trough extreme point
Figure GDA00035939710900000315
Taking the current peak extreme point C as the left candidate peak extreme point of the defect
Figure GDA00035939710900000316
S7: calculating to obtain a peak extreme point AmAnd right alternative trough extreme points
Figure GDA00035939710900000317
Is a distance of
Figure GDA00035939710900000318
Calculating to obtain the extreme point of the alternative wave trough on the right side
Figure GDA00035939710900000319
And alternative peak extreme points on the right
Figure GDA00035939710900000320
Is a distance of
Figure GDA00035939710900000321
Then calculating to obtain the distance difference value
Figure GDA00035939710900000322
Calculating to obtain a peak extreme point AmAnd left alternative trough extreme points
Figure GDA00035939710900000323
Is a distance of
Figure GDA00035939710900000324
Calculating to obtain the extreme point of the alternative wave trough on the left side
Figure GDA00035939710900000325
And left alternative peak extreme point
Figure GDA00035939710900000326
Is a distance of
Figure GDA00035939710900000327
Then calculating to obtain the distance difference value
Figure GDA00035939710900000328
When Δright≤ΔleftAnd the alternative peak extreme point on the right side
Figure GDA00035939710900000329
Is greater than or equal to the left alternative peak extreme point
Figure GDA0003593971090000041
The peak extreme point A is obtainedmAnd alternative peak extreme points on the right
Figure GDA0003593971090000042
The area in between is used as a defect extreme value area; when deltaright>ΔleftAnd the alternative peak extreme point on the right side
Figure GDA0003593971090000043
Is less than the left alternative peak extreme point
Figure GDA0003593971090000044
If so, the left alternative peak extreme point is set
Figure GDA0003593971090000045
And peak extreme point AmThe area between the two is used as a defect extreme value area; if the other conditions are not met, all the pixel points in the mth row are not in the defect extreme value area;
s8: judging whether M is less than M, if so, entering step S9, otherwise, entering step S10;
s9: returning to step S3 when m is equal to m + 1;
s10: and taking the pixel points in the defect extreme value region obtained from each row in the magneto-optical image as target pixel points of the weld defect, and obtaining a connected domain to obtain a weld defect region.
The invention relates to a magneto-optical imaging-based on-line automatic weld defect enhancing and identifying method, which comprises the steps of obtaining a magneto-optical image of a weld defect by using a magneto-optical detector, enabling the magnetic induction line direction of magneto-optical imaging to be the horizontal direction of the magneto-optical image, detecting a defect extreme value region by traversing each row of the magneto-optical image, taking pixel points in the defect extreme value region obtained by each row of the magneto-optical image as target pixel points of the weld defect, and obtaining a weld defect region by obtaining a connected domain.
The invention has the following beneficial effects:
1) the method only traverses the time complexity of O (1) to the magneto-optical image, so that the identification speed is high;
2) the method is mainly based on the calculation of the defect leakage magnetic field characteristics, and only the target leakage magnetic field characteristics can be detected, so that the anti-interference capability is strong;
2) when the connected domain is obtained, the size of the structural element can be adaptively changed according to the distribution characteristics of the leakage magnetic field of the defect, and the magneto-optical image with less defect information (such as the lift-off degree of 3mm) is also well enhanced.
Drawings
FIG. 1 is a flow chart of an embodiment of the method for automatically enhancing and identifying weld defects based on magneto-optical imaging according to the present invention;
FIG. 2 is a magneto-optical image of the weld in this embodiment;
FIG. 3 is a schematic illustration of scanning a line of a magneto-optical image in accordance with the present invention;
FIG. 4 is a flowchart of the method for obtaining the extreme point of the mean sequence based on the peak-trough algorithm in this embodiment;
FIG. 5 is a schematic diagram of extreme points obtained by obtaining extreme points of a mean sequence based on a peak-trough algorithm in the present embodiment;
fig. 6 is a defect extremum region identification diagram of the magneto-optical image in the present embodiment;
FIG. 7 is a flowchart of finding connected components in the present embodiment;
fig. 8 is a magneto-optical image obtained by bottom-cap filtering in the present embodiment.
Detailed Description
The following description of the embodiments of the present invention is provided in order to better understand the present invention for those skilled in the art with reference to the accompanying drawings. It is to be expressly noted that in the following description, a detailed description of known functions and designs will be omitted when it may obscure the subject matter of the present invention.
Examples
FIG. 1 is a flow chart of an embodiment of the method for automatically enhancing and identifying the weld defects based on magneto-optical imaging. As shown in FIG. 1, the method for automatically enhancing and identifying the weld defects based on magneto-optical imaging comprises the following specific steps:
s101: acquiring a magneto-optical image:
utilizing a magneto-optical detector to obtain a magneto-optical image of a welding seam, enabling the direction of magnetic induction lines of magneto-optical imaging to be the horizontal direction of the magneto-optical image, and recording the magneto-optical image as X:
Figure GDA0003593971090000051
wherein x ismnThe gray scale value of the pixel point at the mth row and the nth column in the magneto-optical image X is represented, where M is 1,2, …, M, N is 1,2, …, N, and mxn is the size of the magneto-optical image X.
When the magneto-optical detector is used for detecting the welding seam, the magnetic induction intensity of the defect leakage magnetic field of the welding seam is converted into luminous flux through the magneto-optical rotation effect of the magneto-optical sensor in the magneto-optical detector, and therefore the distribution characteristic of the defect leakage magnetic field is reflected on a magneto-optical image through the light intensity. Fig. 2 is a magneto-optical image of the weld seam in this embodiment. The magneto-optical image in this embodiment is set to an 8-level gray scale image. As shown in FIG. 2, the weld in this embodiment is about 21mT, and a crack is present at the weld. Because the direction of the magnetic induction line of the magneto-optical imaging is the horizontal direction of the magneto-optical image, the magneto-optical image reflects the vertical component characteristics of an infinite number of magnetic induction lines passing through the sensor according to the magneto-optical imaging principle, so that the line vector of the magneto-optical image X reflects the vertical component characteristics of the magnetic induction line of the leakage field of the weld defect, and the weld defect can be automatically enhanced and identified by analyzing the magneto-optical image X.
For ease of subsequent processing, some pre-processing may be performed on the resulting magneto-optical image X. The preprocessing of the magneto-optical image X in this embodiment is adaptive median filtering to remove low-frequency noise (air magnetic field, ambient light, magnetic domain wall interference) in the magneto-optical image. Adaptive median filtering is a common image processing method, and the detailed process thereof is not described herein.
S102: let the row sequence number m be 1.
S103: and (3) calculating an extreme point:
scanning N pixel points in the mth row of the magneto-optical image X, namely sequentially solving the mean value p of the gray values of the pixel points in a window with each pixel point as a central point and the side length as Wm,nThe value of W is determined according to actual conditions, and the mean value sequence P corresponding to the mth row is obtainedm=[pm,1,pm,2,…,pm,N]Then the mean sequence P is obtainedmThe extreme points are arranged in ascending order according to the corresponding row serial numbers, and the extreme point sequence is recorded
Figure GDA0003593971090000061
sm,kRepresents the mean sequence PmK is 1,2, …, Km,KmRepresents a mean sequence PmNumber of extreme points in.
By calculating the average sequence, the error when obtaining the extreme point can be effectively inhibited. Fig. 3 is a schematic diagram of scanning a line of a magneto-optical image in accordance with the present invention. As shown in fig. 3, in this embodiment, the side length W of the window is 3, the entire row of pixel points of the magneto-optical image is traversed from left to right, and the average value of each window is obtained to obtain an average value sequence P with the length Nm
In this embodiment, the extreme point of the mean sequence is obtained based on the peak-to-valley algorithm. Fig. 4 is a flowchart of the method for obtaining the extreme point of the mean sequence based on the peak-valley algorithm in this embodiment. As shown in fig. 4, the specific steps of obtaining the extreme point of the mean sequence based on the peak-to-valley algorithm in this embodiment include:
s401: obtaining a difference sequence:
to mean value sequence Pm=[pm,1,pm,2,…,pm,N]Difference is carried out to obtain a difference sequence
Figure GDA0003593971090000062
Wherein
Figure GDA0003593971090000063
Differential sequence
Figure GDA0003593971090000064
Value of each element in
Figure GDA0003593971090000065
Can be divided into three types of more than 0, equal to 0 and less than 0.
S402: differential data identification:
since the point at which the difference is zero is not necessarily an extreme point, possibly two adjacent points having the same amplitude value, the difference sequence is traversed again
Figure GDA0003593971090000066
Identifying the difference data to filter out zero data which are not extreme points, i.e. according to the difference sequence
Figure GDA0003593971090000067
Obtaining the sequence
Figure GDA0003593971090000068
Wherein each element tm,n′The calculation formula of (a) is as follows:
Figure GDA0003593971090000071
s403: determining an extreme point:
for sequence Tm=[tm,1,tm,2,…,tm,N-1]Difference is carried out to obtain a sequence
Figure GDA0003593971090000072
Wherein
Figure GDA0003593971090000073
Traversal sequence
Figure GDA0003593971090000074
When in use
Figure GDA0003593971090000075
When it is, then pm,n″+1Is a mean value sequence PmA maximum point of; when in use
Figure GDA0003593971090000076
When it is, then pm,n″+1Is a mean value sequence PmMinimum value point in (c).
Fig. 5 is a schematic diagram of extreme points obtained by obtaining the extreme points of the mean sequence based on the peak-valley algorithm in this embodiment. As shown in fig. 5, the point marked by the star symbol is the point with the difference data of 0 in step S401, and the point marked by the letter is the extreme point finally screened out.
S104: selecting a peak extreme point:
as can be seen from the principle of magneto-optical imaging, one of the two peak extreme points generated by the defect must be the mean value sequence PmThe maximum point of (d). Therefore, in the extreme points obtained in step S103, the maximum point is selected as the peak extreme point A of the mth rowm
S105: searching trough extreme points:
peak extreme point AmAs starting points, respectively to extreme point sequences SmSearching in the middle and left and right directions to obtain the extreme point of the alternative valley on the right side
Figure GDA0003593971090000077
And left alternative trough extreme points
Figure GDA0003593971090000078
The searching method comprises the following steps:
1) initialization starting point R ═ amInitializing a wave trough extreme point B ═ R, and initializing an extreme point sequence
Figure GDA0003593971090000079
2) Removing noise extreme points:
since the noise points generate extremely small intervals, the noise extreme points can be eliminated by setting an interval threshold. The specific method comprises the following steps: presetting a spacing threshold u at the current extreme point sequence
Figure GDA00035939710900000710
The trough extreme point which is less than the threshold value u away from the R point is deleted.
3) Obtaining the nearest trough extreme point:
when towards peak extreme point AmWhen searching on the right side, selecting a trough extreme point B which is closest to the row sequence number of the R point from trough extreme points with the row sequence numbers larger than the R point;
when towards peak extreme point AmWhen searching for the left side, the trough extreme point B closest to the row number of the R point is selected from the trough extreme points with the row numbers smaller than the R point.
4) If the valley extreme point B exists, the step 5) is carried out, if the extreme point sequence at the moment is ended, the valley extreme point which is the closest to the sequence number of the R point sequence does not exist, the step 7) is carried out.
5) Sequence of mean values PmAnd obtaining the values of the trough extreme point B and the R point, if the value of the trough extreme point B is less than or equal to the value of the R point, entering the step 6), and otherwise, entering the step 7).
6) Update the starting point R ═ B, return to step 2).
7) Determining an alternative defect valley extreme point:
when towards peak extreme point AmWhen searching for the right side, the current valley extreme point B is taken as the right side alternative valley extreme point of the defect
Figure GDA0003593971090000081
When towards peak extreme point AmWhen searching for the left side, the current trough extreme point B is taken as the left side alternative trough extreme point of the defect
Figure GDA0003593971090000082
S106: searching the next peak extreme point:
respectively using the alternative trough extreme points on the right side
Figure GDA0003593971090000083
And left alternative trough extreme points
Figure GDA0003593971090000084
As a starting point, continuously searching to obtain an extreme point of a right alternative peak
Figure GDA0003593971090000085
And left alternative peak extreme point
Figure GDA0003593971090000086
The searching method comprises the following steps:
1) initialization starting point
Figure GDA0003593971090000087
Or
Figure GDA0003593971090000088
Initializing the next peak extreme point C-R', and initializing the extreme point sequence
Figure GDA0003593971090000089
2) Removing noise extreme points:
likewise, noise extrema are eliminated through the distance threshold, namely, in the current extrema sequence
Figure GDA00035939710900000810
And deleting the trough extreme point which is less than the threshold value u away from the R' point.
3) Obtaining the nearest peak extreme point:
when the starting point is the right alternative trough extreme point
Figure GDA00035939710900000811
Then, the peak extreme point C is selected from the maximum points having a column number greater than that of the R' point.
When the starting point is the left alternative trough extreme point
Figure GDA00035939710900000812
Then, the peak extreme point C is selected from the maximum points with the column numbers smaller than the R' point.
4) And if the peak extreme point C exists, entering the step 5), and if the extreme point sequence at the moment is up and the peak extreme point with the most similar sequence number to the R' point sequence does not exist, entering the step 7).
5) From the mean sequence PmAnd obtaining the values of the peak extreme point C and the R 'point, if the value of the peak extreme point C is more than or equal to the value of the R' point, entering the step 6), and if not, entering the step 7).
6) Update the starting point R' ═ C, return to step 2).
7) Determining an extreme point of a peak of the alternative defect:
when the starting point is the right alternative trough extreme point
Figure GDA00035939710900000813
Taking the current peak extreme point C as the right candidate peak extreme point of the defect
Figure GDA00035939710900000814
When the starting point is the left alternative trough extreme point
Figure GDA00035939710900000815
Taking the current peak extreme point C as the left candidate peak extreme point of the defect
Figure GDA00035939710900000816
S107: determining a defect extremum region:
calculating to obtain a peak extreme point AmAnd right alternative trough extreme points
Figure GDA0003593971090000091
Is a distance of
Figure GDA0003593971090000092
Calculating to obtain the extreme point of the alternative wave trough on the right side
Figure GDA0003593971090000093
And alternative peak extreme points on the right
Figure GDA0003593971090000094
Is a distance of
Figure GDA0003593971090000095
Then calculating to obtain the distance difference value
Figure GDA0003593971090000096
Calculating to obtain a peak extreme point AmAnd left alternative trough extreme points
Figure GDA0003593971090000097
Is a distance of
Figure GDA0003593971090000098
Calculating to obtain the extreme point of the alternative wave trough on the left side
Figure GDA0003593971090000099
And left alternative peak extreme point
Figure GDA00035939710900000910
Is a distance of
Figure GDA00035939710900000911
Then calculating to obtain the distance difference value
Figure GDA00035939710900000912
When deltaright≤ΔleftAnd the alternative peak extreme point on the right side
Figure GDA00035939710900000913
Is greater than or equal to the left alternative peak extreme point
Figure GDA00035939710900000914
The peak extreme point A is obtainedmAnd alternative peak extreme points on the right
Figure GDA00035939710900000915
The area in between is used as a defect extreme value area; when deltaright>ΔleftAnd the alternative peak extreme point on the right side
Figure GDA00035939710900000916
Is less than the left alternative peak extreme point
Figure GDA00035939710900000917
If so, the left alternative peak extreme point is set
Figure GDA00035939710900000918
And peak extreme point AmThe area in between is used as a defect extreme value area; and under other conditions, all pixel points in the mth row are not the defect extremum area.
S108: and judging whether M is less than M, if so, entering step S109, and otherwise, entering step S110.
S109: let m be m +1, return to step S103.
And traversing each row of data in the magneto-optical image to obtain the defect extreme value area of each row. Fig. 6 is a defect extremum region identification diagram of the magneto-optical image in the present embodiment.
S110: obtaining a weld defect area:
and taking the pixel points in the defect extreme value region obtained from each row in the magneto-optical image as target pixel points of the weld defect, and obtaining a connected domain to obtain a weld defect region.
Fig. 7 is a flowchart of finding connected components in the present embodiment. As shown in fig. 7, the finding of the connected component in this embodiment specifically includes the following steps:
s701: opening operation:
and opening the magneto-optical image of the target pixel point with the determined weld defect by using the matrix window with the side length of W as a structural element.
The opening operation can break the narrow neck with less pixel points in the image and eliminate the salient with less pixel points, and can smooth and restrain the peak noise of the image and eliminate the scattered points and burrs of the image. The open operation is a common operation in image processing, and the specific process thereof is not described herein again.
S702: bottom-cap filtering:
traversing each row of defect extremum regions in the magneto-optical image, obtaining the length of each row of defect extremum regions (namely the distance between two wave crests), recording the number of rows of defect extremum regions in the magneto-optical image as M ', obtaining the mean value D of the lengths of the defect extremum regions in the M' rows, and performing bottom-cap filtering on the magneto-optical image after the opening operation by adopting matrix structural elements with the size of 1 x (D/3).
The bottom-hat filtering can highlight dark targets under a bright background and bright backgrounds near the dark targets, if the size of structural elements of the bottom-hat filtering is too large, noise is introduced, and if the size is too large, target information cannot be acquired. In the embodiment, the size of the structural element during bottom-hat filtering is adaptively determined through the length of the defect extreme value region, so that a good effect can be obtained. Bottom-hat filtering is a common operation in image processing, and the specific process thereof is not described herein again.
S703: and (3) connected domain processing:
and carrying out eight-connected domain processing on the magneto-optical image after bottom-cap filtering to obtain a maximum connected domain area, namely a weld joint target defect area.
Fig. 8 is a magneto-optical image obtained by bottom-cap filtering in the present embodiment. As shown in fig. 8, after bottom-cap filtering, automatic enhancement is performed on the weld defects, and then further connected domain processing is performed, so that a final weld target defect region identification result can be obtained. Therefore, the automatic enhancement and identification of the weld defects can be effectively realized by adopting the method.
Although illustrative embodiments of the present invention have been described above to facilitate the understanding of the present invention by those skilled in the art, it should be understood that the present invention is not limited to the scope of the embodiments, and various changes may be made apparent to those skilled in the art as long as they are within the spirit and scope of the present invention as defined and defined by the appended claims, and all matters of the invention which utilize the inventive concepts are protected.

Claims (4)

1. A method for automatically enhancing and identifying weld defects based on magneto-optical imaging is characterized by comprising the following steps:
s1: obtaining a magneto-optical image of a welding line by using a magneto-optical detector, enabling the direction of a magnetic induction line of magneto-optical imaging to be the horizontal direction of the magneto-optical image, and recording the magneto-optical image as X:
Figure FDA0003593971080000011
wherein x ismnThe gray value of the pixel point at the mth row and the nth column in the magneto-optical image X is represented, wherein M is 1,2, …, M, N is 1,2, …, N, and M × N is the size of the magneto-optical image X;
s2: making the row sequence number m equal to 1;
s3: scanning N pixel points in the mth row of the magneto-optical image X, namely sequentially solving the mean value p of the gray values of the pixel points in a window with each pixel point as a central point and the side length as Wm,nThe value of W is determined according to actual conditions, and the mean value sequence P corresponding to the mth row is obtainedm=[pm,1,pm,2,…,pm,N]Then the mean sequence P is obtainedmThe extreme points are arranged in ascending order according to the corresponding row serial numbers, and the extreme point sequence is recorded
Figure FDA0003593971080000012
sm,kRepresents a mean sequence PmK is 1,2, …, Km,KmRepresents a mean sequence PmThe number of extreme points in;
s4: in the extreme points obtained in step S3, the maximum point is selected as the peak extreme point A of the mth rowm
S5: peak extreme point AmAs starting points, respectively to the extreme point sequence SmSearching in the middle and left and right directions to obtain the extreme point of the alternative valley on the right side
Figure FDA0003593971080000013
And left alternative trough extreme points
Figure FDA0003593971080000014
The searching method comprises the following steps:
1) initialization starting point R ═ amInitializing a wave trough extreme point B ═ R, and initializing an extreme point sequence
Figure FDA0003593971080000015
2) Presetting a spacing threshold u, and setting a current extreme point sequence
Figure FDA0003593971080000016
Deleting the trough extreme point with the distance from the R point smaller than the threshold value u;
3) when towards peak extreme point AmWhen searching on the right side, selecting a trough extreme point B which is closest to the row sequence number of the R point from trough extreme points with the row sequence numbers larger than the R point;
when towards peak extreme point AmWhen searching for the left side, selecting a trough extreme point B which is closest to the row sequence number of the R point from trough extreme points with the row sequence numbers smaller than the R point;
4) if the trough extreme point B exists, entering the step 5), otherwise, entering the step 7);
5) from the mean sequence PmObtaining the values of the trough extreme point B and the trough extreme point R, if the trough extreme pointIf the value of the value point B is less than or equal to the value of the value point R, the step 6) is carried out, otherwise, the step 7) is carried out;
6) updating the starting point R ═ B, and returning to the step 2);
7) when towards peak extreme point AmWhen searching for the right side, the current valley extreme point B is taken as the right side alternative valley extreme point of the defect
Figure FDA0003593971080000021
When towards peak extreme point AmWhen searching for the left side of the defect, the current trough extreme point B is taken as the left side alternative trough extreme point of the defect
Figure FDA0003593971080000022
S6: respectively using the alternative trough extreme points on the right side
Figure FDA0003593971080000023
And left alternative trough extreme points
Figure FDA0003593971080000024
As a starting point, continuously searching to obtain an extreme point of the alternative peak on the right side
Figure FDA0003593971080000025
And left alternative peak extreme point
Figure FDA0003593971080000026
The searching method comprises the following steps:
1) initialization starting point
Figure FDA0003593971080000027
Or
Figure FDA0003593971080000028
Initializing the next peak extreme point C-R', and initializing the extreme point sequence
Figure FDA0003593971080000029
2) At the current extreme point sequence
Figure FDA00035939710800000210
Deleting the trough extreme point with the distance from the R' point smaller than the threshold value u;
3) when the starting point is the right alternative trough extreme point
Figure FDA00035939710800000211
Then searching to the right, and selecting a peak extreme point C which is closest to the row number of the R 'point from the trough extreme points with the row numbers larger than the R' point;
when the starting point is the left alternative trough extreme point
Figure FDA00035939710800000212
Searching leftwards, and selecting a peak extreme point C which is closest to the row number of the R 'point from the trough extreme points with the row number smaller than the R' point;
4) if the peak extreme point C exists, entering the step 5), otherwise, entering the step 7);
5) from the mean sequence PmObtaining the values of the peak extreme point C and the R ', if the value of the peak extreme point C is more than or equal to the value of the R', entering the step 6), otherwise, entering the step 7);
6) updating the starting point R' ═ C, and returning to the step 2);
7) when the starting point is the right alternative trough extreme point
Figure FDA00035939710800000213
Taking the current peak extreme point C as the right candidate peak extreme point of the defect
Figure FDA00035939710800000214
When the starting point is the left alternative trough extreme point
Figure FDA00035939710800000215
Taking the current peak extreme point C as the left side of the defectAlternative peak extreme points
Figure FDA00035939710800000216
S7: calculating to obtain a peak extreme point AmAnd right alternative trough extreme points
Figure FDA00035939710800000217
Is a distance of
Figure FDA00035939710800000218
Calculating to obtain the extreme point of the alternative wave trough on the right side
Figure FDA00035939710800000219
And alternative peak extreme points on the right
Figure FDA00035939710800000220
Is a distance of
Figure FDA00035939710800000221
Then calculating to obtain the distance difference value
Figure FDA00035939710800000222
Calculating to obtain a peak extreme point AmAnd left alternative trough extreme points
Figure FDA00035939710800000223
Is a distance of
Figure FDA00035939710800000224
Calculating to obtain the extreme point of the alternative wave trough on the left side
Figure FDA00035939710800000225
And left alternative peak extreme point
Figure FDA00035939710800000226
Is a distance of
Figure FDA00035939710800000227
Then calculating to obtain the distance difference value
Figure FDA00035939710800000228
When deltaright≤ΔleftAnd the alternative peak extreme point on the right side
Figure FDA0003593971080000031
Is greater than or equal to the left alternative peak extreme point
Figure FDA0003593971080000032
The peak extreme point A is obtainedmAnd alternative peak extreme points on the right
Figure FDA0003593971080000033
The area in between is used as a defect extreme value area; when deltaright>ΔleftAnd the alternative peak extreme point on the right side
Figure FDA0003593971080000034
Is less than the left alternative peak extreme point
Figure FDA0003593971080000035
If so, the left alternative peak extreme point is set
Figure FDA0003593971080000036
And peak extreme point AmThe area in between is used as a defect extreme value area; if the other conditions are not met, all the pixel points in the mth row are not in the defect extreme value area;
s8: judging whether M is less than M, if so, entering step S9, otherwise, entering step S10;
s9: returning to step S3 when m is equal to m + 1;
s10: and taking the pixel points in the defect extreme value region obtained from each row in the magneto-optical image as target pixel points of the weld defect, and obtaining a connected domain to obtain a weld defect region.
2. The method for automatically enhancing and identifying weld defects according to claim 1, wherein the step S1 further comprises performing adaptive median filtering on the acquired magneto-optical image X.
3. The method for automatically enhancing and identifying the weld defects according to claim 1, wherein the step S3 of finding the extreme points of the mean sequence based on the peak-valley algorithm comprises the following steps:
s3.1: to mean value sequence Pm=[pm,1,pm,2,…,pm,N]Carrying out difference to obtain a difference sequence
Figure FDA0003593971080000037
Wherein
Figure FDA0003593971080000038
S3.2: according to a difference sequence
Figure FDA0003593971080000039
Obtaining the sequence Tm=[tm,1,tm,2,…,tm,N-1]Wherein each element tm,n′The calculation formula of (a) is as follows:
Figure FDA00035939710800000310
s3.3: for sequence Tm=[tm,1,tm,2,…,tm,N-1]Difference is carried out to obtain a sequence
Figure FDA00035939710800000311
Wherein
Figure FDA00035939710800000312
Traversal orderColumn(s) of
Figure FDA00035939710800000313
When in use
Figure FDA00035939710800000314
When it is, then pm,n″+1Is a mean value sequence PmA maximum point of; when in use
Figure FDA00035939710800000315
When it is, then pm,n″+1Is a mean value sequence PmMinimum value point in (c).
4. The method for automatically enhancing and identifying the weld defects according to claim 1, wherein the specific method for finding the connected domain in the step S10 comprises the following steps:
s10.1: adopting a matrix window with the side length W as a structural element, and opening a magneto-optical image of a target pixel point with a determined weld defect;
s10.2: traversing each row of defect extremum regions in the magneto-optical image, obtaining the length of each row of defect extremum regions, recording the number of rows of defect extremum regions in the magneto-optical image as M ', obtaining an average value D of the lengths of the defect extremum regions in the M' rows, and performing bottom-cap filtering on the magneto-optical image after the opening operation by adopting matrix structural elements with the size of 1 x (D/3);
s10.3: and carrying out eight-connected domain processing on the magneto-optical image after bottom-cap filtering to obtain a maximum connected domain area, namely a weld joint target defect area.
CN202110659599.XA 2021-06-15 2021-06-15 Method for automatically enhancing and identifying weld defects based on magneto-optical imaging Active CN113393440B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110659599.XA CN113393440B (en) 2021-06-15 2021-06-15 Method for automatically enhancing and identifying weld defects based on magneto-optical imaging

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110659599.XA CN113393440B (en) 2021-06-15 2021-06-15 Method for automatically enhancing and identifying weld defects based on magneto-optical imaging

Publications (2)

Publication Number Publication Date
CN113393440A CN113393440A (en) 2021-09-14
CN113393440B true CN113393440B (en) 2022-06-14

Family

ID=77621030

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110659599.XA Active CN113393440B (en) 2021-06-15 2021-06-15 Method for automatically enhancing and identifying weld defects based on magneto-optical imaging

Country Status (1)

Country Link
CN (1) CN113393440B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114638805B (en) * 2022-03-21 2024-06-14 武汉纵横天地空间信息技术有限公司 Track slab crack detection method, system and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105372324A (en) * 2015-12-07 2016-03-02 电子科技大学 Defect detection method based on magnetooptical imaging
CN107993225A (en) * 2017-11-28 2018-05-04 电子科技大学 A kind of recognition methods of the defects of magneto-optic vortex imaging detection
CN109839433A (en) * 2019-02-22 2019-06-04 四川莱威盛世科技有限公司 Metallic conduit defect location detection device and method based on collection magnetic surface scanning

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4810420B2 (en) * 2006-02-24 2011-11-09 キヤノン株式会社 Image processing apparatus, image processing method, server, control method therefor, program, and storage medium
CN105181786A (en) * 2015-07-16 2015-12-23 宁波市鄞州磁泰电子科技有限公司 Weld defect magnetic detection method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105372324A (en) * 2015-12-07 2016-03-02 电子科技大学 Defect detection method based on magnetooptical imaging
CN107993225A (en) * 2017-11-28 2018-05-04 电子科技大学 A kind of recognition methods of the defects of magneto-optic vortex imaging detection
CN109839433A (en) * 2019-02-22 2019-06-04 四川莱威盛世科技有限公司 Metallic conduit defect location detection device and method based on collection magnetic surface scanning

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于低频正交激励的磁光成像缺陷检测研究;张杰;《万方数据学位论文全文数据库》;20190916;正文第50-63页 *

Also Published As

Publication number Publication date
CN113393440A (en) 2021-09-14

Similar Documents

Publication Publication Date Title
CN113362326B (en) Method and device for detecting defects of welding spots of battery
CN114943739B (en) Aluminum pipe quality detection method
CN115063423B (en) Self-adaptive identification method for cold and hot cracks of mechanical castings based on computer vision
CN107993225B (en) Defect identification method for magneto-optical eddy current imaging detection
CN115684176B (en) Online visual detection system for film surface defects
CN108776964A (en) A kind of ship weld defect image detecting system and method based on Adaboost and Haar features
CN113393440B (en) Method for automatically enhancing and identifying weld defects based on magneto-optical imaging
CN108876771B (en) Undercut welding defect detection method
CN115184380A (en) Printed circuit board welding spot abnormity detection method based on machine vision
CN111638218A (en) Method for detecting surface defects of coating
Fu et al. Research on image-based detection and recognition technologies for cracks on rail surface
KR102242996B1 (en) Method for atypical defects detect in automobile injection products
CN117036259A (en) Metal plate surface defect detection method based on deep learning
CN106404893B (en) A kind of axial direction pipeline magnetic flux leakage defect automatic signal detection method
CN116381053A (en) Ultrasonic detection method and system for welding metal materials
Cao et al. An effective method of wood crack trace and quantity detection based on digital image processing technology
JP2981434B2 (en) Pattern defect detection method and apparatus
CN114972353B (en) Quality evaluation method and system for metal high-pressure special pipe fitting
CN116503359A (en) Road surface crack monitoring method based on road side camera
CN112330633B (en) Jumper wire adhesive tape damage fault image segmentation method based on self-adaptive band-pass filtering
Fan et al. Aging aircraft rivet site inspection using magneto-optic imaging: Automation and real-time image processing
CN112508862B (en) Method for enhancing magneto-optical image of crack by improving GAN
JPH0718811B2 (en) Defect inspection method
JP2686053B2 (en) Defect inspection method by visual inspection
Niu et al. Application of CEM algorithm in the field of tunnel crack identification

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