CN113393440A - 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
CN113393440A
CN113393440A CN202110659599.XA CN202110659599A CN113393440A CN 113393440 A CN113393440 A CN 113393440A CN 202110659599 A CN202110659599 A CN 202110659599A CN 113393440 A CN113393440 A CN 113393440A
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.)
Granted
Application number
CN202110659599.XA
Other languages
Chinese (zh)
Other versions
CN113393440B (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

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Chemical & Material Sciences (AREA)
  • Theoretical Computer Science (AREA)
  • Electrochemistry (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Quality & Reliability (AREA)
  • Power Engineering (AREA)
  • Chemical Kinetics & Catalysis (AREA)
  • Condensed Matter Physics & Semiconductors (AREA)
  • Health & Medical Sciences (AREA)
  • Computer Vision & Pattern Recognition (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 defects and damages are most likely to occur at the weld joint.
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 BDA0003114621310000021
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 BDA0003114621310000026
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 BDA0003114621310000022
And left alternative trough extreme points
Figure BDA0003114621310000023
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 BDA0003114621310000024
2) Presetting a spacing threshold u, and setting a current extreme point sequence
Figure BDA0003114621310000025
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 wave trough extreme point b closest to the row sequence number of the R point from wave 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 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), and otherwise, entering the step 7);
5) from the mean sequence PmObtaining 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), otherwise, 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 BDA0003114621310000031
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 BDA0003114621310000032
S6: is divided intoAlternative trough extreme points on the right side
Figure BDA0003114621310000033
And left alternative trough extreme points
Figure BDA0003114621310000034
As a starting point, continuously searching to obtain an extreme point of the alternative peak on the right side
Figure BDA0003114621310000035
And left alternative peak extreme point
Figure BDA0003114621310000036
The searching method comprises the following steps:
1) initialization starting point
Figure BDA0003114621310000037
Or
Figure BDA0003114621310000038
Initializing the next peak extreme point C-R', and initializing the extreme point sequence
Figure BDA0003114621310000039
2) At the current extreme point sequence
Figure BDA00031146213100000310
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 BDA00031146213100000311
Then searching to the right, and selecting a peak extreme point c 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 BDA00031146213100000312
When it is time, i.e. left search, from column numberSelecting a peak extreme point c which is closest to the sequence number of the R 'point row from the trough extreme points which are 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 '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), 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 BDA00031146213100000313
Taking the current peak extreme point C as the right candidate peak extreme point of the defect
Figure BDA00031146213100000314
When the starting point is the left alternative trough extreme point
Figure BDA00031146213100000315
Taking the current peak extreme point C as the left candidate peak extreme point of the defect
Figure BDA00031146213100000316
S7: calculating to obtain a peak extreme point AmAnd right alternative trough extreme points
Figure BDA00031146213100000317
Is a distance of
Figure BDA00031146213100000318
Calculating to obtain the extreme point of the alternative wave trough on the right side
Figure BDA00031146213100000319
And alternative peak extreme points on the right
Figure BDA00031146213100000320
Is a distance of
Figure BDA00031146213100000321
Then calculating to obtain the distance difference value
Figure BDA00031146213100000322
Calculating to obtain a peak extreme point AmAnd left alternative trough extreme points
Figure BDA00031146213100000323
Is a distance of
Figure BDA00031146213100000324
Calculating to obtain the extreme point of the alternative wave trough on the left side
Figure BDA00031146213100000325
And left alternative peak extreme point
Figure BDA00031146213100000326
Is a distance of
Figure BDA00031146213100000327
Then calculating to obtain the distance difference value
Figure BDA00031146213100000328
When deltaright≤ΔleftAnd the alternative peak extreme point on the right side
Figure BDA00031146213100000329
Is greater than or equal to the left alternative peak extreme point
Figure BDA0003114621310000041
The peak extreme point A is obtainedmAnd alternative peak extreme points on the right
Figure BDA0003114621310000042
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 BDA0003114621310000043
Is less than the left alternative peak extreme point
Figure BDA0003114621310000044
If so, the left alternative peak extreme point is set
Figure BDA0003114621310000045
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.
The invention relates to 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 magnetic induction line direction 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 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 BDA0003114621310000051
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 is set to an 8-level gray scale image in this embodiment. 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 BDA0003114621310000067
sm,kRepresents a 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]Carrying out difference to obtain a difference sequence
Figure BDA0003114621310000061
Wherein
Figure BDA0003114621310000062
N ═ 1,2, …, N-1. Differential sequence
Figure BDA0003114621310000063
Value of each element in
Figure BDA0003114621310000064
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 BDA0003114621310000065
Identifying the difference data to filter out zero data which are not extreme points, i.e. according to the difference sequence
Figure BDA0003114621310000066
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 BDA0003114621310000071
s403: determining an extreme point:
for sequence Tm=[tm,1,tm,2,…,tm,N-1]Difference is carried out to obtain a sequence
Figure BDA0003114621310000072
Wherein
Figure BDA0003114621310000073
N ″, 1,2, …, N-2. Traversal sequence
Figure BDA0003114621310000074
When in use
Figure BDA0003114621310000075
When it is, then pm,n″+1Is a mean value sequence PmA maximum point of; when in use
Figure BDA0003114621310000076
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 BDA0003114621310000077
And left alternative trough extreme points
Figure BDA0003114621310000078
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 BDA0003114621310000079
2) Removing noise extreme points:
since the distance between the extreme points generated by the noise points is extremely small, the extreme points of the noise can be eliminated by setting a distance threshold. The specific method comprises the following steps: presetting a spacing threshold u, and setting a current extreme point sequence
Figure BDA00031146213100000710
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 wave trough extreme point b closest to the row sequence number of the R point from wave 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 whose row numbers are smaller than the R point.
4) If the valley extreme point b exists, entering step 5), if the extreme point sequence is ended at the moment, and the valley extreme point which is the closest to the sequence number of the R point sequence does not exist, entering step 7).
5) From the mean sequence PmAnd acquiring 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) And c, updating the starting point R ═ b, and returning to the step 2).
7) Determining an alternative defect valley extreme point:
when searching to the right side of the peak extreme point A, taking the current valley extreme point B as the right side alternative valley extreme point of the defect
Figure BDA0003114621310000081
When searching to the left side of the peak extreme point A, taking the current valley extreme point B as the left side alternative valley extreme point of the defect
Figure BDA0003114621310000082
S106: searching the next peak extreme point:
respectively using the alternative trough extreme points on the right side
Figure BDA0003114621310000083
And left alternative trough extreme points
Figure BDA0003114621310000084
As a starting point, continuously searching to obtain an extreme point of the alternative peak on the right side
Figure BDA0003114621310000085
And left alternative peak extreme point
Figure BDA0003114621310000086
The searching method comprises the following steps:
1) initialization starting point
Figure BDA0003114621310000087
Or
Figure BDA0003114621310000088
Initializing the next peak extreme point C-R', and initializing the extreme point sequence
Figure BDA0003114621310000089
2) Removing noise extreme points:
likewise, noise extrema are eliminated through the distance threshold, namely, in the current extrema sequence
Figure BDA00031146213100000810
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 BDA00031146213100000811
Then, the peak extreme point c is selected from the maximum points with the column numbers greater than the R' point.
When the starting point is the left alternative trough extreme point
Figure BDA00031146213100000812
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 acquiring the values of the peak extreme point c and the R 'point, and entering the step 6) if the value of the peak extreme point c is greater than or equal to the value of the R' point, or entering the step 7).
6) And c, returning to the 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 BDA00031146213100000813
Taking the current peak extreme point c as the right candidate peak extreme point of the defect
Figure BDA00031146213100000814
When the starting point is the left alternative trough extreme point
Figure BDA00031146213100000815
Taking the current peak extreme point c as the left candidate peak extreme point of the defect
Figure BDA00031146213100000816
S107: determining a defect extremum region:
calculating to obtain a peak extreme point AmAnd right alternative trough extreme points
Figure BDA0003114621310000091
Is a distance of
Figure BDA0003114621310000092
Calculating to obtain the extreme point of the alternative wave trough on the right side
Figure BDA0003114621310000093
And alternative peak extreme points on the right
Figure BDA0003114621310000094
Is a distance of
Figure BDA0003114621310000095
Then calculating to obtain the distance difference value
Figure BDA0003114621310000096
Calculating to obtain a peak extreme point AmAnd left alternative trough extreme points
Figure BDA0003114621310000097
Is a distance of
Figure BDA0003114621310000098
Calculating to obtain the extreme point of the alternative wave trough on the left side
Figure BDA0003114621310000099
And left alternative peak extreme point
Figure BDA00031146213100000910
Is a distance of
Figure BDA00031146213100000911
Then calculating to obtain the distance difference value
Figure BDA00031146213100000912
When deltaright≤ΔleftAnd the alternative peak extreme point on the right side
Figure BDA00031146213100000913
Is greater than or equal to the left alternative peak extreme point
Figure BDA00031146213100000914
The peak extreme point A is obtainedmAnd alternative peak extreme points on the right
Figure BDA00031146213100000915
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 BDA00031146213100000916
Is less than the left alternative peak extreme point
Figure BDA00031146213100000917
If so, the left alternative peak extreme point is set
Figure BDA00031146213100000918
Sum peak extremumPoint 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 bright backgrounds and bright backgrounds near the dark targets, and if the sizes of structural elements of the bottom-hat filtering are too large, noise is introduced, and if the sizes are 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 FDA0003114621300000011
wherein x ismnGray scale value of pixel point at mth row and nth column in magneto-optical image X, M is 1,2, …, MN is 1,2, …, N, 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 FDA0003114621300000012
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 FDA0003114621300000013
And left alternative trough extreme points
Figure FDA0003114621300000014
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 FDA0003114621300000015
2) Presetting a spacing threshold u, and setting a current extreme point sequence
Figure FDA0003114621300000016
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 wave trough extreme point b closest to the row sequence number of the R point from wave 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 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), and otherwise, entering the step 7);
5) from the mean sequence PmObtaining 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), otherwise, entering the step 7);
6) updating the starting point R ═ b, and returning to the step 2);
7) when searching to the right side of the peak extreme point A, taking the current valley extreme point B as the right side alternative valley extreme point of the defect
Figure FDA0003114621300000021
When searching to the left side of the peak extreme point A, taking the current valley extreme point B as the left side alternative valley extreme point of the defect
Figure FDA0003114621300000022
S6: respectively using the alternative trough extreme points on the right side
Figure FDA0003114621300000023
And left alternative trough extreme points
Figure FDA0003114621300000024
As a starting point, continuously searching to obtain an extreme point of the alternative peak on the right side
Figure FDA0003114621300000025
And left alternative peak extreme point
Figure FDA0003114621300000026
The searching method comprises the following steps:
1) initialization starting point
Figure FDA0003114621300000027
Or
Figure FDA0003114621300000028
Initializing the next peak extreme point C-R', and initializing the extreme point sequence
Figure FDA0003114621300000029
2) At the current extreme point sequence
Figure FDA00031146213000000210
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 FDA00031146213000000211
Then searching to the right, and selecting a peak extreme point c 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 FDA00031146213000000212
Searching leftwards, and selecting a peak extreme point c 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 '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), 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 FDA00031146213000000213
Taking the current peak extreme point C as the right candidate peak extreme point of the defect
Figure FDA00031146213000000214
When the starting point is the left alternative trough extreme point
Figure FDA00031146213000000215
Taking the current peak extreme point C as the left candidate peak extreme point of the defect
Figure FDA00031146213000000216
S7: calculating to obtain a peak extreme point AmAnd right alternative trough extreme points
Figure FDA00031146213000000217
Is a distance of
Figure FDA00031146213000000218
Calculating to obtain the extreme point of the alternative wave trough on the right side
Figure FDA00031146213000000219
And alternative peak extreme points on the right
Figure FDA00031146213000000220
Is a distance of
Figure FDA00031146213000000221
Then calculating to obtain the distance difference value
Figure FDA00031146213000000222
Calculating to obtain a peak extreme point AmAnd left side is provided withWave trough extreme point
Figure FDA00031146213000000223
Is a distance of
Figure FDA00031146213000000224
Calculating to obtain the extreme point of the alternative wave trough on the left side
Figure FDA00031146213000000225
And left alternative peak extreme point
Figure FDA00031146213000000226
Is a distance of
Figure FDA00031146213000000227
Then calculating to obtain the distance difference value
Figure FDA00031146213000000228
When deltaright≤ΔleftAnd the alternative peak extreme point on the right side
Figure FDA0003114621300000031
Is greater than or equal to the left alternative peak extreme point
Figure FDA0003114621300000032
The peak extreme point A is obtainedmAnd alternative peak extreme points on the right
Figure FDA0003114621300000033
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 FDA0003114621300000034
Is less than the left alternative peak extreme point
Figure FDA0003114621300000035
If so, the left alternative peak extreme point is set
Figure FDA0003114621300000036
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-trough 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 FDA0003114621300000037
Wherein
Figure FDA0003114621300000038
S3.2: according to a difference sequence
Figure FDA0003114621300000039
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 FDA00031146213000000310
s3.3: for sequence Tm=[tm,1,tm,2,…,tm,N-1]Difference is carried out to obtain a sequence
Figure FDA00031146213000000311
Wherein
Figure FDA00031146213000000312
N ″ -1, 2, …, N-2; traversal sequence
Figure FDA00031146213000000313
When in use
Figure FDA00031146213000000314
When it is, then pm,n+1Is a mean value sequence PmA maximum point of; when in use
Figure FDA00031146213000000315
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 true CN113393440A (en) 2021-09-14
CN113393440B 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)

