CN105427324B - The magneto-optic image defects detection method searched for automatically based on binary-state threshold - Google Patents

The magneto-optic image defects detection method searched for automatically based on binary-state threshold Download PDF

Info

Publication number
CN105427324B
CN105427324B CN201510888490.8A CN201510888490A CN105427324B CN 105427324 B CN105427324 B CN 105427324B CN 201510888490 A CN201510888490 A CN 201510888490A CN 105427324 B CN105427324 B CN 105427324B
Authority
CN
China
Prior art keywords
pixel
image
magneto
area
value
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.)
Expired - Fee Related
Application number
CN201510888490.8A
Other languages
Chinese (zh)
Other versions
CN105427324A (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 CN201510888490.8A priority Critical patent/CN105427324B/en
Publication of CN105427324A publication Critical patent/CN105427324A/en
Application granted granted Critical
Publication of CN105427324B publication Critical patent/CN105427324B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20024Filtering details
    • G06T2207/20032Median filtering

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses a kind of magneto-optic image defects detection method searched for automatically based on binary-state threshold, first mean filter is carried out to obtaining magneto-optic gray-scale map, then binary-state threshold is searched for automatically, the pixel filling scan method of " pouring water " formula has been used in search procedure, filling area under different packed heights is calculated, fitting obtains change curve of the filling area relative to packed height, search obtains packed height in curve corresponding to filling area growth rate maximum as optimal binaryzation threshold values, then binary conversion treatment is carried out to the magneto optic images, recycle and spot is obtained to binary picture progress contour detecting, calculate the area of each spot, by filtering out interference of the method exclusive PCR hot spot of fleck to defect, so as to detect to obtain defect.Then the present invention filters out interference, so as to which rapidly and accurately extraction obtains clearly defect information by searching for optimal binary-state threshold automatically using area.

Description

Magneto-optical imaging defect detection method based on automatic binary threshold search
Technical Field
The invention belongs to the technical field of magneto-optical imaging nondestructive defect detection, and particularly relates to a magneto-optical imaging defect detection method based on binarization threshold automatic search.
Background
Surface and subsurface defects have been the focus of research, particularly the detection of subsurface defects. The existing nondestructive detection methods include an ultrasonic method, an electromagnetic eddy current method, a ray method, an infrared thermal imaging method and the like, the defects can be detected by the methods to a certain extent, but the methods are difficult to achieve the purpose of detecting small defects. Magneto-optical imaging is used as a newly developed nondestructive detection technology, and has high detection precision and sensitivity to defects, and particularly has good detection effect on subsurface defects. The other excellent characteristic is that the detection result can be directly used for observation, thereby greatly facilitating the visual ability of personnel to the defect.
Currently, magneto-optical imaging detection is in a primary development stage, and most researches are carried out on visualization and defect strengthening work aiming at the characteristics of images. But little research has been done on how to deal with the magnetic domain spots generated by the detection process and the optical flow disturbances generated by the detection. Since the image effect due to magnetic domain speckle and optical flow disturbances is almost the same as that of defects, specific algorithms are required to filter out these disturbances. The existing filtering methods are mostly pixel-level filtering methods and mode identification-based filtering methods, and because the size of the interference light spot is hundreds of times larger than that of a pixel and the interference light spot does not have a fixed shape, the two methods are difficult to directly filter the interference light spot and the mode identification-based filtering method.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provides a magneto-optical imaging defect detection method based on automatic binary threshold search, which automatically searches the optimal binary threshold so as to accurately realize defect detection.
In order to realize the aim, the magneto-optical imaging defect detection method based on the automatic binary threshold search comprises the following steps:
s1: acquiring a magneto-optical image of the test piece by adopting a magneto-optical imaging device, and performing graying treatment to obtain a magneto-optical gray image;
s2: carrying out mean value filtering on the magneto-optical gray level image to obtain a filtered image I;
s3: searching a binary threshold, which comprises the following specific steps:
s3.1: searching to obtain the maximum value of pixel values of all pixel points in the image I, marking the maximum value as G, setting the maximum filling pixel value K as lambda G, and setting lambda as a constant greater than 1;
s3.2: let the filling time t equal to 1, initialize the filling height value h1
S3.3: according to height value htFilling the image I to obtain a filled matrix phi, wherein the formula is as follows:
Φ=ht·H-Ω
wherein Ω is a pixel value matrix of the image I, and H is an identity matrix of the same size as Ω;
s3.4: scanning each pixel point in the matrix phi to obtain the number of the pixel points of which the element values are more than or equal to 0 in the matrix phi, and storing the number of the pixel points as a filling area S (t);
s3.5: if h istIf the value is less than K, the step S3.6 is carried out, otherwise, the step S3.7 is carried out;
s3.6: let t be t +1, ht=ht-1+ Δ h, Δ h representing the filling height step, return to step S3.3;
s3.7: according to each filling height htPerforming curve fitting with the corresponding filling area S (t) to obtain a change curve X of the filling area relative to the filling height;
s3.8: searching to obtain the filling height corresponding to the position with the maximum filling area growth rate in the curve XLet the binary threshold value Represents rounding up;
s4: carrying out binarization on the image I according to the binarization threshold T searched in the step S3 to obtain a magneto-optical binarization image;
s5: carrying out contour detection on the magneto-optical binary image to obtain the contour of each spot;
s6: calculating the area R of each spot obtained in step S5qQ is 1,2, …, Q denotes the number of spots;
s7: the area R of each spotqArranged from small to large, and the area value is in the interval [1, Q]Carrying out internal normalization, and recording the q-th area value after normalization as gammaq(ii) a Sequentially calculating the difference delta gamma of two adjacent area valuesq′=γq′+1q′Q' ═ 1,2, …, Q-1, once Δ γq′τ > represents a predetermined threshold, and γq′And all the previous area blocks are regarded as interference, the spots corresponding to the interference are backfilled in the magneto-optical gray image by adopting a global gray image, and the backfilled magneto-optical gray image is a defect detection result image.
The invention discloses a magneto-optical imaging defect detection method based on automatic binary threshold search, which comprises the steps of firstly carrying out mean value filtering on an obtained magneto-optical gray image, then automatically searching a binary threshold, using an irrigation pixel filling scanning method in the searching process, calculating filling areas under different filling heights, fitting to obtain a change curve of the filling areas relative to the filling heights, searching to obtain a filling height corresponding to the position where the filling area growth rate is maximum in the curve as an optimal binary threshold, then carrying out binary processing on the magneto-optical image, carrying out contour detection on the binary image to obtain spots, calculating the area of each spot, and eliminating the interference of interference spots on defects by a method for filtering small spots so as to detect the defects.
According to the invention, the optimal binarization threshold value is automatically searched, and then the area is utilized to filter out interference, so that clear defect information can be rapidly and accurately extracted.
Drawings
FIG. 1 is a diagram illustrating pixel values of a defect site;
FIG. 2 is a flow chart of an embodiment of the magneto-optical imaging defect detection method based on the automatic binary threshold search of the present invention;
FIG. 3 is a flow chart of "water filling" type binary threshold value automatic search;
FIG. 4 is an exemplary graph of fitted fill area versus fill height curves;
FIG. 5 is a flowchart of a speckle contour detection method according to the present embodiment;
FIG. 6 is a flowchart of spot area calculation in the present embodiment;
FIG. 7 is a picture of a test piece used in the present embodiment;
FIG. 8 is a magneto-optical gray scale view of the test piece of FIG. 7;
FIG. 9 is a magneto-optical grayscale mean filtered image;
FIG. 10 is a plot of the fill area and first and second derivatives;
FIG. 11 is a magneto-optical binarized image;
FIG. 12 is a diagram of defect detection results;
FIG. 13 is a magneto-optical binarization plot of defect detection results;
figure 14 is a comparison of an original magneto-optical grey scale map and a post-filling magneto-optical grey scale map;
fig. 15 shows the magneto-optic gray scale map processing results of six common filter enhancement methods.
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
To better explain the technical solution of the present invention, first, the principle of the present invention will be briefly explained.
In the magneto-optical gray image, the pixel value of a suspected defect part is lower than that of a non-defect part, but the defect itself has no fixed depth and shape, and the defect is difficult to clearly detect from the aspect of pattern recognition. Therefore, the image used in defect detection of the present invention is a binarized magneto-optical image. The edge and position information of the defect can be displayed completely to a great extent through binarization. And filtering by different algorithms according to the characteristics of the image so as to obtain a defective image. From the above analysis, it is found that binarization of an image is particularly important in magneto-optical detection. The selection of the threshold value adopted in the image binarization is most important, and the prior art is the threshold value determined according to experience in many cases, so that the requirement and the limitation on the photo quality of the original magneto-optical image are great.
Fig. 1 is a schematic diagram of pixel values of a defect portion. As shown in fig. 1, since the pixel value of the defective portion is small, the pixel value is gradually increased from the inside to the outside at the defective portion. Therefore, when filling the gray image from low to high, the filled area is different at different heights. Not only are the sizes different, but also the area growth rates are different. At the edge of the defect, the area growth rate is increased greatly and then falls back again, showing a change in the shape of an "S". The binary threshold value can be searched according to the principle.
Fig. 2 is a flowchart of an embodiment of the magneto-optical imaging defect detection method based on the automatic binary threshold search of the present invention. As shown in fig. 2, the magneto-optical imaging defect detection method based on the automatic binary threshold search of the present invention comprises the following steps:
s201: acquiring a magneto-optical gray scale image:
and acquiring a magneto-optical image of the test piece by adopting a magneto-optical imaging device, and performing graying treatment to obtain a magneto-optical gray image.
S202: and (3) mean filtering:
and carrying out mean value filtering on the magneto-optical gray image to obtain a filtered image I. The filtering window in the filtering process is not easy to be set too small, and the side length is generally more than 5 pixels. Too small can cause part of bad pixel points to be unable to be filtered out, leading to larger fluctuation of the subsequent filling statistical map, and reducing the search precision of the binarization threshold value.
S203: automatic search of a binarization threshold value:
because the pixel values of the magneto-optical images are different in size and the required binary threshold values are different due to different illumination and materials in each detection, the invention provides a 'irrigation' type automatic search method for the binary threshold values to adapt to different images. FIG. 3 is a flow chart of "water filling" type binary threshold value automatic search. As shown in fig. 3, the "irrigation" type binary threshold value automatic search method includes the following steps:
s301: set maximum fill pixel value:
the maximum value among all pixel values in the image I is obtained through searching and recorded as G, the maximum filling pixel value K is set to λ G, λ is a constant greater than 1, and λ is set to 1.2 in this embodiment. The maximum fill pixel value serves to ensure that the entire image is filled during the fill scan.
S302: initializing fill scan parameters:
let the filling time t equal to 1, initialize the filling height value h1。h1For setting the filling start pixel value, it can be set according to actual requirement, in this embodiment, h is set1=1。
S303: filling an image:
according to height value htFilling the image I to obtain a filled matrix phi, and finishing the following operation:
Φ=ht·H-Ω
where Ω is the matrix of pixel values of the image I, and H is an identity matrix of the same size as Ω. The resulting filled matrix Φ contains pixel information of the filled portion.
S304: counting the number of filled pixels:
scanning each pixel point in the matrix phi to obtain the number of the pixel points of which the element values are more than or equal to 0 in the matrix phi, and storing the number of the pixel points as a filling area S (t). When the element value of the pixel point in the matrix phi is greater than or equal to 0, the pixel point is successfully filled in the filling, and the pixel point with the element value less than 0 indicates that the original pixel value cannot be covered by the current filling height. This corresponds to the defect being a depression and then water being poured, and the filling area s (t) corresponds to the area to be flooded.
S305: judging whether h ist< K, if yes, go to step S306, otherwise go to step S307.
S306: let t be t +1, ht=ht-1+ Δ h, Δ h represents the filling height step, set as necessary, and returns to step S303.
S307: and (3) curve fitting:
according to the foregoing principle description, the optimal binarization threshold is the filling height corresponding to the maximum filling area growth rate, and the discrete data points of the filling height and the corresponding filling area are obtained by the foregoing process, so that the filling height h needs to be determined according to each filling heighttAnd performing curve fitting with the corresponding filling area S (t) to obtain a change curve X of the filling area relative to the filling height. There are many methods for curve fitting, and the specific method can be selected according to actual needs. In order to make the calculation more accurate and reduce the disturbance error, the embodiment adoptsFitting method based on cubic spline interpolation.
Fig. 4 is an exemplary graph of the fitted change curve of the filling area with respect to the filling height. As shown in fig. 4, the abscissa is the filling height and the ordinate is the filling area. The filling scan can be divided into 5 stages from fig. 4, first the dark spots in the filtered image are irrigated, then the background is irrigated, after the transition area is passed, the actual defect position is irrigated, at this time, the area with the fastest area growth rate appears, then the area becomes flat, and finally the image is filled. At the setting of the initial fill height value h1In this case, the first two regions may be skipped from the transition region, which may reduce the amount of computation.
S308: searching a binary threshold value:
searching to obtain the filling height corresponding to the position with the maximum filling area growth rate in the curve XLet the binary threshold value Represents rounding up due to the fill height searched for from the fitted curve XMay not be integer values.
Since the background color of the magneto-optical image needs to be filled in during the filling process, and the background color has gray values with different levels due to the measurement errors of photons and sensors. Thus, during the initial filling process, the curve X also tends to change in "S" shape before the fill height reaches the lowest part of the defect height value, and a relatively flat region, called the "transition region", appears between the background almost filling and the lowest pixel value in the defect portion. From this region, where the slope is greatest in the change of curve X, this can be identified as being at the optimal threshold. Based on the above analysis, the present embodiment proposes the following search method:
determining the first derivative curve X for the curve X1And second derivative curve X2. Step size σ vs second derivative curve X2Searching is carried out if the second derivative X of the ith search2(i)>0,X2(i-1) < 0, then i is considered to correspond to the first derivative curve X at this time1If the second derivative X of the jth search is the same as the first derivative X of the jth search2(j)<0,X2(j-1) > 0, then i is considered to correspond to the first derivative curve X at this time1The maximum value in the (j) th search is the filling height corresponding to the position where the filling area growth rate is maximum
S204: image binarization:
and (5) carrying out binarization on the image I according to the binarization threshold T obtained by searching in the step S203 to obtain a magneto-optical binarization image.
S205: and (3) spot contour detection:
and carrying out contour detection on the magneto-optical binary image to obtain a contour image of each spot.
FIG. 5 is a flowchart of a speckle contour detection method in this embodiment. As shown in fig. 5, the spot contour detection includes the following steps:
s501: magneto-optical binarization image median filtering:
because the independent pixel points can not form a closed spot block and are regarded as pixel dead pixels, the magneto-optical binary image is subjected to median filtering processing to filter the independent pixel points. The filtering window should not be too large, and preferably [3,3] to [10,10], because too large results in the speckle object being too smooth, the accuracy of defect information is reduced, and too small results in the parts that cannot constitute the speckle block being filtered out.
S502: edge detection:
and calculating by using a canny operator to obtain the contour of the magneto-optical binary image to obtain an edge image L of the magneto-optical binary image, wherein the size of the edge image L is consistent with that of the magneto-optical binary image, the size is recorded as M multiplied by N, the value of an edge pixel point in the edge image is 1, and the value of a non-edge pixel point is 0.
S503: let the column number p be 1 and the blob number q be 1.
S504: scanning non-zero pixel points:
scanning the p-th row of pixel points in the edge image L, and collecting A at the pixel pointspThe coordinates of each non-zero pixel are recorded.
S505: judging whether A is presentpNull, if yes, go to step S506, otherwise go to step S508.
S506: and judging whether p is less than N, if so, entering the step S507, otherwise, finishing the detection of the spot contour.
S507: let p be p +1, return to step S504.
S508: initializing pixel queue O for the qth blobqIs empty.
S509: determining the starting point of the spot contour:
set A of pixel pointspThe first pixel is taken as OqFirst pixel O inq(1) That is, A ispThe first non-zero pixel in the set serves as the starting point of the profile for the qth blob.
S510: let the pixel number f in the blob be 2.
S511: determine the next contour pixel:
note Oq(f-1) the coordinate is (m, n), and the magneto-optical binarization edge image L sequentially faces upwards and upwards to the rightThe pixel points (m-1, n), (m-1, n +1), (m +1, n-1), (m-1, n-1) are traversed, and once a non-zero pixel is found, whether the pixel is in the pixel queue O or not is judgedqIf so, searching for the next one, otherwise assigning a non-zero pixel coordinate to the pixel queue OqF-th pixel O of (2)q(f)。
S512: judging whether O is presentq(f)=Oq(1) If not, the process proceeds to step S513, otherwise, the process proceeds to step S514.
S513: let f be f +1, return to step S511.
S514: in the pixel queue OqMiddle deletion of Oq(f) And at this time, the outline search of the qth spot is finished, and all the pixel point coordinates are recorded in the pixel queue OqIn (1).
S515: updating the magneto-optical binary image:
after the outline search of the qth spot is finished, because the outlines among the spots can not be crossed, a pixel queue O needs to be arranged in the magneto-optical binary edge image LqThe pixel values of all the pixel coordinates in (a) are set to 0.
S516: let q be q +1, return to step S504.
S206: calculate the individual spot area:
the area of each blob in step S205 is calculated. Fig. 6 is a flowchart of spot area calculation in the present embodiment. As shown in fig. 6, the step of calculating the spot area includes:
s601: drawing a spot contour map:
from the respective spot profiles obtained in step S205, a spot profile map is obtained by rendering. The specific process comprises the following steps: initializing a full black image with the same size as the magneto-optical image, and setting a pixel value corresponding to a pixel point in the contour queue to be 1 to obtain a speckle contour map.
S602: let the blob number q be 1.
S603: searching for blob boundary coordinates:
pixel queue O from the qth blobqSearching to obtain the maximum value x of the abscissa in each pixel pointmaxMinimum value xminAnd the maximum value y of the ordinatemaxMinimum value ymin
S604: let column number p' ═ xminThe qth spot area Rq=0。
S605: scanning the p' th column contains pixels:
searching to obtain the pixel queue O in the p' th columnqThe pixels in (1) are sorted from large to small according to the ordinate. The number of pixels found by the search is recorded as H, and the number of pixels V included in the row of the blob is recorded as Vp' calculated according to the following formula:
wherein,indicating a rounding down. Because the spot is a closed contour, the intersection point of the scanning line and the contour is in and out, so that the number of the searched contour pixel points is even, but there are some special cases that the number is odd, and because the number of the contour pixel points is odd, for simplicity, the number of the pixels included in the column is estimated by adopting a mode of omitting the last contour pixel point (namely, rounding down H/2). Because the probability of odd number of contour pixel points is very small, the estimation method does not bring substantial influence on the final area result.
S606: area accumulation:
let the area R of the qth blobq=Rq+Vp′
S607: judging whether p' < xmaxIf so, the process proceeds to step S608, otherwise, the process proceeds to step S609.
S608: let p' +1, return to step S605.
S609: and judging whether Q is less than Q, wherein Q represents the number of the speckles obtained in the step S205, if so, entering the step S610, and if not, finishing the area calculation of all the speckles.
S610: let q be q +1, return to step S603.
S207: and (3) defect detection:
in step S206, the area of each spot can be obtained and arranged from small to large. The last spot is the background block and the penultimate is the suspected defect spot in the magneto-optical image since there is a background contour with the largest area. Because the defect area is larger than that of a common magnetic domain spot block or a pixel disturbance spot, if the area of two adjacent spots after sequencing is differentiated, when a defect exists, a part with a steeply increased area exists, and the defect can be detected and obtained. The specific method comprises the following steps:
the area R of each spotqArranged from small to large, and the area value is in the interval [1, Q]Carrying out internal normalization, and recording the q-th area value after normalization as gammaq. Sequentially calculating the difference delta gamma of two adjacent area valuesq′=γq′+1q′Q' ═ 1,2, …, Q-1, once Δ γq′τ > represents a predetermined threshold, then γq′+1To gammaQ-1The corresponding spot is a defect, gammaQAs background, gamma isq′And all the previous area blocks are regarded as interference, the spots corresponding to the interference are backfilled in the magneto-optical gray image by adopting a global gray image, and the backfilled magneto-optical gray image is a defect detection result image. In general, to better distinguish between defects and interference, the threshold τ ≧ 1 is set, which is set to 1 in this embodiment.
It can be seen that gamma is due toQThe corresponding spots are backgrounds, when the test piece has no defects, all the spots are interfered by magnetic domains and the like, and then the delta gamma is obviousQ-1=γQQ-1Is relatively large, so that the background can be excluded for gamma1To gammaQ-1Backfilling the corresponding spots; when the test piece has a defect, the area value corresponding to the defect is assumed to beThen is atThe interference can be judged, so that gamma is1ToAnd backfilling the corresponding interference spots, and reserving the defects and the background.
In order to better illustrate the technical effects of the invention, a specific test piece is adopted for experimental verification. Fig. 7 is a picture of a test piece used in the present embodiment. As shown in fig. 7, the test piece of this embodiment uses silicon steel sheets, wherein the width of the defect is 1mm, and the depth is 0.2 mm. Fig. 8 is a magneto-optical gray scale diagram of the test piece shown in fig. 7. As shown in fig. 8, the magneto-optical gray scale map reflects defects, but there are many black spots around the magneto-optical gray scale map, which are caused by the influence of magnetic domains and the like, and the detection rate of the defects is disturbed. And performing mean filtering on the magneto-optical gray-scale image. Figure 9 is a magneto-optical grayscale mean filtered image. And then automatically searching for a binary threshold value. Fig. 10 is a fill area curve and first and second derivative curves. As shown in fig. 10, in the first derivative of the filling area, the first maximum value after the minimum value is the optimal threshold position, and is also the place where the filling area growth rate is maximum, which is just a peak value of the second derivative, so as to search the binarization threshold. And then the magneto-optical gray scale map can be binarized. Fig. 11 is a magneto-optical binarized image. And carrying out contour detection on the magneto-optical binary image to obtain spots, then calculating the area of each spot, and filtering interference through the area to realize defect detection. Fig. 12 is a defect detection result diagram. In order to better show the defect detection result, the pixel value of a pixel point contained in the corresponding interference spot in the magneto-optical binary image is set to be 0. Fig. 13 is a magneto-optical binarization graph of defect detection results. As shown in fig. 12 and 13, defect information is well extracted and the influence of the domain spots is minimized. Figure 14 is a comparison of the original magneto-optical grey scale map and the magneto-optical grey scale map after filling. As shown in fig. 14, the invention can substantially eliminate the interference of magnetic domains, and obtain more accurate defect detection results.
In addition, in order to illustrate the beneficial effects of the invention, six common filtering enhancement methods are adopted to compare the defect detection effects. Fig. 15 shows the magneto-optic gray scale map processing results of six common filter enhancement methods. Comparing fig. 14 and fig. 15, it can be seen that the six common filter enhancement methods can reduce the magnetic domain interference to some extent, but the effect is far lower than the present invention. Therefore, compared with the prior art, the method can extract the defect image more accurately.
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 (6)

1. A magneto-optical imaging defect detection method based on automatic binary threshold search is characterized by comprising the following steps:
s1: acquiring a magneto-optical image of the test piece by adopting a magneto-optical imaging device, and performing graying treatment to obtain a magneto-optical gray image;
s2: carrying out mean value filtering on the magneto-optical gray level image to obtain a filtered image I;
s3: searching a binary threshold, which comprises the following specific steps:
s3.1: searching to obtain the maximum value of pixel values of all pixel points in the image I, marking the maximum value as G, setting the maximum filling pixel value K as lambda G, and setting lambda as a constant greater than 1;
s3.2: let the filling time t equal to 1, initialize the filling height value h1
S3.3: according to height value htFilling the image I to obtain a filled matrix phi, wherein the formula is as follows:
Φ=ht·H-Ω
wherein Ω is a pixel value matrix of the image I, and H is an identity matrix of the same size as Ω;
s3.4: scanning each pixel point in the matrix phi to obtain the number of the pixel points of which the element values are more than or equal to 0 in the matrix phi, and storing the number of the pixel points as a filling area S (t);
s3.5: if h istIf the value is less than K, the step S3.6 is carried out, otherwise, the step S3.7 is carried out;
s3.6: let t be t +1, ht=ht-1+ Δ h, Δ h representing the filling height step, return to step S3.3;
s3.7: according to each filling height htPerforming curve fitting with the corresponding filling area S (t) to obtain a change curve X of the filling area relative to the filling height;
s3.8: searching to obtain the filling height corresponding to the position with the maximum filling area growth rate in the curve XLet the binary threshold value Represents rounding up;
s4: carrying out binarization on the image I according to the binarization threshold T searched in the step S3 to obtain a magneto-optical binarization image;
s5: carrying out contour detection on the magneto-optical binary image to obtain the contour of each spot;
s6: calculating the area R of each spot obtained in step S5qQ1, 2, …, Q, Q tableShowing the number of the spots;
s7: the area R of each spotqArranged from small to large, and the area value is in the interval [1, Q]Carrying out internal normalization, and recording the q-th area value after normalization as gammaq(ii) a Sequentially calculating the difference delta gamma of two adjacent area valuesq′=γq′+1q′Q' ═ 1,2, …, Q-1, once Δ γq′τ > represents a predetermined threshold, and γq′And all the previous area blocks are regarded as interference, the spots corresponding to the interference are backfilled in the magneto-optical gray image by adopting a global gray image, and the backfilled magneto-optical gray image is a defect detection result image.
2. The defect detection method of claim 1, wherein the side length of the filtering window during the mean filtering in step S2 is greater than or equal to 5 pixels.
3. The defect detection method of claim 1, wherein in step S3.7, the curve fitting is a fitting method based on cubic spline interpolation.
4. The method of claim 1, wherein in step S5, the outline detection method comprises:
s5.1: carrying out median filtering processing on the magneto-optical binary image;
s5.2: calculating by using a canny operator to obtain the contour of the magneto-optical binary image, obtaining an edge image L of the magneto-optical binary image, and recording the size of the edge image as M multiplied by N, the value of an edge pixel point in the edge image as 1 and the value of a non-edge pixel point as 0;
s5.3: let the column number p be 1 and the blob number q be 1;
s5.4: scanning the p-th row of pixel points in the edge image L, and collecting A at the pixel pointspRecording the coordinates of each non-zero pixel;
s5.5: if A ispIf the value is null, the step S5.6 is carried out, otherwise, the step S5.7 is carried out;
s5.6: if p is less than N, making p equal to p +1, returning to step S5.4, otherwise, finishing the detection of the spot contour;
s5.7: initializing pixel queue O for the qth blobqIs empty;
s5.8: set A of pixel pointspThe first pixel is taken as OqFirst pixel O inq(1) (ii) a Making the pixel serial number f in the spot equal to 2;
s5.9: note Oq(f-1) the coordinate is (m, n), pixel points (m-1, n), (m-1, n +1), (m +1, n-1) and (m-1, n-1) are traversed, and once a non-zero pixel is found, whether the pixel is in the pixel queue O or not is judgedqIf so, searching for the next one, otherwise assigning a non-zero pixel coordinate to the pixel queue OqF-th pixel O of (2)q(f);
S5.10: judging whether O is presentq(f)=Oq(1) If not, let f be f +1, return to step S5.9, otherwise at pixel queue OqMiddle deletion of Oq(f) In the edge image L, the pixel queue O is arrangedqThe pixel values of all the pixel coordinates are set to 0, q is set to q +1, and the process returns to step S5.4.
5. A defect detection method as claimed in claim 4, wherein in step S5.1, the filtering window side length range during median filtering is [3,10 ].
6. The method of claim 1, wherein in step S6, the spot area is calculated by:
s6.1: drawing to obtain a spot contour map according to each spot contour;
s6.2: let the blob number q be 1;
s6.3: pixel queue O from the qth blobqSearching to obtain the maximum value x of the abscissa in each pixel pointmaxMinimum value xmin
S6.4: let column number p' ═ xminThe qth spot area Rq=0;
S6.5: search toTo the p' th column belonging to a pixel queue OqThe pixels in the image are sorted from large to small according to the ordinate; the number of pixels found by the search is recorded as H, and the number of pixels V included in the row of the blob is recorded as Vp′Calculated according to the following formula:
wherein,represents rounding down;
s6.6: let the area R of the qth blobq=Rq+Vp′
S6.7: if p' < xmaxIf p' +1, return to step S6.5, otherwise go to step S6.8;
s6.8: if Q < Q, Q represents the number of blobs, let Q be Q +1, return to step S6.3, otherwise the area calculation for all blobs ends.
CN201510888490.8A 2015-12-07 2015-12-07 The magneto-optic image defects detection method searched for automatically based on binary-state threshold Expired - Fee Related CN105427324B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510888490.8A CN105427324B (en) 2015-12-07 2015-12-07 The magneto-optic image defects detection method searched for automatically based on binary-state threshold

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510888490.8A CN105427324B (en) 2015-12-07 2015-12-07 The magneto-optic image defects detection method searched for automatically based on binary-state threshold

Publications (2)

Publication Number Publication Date
CN105427324A CN105427324A (en) 2016-03-23
CN105427324B true CN105427324B (en) 2018-03-09

Family

ID=55505504

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510888490.8A Expired - Fee Related CN105427324B (en) 2015-12-07 2015-12-07 The magneto-optic image defects detection method searched for automatically based on binary-state threshold

Country Status (1)

Country Link
CN (1) CN105427324B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110111315A (en) * 2019-04-26 2019-08-09 五邑大学 A kind of periphery detection method, device and storage medium based on CIS

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106600604B (en) * 2016-11-14 2019-06-14 电子科技大学 A kind of threshold values optimization method of magneto-optic image defects detection method
CN107180428B (en) * 2017-06-09 2019-08-20 电子科技大学 A kind of the magneto optic images Enhancement Method based on optical flow algorithm
CN107688812B (en) * 2017-08-25 2020-04-21 重庆慧都科技有限公司 Food production date ink-jet font repairing method based on machine vision
CN107993225B (en) * 2017-11-28 2020-06-23 电子科技大学 Defect identification method for magneto-optical eddy current imaging detection
CN110857920A (en) * 2018-08-24 2020-03-03 东华大学 Method for detecting poor forming defect of coiled filament
CN111354009B (en) * 2020-02-27 2022-10-28 西安交通大学 Method for extracting shape of laser additive manufacturing molten pool
CN112285339B (en) * 2020-09-25 2024-02-06 安徽润谷科技有限公司 Marking method for fluorescent immunochromatography visual detection
CN112927189A (en) * 2021-01-28 2021-06-08 江苏大学 Method for eliminating edge reflection light spots in visual inspection of surface flaws of electroplated workpiece
CN114283170B (en) * 2021-12-24 2024-05-03 北京元客视界科技有限公司 Light spot extraction method

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101256157A (en) * 2008-03-26 2008-09-03 广州中国科学院工业技术研究院 Method and apparatus for testing surface defect
CN102509300A (en) * 2011-11-18 2012-06-20 深圳市宝捷信科技有限公司 Defect detection method and system
CN103698393A (en) * 2013-12-03 2014-04-02 广东工业大学 Magneto-optical imaging nondestructive detection method of weld defects
CN104616275A (en) * 2013-11-04 2015-05-13 北京兆维电子(集团)有限责任公司 Defect detecting method and defect detecting device
EP2913795A1 (en) * 2012-10-25 2015-09-02 Mitsubishi Electric Corporation Image processing device and image processing method
CN104950039A (en) * 2015-06-23 2015-09-30 西安交通大学 Ferromagnetic pipeline quantitative lossless evaluating method based on nonlinear magnetic saturation pulsed eddy current

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101256157A (en) * 2008-03-26 2008-09-03 广州中国科学院工业技术研究院 Method and apparatus for testing surface defect
CN102509300A (en) * 2011-11-18 2012-06-20 深圳市宝捷信科技有限公司 Defect detection method and system
EP2913795A1 (en) * 2012-10-25 2015-09-02 Mitsubishi Electric Corporation Image processing device and image processing method
CN104616275A (en) * 2013-11-04 2015-05-13 北京兆维电子(集团)有限责任公司 Defect detecting method and defect detecting device
CN103698393A (en) * 2013-12-03 2014-04-02 广东工业大学 Magneto-optical imaging nondestructive detection method of weld defects
CN104950039A (en) * 2015-06-23 2015-09-30 西安交通大学 Ferromagnetic pipeline quantitative lossless evaluating method based on nonlinear magnetic saturation pulsed eddy current

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
探测亚表面缺陷的磁-光显微成像检测技术研究;程玉华;《中国博士学位论文全文数据库 工程科技I辑》;20080415;全文 *
电涡流脉冲热成像无损检测技术研究;白利兵;《中国博士学位论文全文数据库 工程科技I辑》;20140615;全文 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110111315A (en) * 2019-04-26 2019-08-09 五邑大学 A kind of periphery detection method, device and storage medium based on CIS
CN110111315B (en) * 2019-04-26 2021-01-26 五邑大学 Cylinder surface detection method and device based on CIS and storage medium

Also Published As

Publication number Publication date
CN105427324A (en) 2016-03-23

Similar Documents

Publication Publication Date Title
CN105427324B (en) The magneto-optic image defects detection method searched for automatically based on binary-state threshold
CN108364280B (en) Method and equipment for automatically describing structural crack and accurately measuring width
Hoang et al. Metaheuristic optimized edge detection for recognition of concrete wall cracks: a comparative study on the performances of roberts, prewitt, canny, and sobel algorithms
CN108629775B (en) Thermal state high-speed wire rod surface image processing method
CN108759973B (en) Water level measuring method
US10931871B2 (en) Pipeline detection method and apparatus, and storage medium
JP7319432B2 (en) LEARNING DATA COLLECTION DEVICE, LEARNING DATA COLLECTION METHOD, AND PROGRAM
CN104574393B (en) A kind of three-dimensional pavement crack pattern picture generates system and method
CN106920245B (en) Boundary detection method and device
JP6099479B2 (en) Crack detection method
CN103871062B (en) A kind of lunar surface rock detection method described based on super-pixel
JP5175528B2 (en) Tunnel lining crack inspection system
CN107784669A (en) A kind of method that hot spot extraction and its barycenter determine
CN112330593A (en) Building surface crack detection method based on deep learning network
CN110619328A (en) Intelligent ship water gauge reading identification method based on image processing and deep learning
KR20150112656A (en) Method to calibrate camera and apparatus therefor
CN104697476A (en) Automatic detection method and device for roughness light-incision profile curve
WO2021000948A1 (en) Counterweight weight detection method and system, and acquisition method and system, and crane
CN105046701A (en) Multi-scale salient target detection method based on construction graph
CN109961013A (en) Recognition methods, device, equipment and the computer readable storage medium of lane line
JP4870016B2 (en) Crack detection method
CN114926407A (en) Steel surface defect detection system based on deep learning
CN103942786B (en) The self adaptation block objects detection method of unmanned plane visible ray and infrared image
CN108320799B (en) Image analysis and recognition method for lateral flow paper strip disease diagnosis
CN112179294A (en) Land proofreading method, device and system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB03 Change of inventor or designer information
CB03 Change of inventor or designer information

Inventor after: Zhang Jie

Inventor after: Cheng Yuhua

Inventor after: Yin Chun

Inventor after: Tian Lulu

Inventor after: Bai Libing

Inventor after: Huang Xuegang

Inventor after: Chen Kai

Inventor after: Wang Chao

Inventor before: Cheng Yuhua

Inventor before: Yin Chun

Inventor before: Tian Lulu

Inventor before: Bai Libing

Inventor before: Huang Xuegang

Inventor before: Chen Kai

Inventor before: Zhang Jie

GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20180309

Termination date: 20201207