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 PDFInfo
- 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
Links
- 230000007547 defect Effects 0.000 title claims abstract description 93
- 238000000034 method Methods 0.000 title claims abstract description 33
- 238000012634 optical imaging Methods 0.000 title claims abstract description 22
- 230000002708 enhancing effect Effects 0.000 title claims abstract description 13
- 230000005291 magnetic effect Effects 0.000 claims abstract description 18
- 230000006698 induction Effects 0.000 claims abstract description 9
- 238000001914 filtration Methods 0.000 claims description 15
- 238000012545 processing Methods 0.000 claims description 11
- 238000003466 welding Methods 0.000 claims description 9
- 230000003044 adaptive effect Effects 0.000 claims description 4
- 239000011159 matrix material Substances 0.000 claims description 4
- 230000001174 ascending effect Effects 0.000 claims description 3
- 238000004364 calculation method Methods 0.000 claims description 3
- 238000001514 detection method Methods 0.000 description 9
- 238000009659 non-destructive testing Methods 0.000 description 6
- 238000010586 diagram Methods 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 5
- 239000003302 ferromagnetic material Substances 0.000 description 4
- 230000000694 effects Effects 0.000 description 3
- 238000007781 pre-processing Methods 0.000 description 2
- 238000003672 processing method Methods 0.000 description 2
- 230000032683 aging Effects 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000013079 data visualisation Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 230000005294 ferromagnetic effect Effects 0.000 description 1
- 230000004907 flux Effects 0.000 description 1
- 230000005381 magnetic domain Effects 0.000 description 1
- 238000012847 principal component analysis method Methods 0.000 description 1
- 230000011218 segmentation Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
- G06T7/0004—Industrial image inspection
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01N—INVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
- G01N27/00—Investigating or analysing materials by the use of electric, electrochemical, or magnetic means
- G01N27/72—Investigating or analysing materials by the use of electric, electrochemical, or magnetic means by investigating magnetic variables
- G01N27/82—Investigating or analysing materials by the use of electric, electrochemical, or magnetic means by investigating magnetic variables for investigating the presence of flaws
- G01N27/83—Investigating 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
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01R—MEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
- G01R33/00—Arrangements or instruments for measuring magnetic variables
- G01R33/02—Measuring direction or magnitude of magnetic fields or magnetic flux
- G01R33/032—Measuring direction or magnitude of magnetic fields or magnetic flux using magneto-optic devices, e.g. Faraday or Cotton-Mouton effect
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/70—Denoising; Smoothing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10004—Still 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
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:
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 recordedsm,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 sideAnd left alternative trough extreme pointsThe 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
2) Presetting a spacing threshold u, and setting a current extreme point sequenceDeleting 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 defectWhen 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
S6: is divided intoAlternative trough extreme points on the right sideAnd left alternative trough extreme pointsAs a starting point, continuously searching to obtain an extreme point of the alternative peak on the right sideAnd left alternative peak extreme pointThe searching method comprises the following steps:
1) initialization starting pointOrInitializing the next peak extreme point C-R', and initializing the extreme point sequence
2) At the current extreme point sequenceDeleting 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 pointThen 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 pointWhen 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 pointTaking the current peak extreme point C as the right candidate peak extreme point of the defectWhen the starting point is the left alternative trough extreme pointTaking the current peak extreme point C as the left candidate peak extreme point of the defect
S7: calculating to obtain a peak extreme point AmAnd right alternative trough extreme pointsIs a distance ofCalculating to obtain the extreme point of the alternative wave trough on the right sideAnd alternative peak extreme points on the rightIs a distance ofThen calculating to obtain the distance difference value
Calculating to obtain a peak extreme point AmAnd left alternative trough extreme pointsIs a distance ofCalculating to obtain the extreme point of the alternative wave trough on the left sideAnd left alternative peak extreme pointIs a distance ofThen calculating to obtain the distance difference value
When deltaright≤ΔleftAnd the alternative peak extreme point on the right sideIs greater than or equal to the left alternative peak extreme pointThe peak extreme point A is obtainedmAnd alternative peak extreme points on the rightThe area in between is used as a defect extreme value area; when deltaright≥ΔleftAnd the alternative peak extreme point on the right sideIs less than the left alternative peak extreme pointIf so, the left alternative peak extreme point is setAnd 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:
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 recordedsm,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 sequenceWhereinN ═ 1,2, …, N-1. Differential sequenceValue of each element inCan 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 againIdentifying the difference data to filter out zero data which are not extreme points, i.e. according to the difference sequenceObtaining the sequence Tm=[tm,1,tm,2,…,tm,N-1]Wherein each element tm,n′The calculation formula of (a) is as follows:
s403: determining an extreme point:
for sequence Tm=[tm,1,tm,2,…,tm,N-1]Difference is carried out to obtain a sequenceWhereinN ″, 1,2, …, N-2. Traversal sequenceWhen in useWhen it is, then pm,n″+1Is a mean value sequence PmA maximum point of; when in useWhen 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 sideAnd left alternative trough extreme pointsThe 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
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 sequenceThe 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 defectWhen 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
S106: searching the next peak extreme point:
respectively using the alternative trough extreme points on the right sideAnd left alternative trough extreme pointsAs a starting point, continuously searching to obtain an extreme point of the alternative peak on the right sideAnd left alternative peak extreme pointThe searching method comprises the following steps:
1) initialization starting pointOrInitializing the next peak extreme point C-R', and initializing the extreme point sequence
2) Removing noise extreme points:
likewise, noise extrema are eliminated through the distance threshold, namely, in the current extrema sequenceAnd 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 pointThen, 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 pointThen, 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 pointTaking the current peak extreme point c as the right candidate peak extreme point of the defectWhen the starting point is the left alternative trough extreme pointTaking the current peak extreme point c as the left candidate peak extreme point of the defect
S107: determining a defect extremum region:
calculating to obtain a peak extreme point AmAnd right alternative trough extreme pointsIs a distance ofCalculating to obtain the extreme point of the alternative wave trough on the right sideAnd alternative peak extreme points on the rightIs a distance ofThen calculating to obtain the distance difference value
Calculating to obtain a peak extreme point AmAnd left alternative trough extreme pointsIs a distance ofCalculating to obtain the extreme point of the alternative wave trough on the left sideAnd left alternative peak extreme pointIs a distance ofThen calculating to obtain the distance difference value
When deltaright≤ΔleftAnd the alternative peak extreme point on the right sideIs greater than or equal to the left alternative peak extreme pointThe peak extreme point A is obtainedmAnd alternative peak extreme points on the rightThe area in between is used as a defect extreme value area; when deltaright≥ΔleftAnd the alternative peak extreme point on the right sideIs less than the left alternative peak extreme pointIf so, the left alternative peak extreme point is setSum 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:
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 recordedsm,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 sideAnd left alternative trough extreme pointsThe 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
2) Presetting a spacing threshold u, and setting a current extreme point sequenceDeleting 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 defectWhen 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
S6: respectively using the alternative trough extreme points on the right sideAnd left alternative trough extreme pointsAs a starting point, continuously searching to obtain an extreme point of the alternative peak on the right sideAnd left alternative peak extreme pointThe searching method comprises the following steps:
1) initialization starting pointOrInitializing the next peak extreme point C-R', and initializing the extreme point sequence
2) At the current extreme point sequenceDeleting 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 pointThen 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 pointSearching 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 pointTaking the current peak extreme point C as the right candidate peak extreme point of the defectWhen the starting point is the left alternative trough extreme pointTaking the current peak extreme point C as the left candidate peak extreme point of the defect
S7: calculating to obtain a peak extreme point AmAnd right alternative trough extreme pointsIs a distance ofCalculating to obtain the extreme point of the alternative wave trough on the right sideAnd alternative peak extreme points on the rightIs a distance ofThen calculating to obtain the distance difference value
Calculating to obtain a peak extreme point AmAnd left side is provided withWave trough extreme pointIs a distance ofCalculating to obtain the extreme point of the alternative wave trough on the left sideAnd left alternative peak extreme pointIs a distance ofThen calculating to obtain the distance difference value
When deltaright≤ΔleftAnd the alternative peak extreme point on the right sideIs greater than or equal to the left alternative peak extreme pointThe peak extreme point A is obtainedmAnd alternative peak extreme points on the rightThe area in between is used as a defect extreme value area; when deltaright≥ΔleftAnd the alternative peak extreme point on the right sideIs less than the left alternative peak extreme pointIf so, the left alternative peak extreme point is setAnd 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 sequenceWherein
S3.2: according to a difference sequenceObtaining the sequence Tm=[tm,1,tm,2,…,tm,N-1]Wherein each element tm,n′The calculation formula of (a) is as follows:
s3.3: for sequence Tm=[tm,1,tm,2,…,tm,N-1]Difference is carried out to obtain a sequenceWhereinN ″ -1, 2, …, N-2; traversal sequenceWhen in useWhen it is, then pm,n″+1Is a mean value sequence PmA maximum point of; when in useWhen 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.
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)
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)
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 |
-
2021
- 2021-06-15 CN CN202110659599.XA patent/CN113393440B/en active Active
Patent Citations (5)
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)
Title |
---|
张杰: "基于低频正交激励的磁光成像缺陷检测研究", 《万方数据学位论文全文数据库》 * |
Cited By (1)
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 |