Cited By (1)

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

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070201767A1 (en) * 2006-02-24 2007-08-30 Shunji Fujita Image processing apparatus, image processing method, and server and control method of the same
CN105372324A (en) * 2015-12-07 2016-03-02 电子科技大学 Defect detection method based on magnetooptical imaging
US20170176391A1 (en) * 2015-07-16 2017-06-22 Ningbo Yinzhou Cital Electronic Technology Co., Ltd. Micro-magnetic Detecting Method and Micro-magnetic Detecting Device
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

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070201767A1 (en) * 2006-02-24 2007-08-30 Shunji Fujita Image processing apparatus, image processing method, and server and control method of the same
US20170176391A1 (en) * 2015-07-16 2017-06-22 Ningbo Yinzhou Cital Electronic Technology Co., Ltd. Micro-magnetic Detecting Method and Micro-magnetic Detecting Device
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
张杰: "基于低频正交激励的磁光成像缺陷检测研究", 《万方数据学位论文全文数据库》 *

Cited By (1)

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

Also Published As

Publication number Publication date
CN113393440B (en) 2022-06-14

Similar Documents

Publication Publication Date Title
CN113362326B (en) Method and device for detecting defects of welding spots of battery
CN115170576B (en) Aluminum pipe surface defect detection method based on machine vision
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
Sharifzadeh et al. Detection of steel defect using the image processing algorithms
CN115684176B (en) Online visual detection system for film surface defects
CN111667470B (en) Industrial pipeline flaw detection inner wall detection method based on digital image
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
CN111638218A (en) Method for detecting surface defects of coating
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
KR20070005968A (en) Method and apparatus for detecting defects of the welded part
Berwo et al. Automotive engine cylinder head crack detection: Canny edge detection with morphological dilation
Cao et al. An effective method of wood crack trace and quantity detection based on digital image processing technology
CN117522778A (en) Hollow brick flaw detection system
CN117036259A (en) Metal plate surface defect detection method based on deep learning
CN114972353B (en) Quality evaluation method and system for metal high-pressure special pipe fitting
JP2981434B2 (en) Pattern defect detection method and apparatus
JPH07333197A (en) Automatic surface flaw detector
Fan et al. Aging aircraft rivet site inspection using magneto-optic imaging: Automation and real-time image processing
JPH0718811B2 (en) Defect inspection method
JP2686053B2 (en) Defect inspection method by visual inspection
JP2847667B2 (en) Foreign matter detection method by image processing
Aoki et al. Intelligent image processing for abstraction and discrimination of defect image in radiographic film

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