Method and system for automatically determining defects using laser misaligned speckle images
Through cosine filtering and morphological operations, the laser misaligned speckle image is processed, and automatic defect determination and high-precision defect size measurement of laser misaligned speckle image are realized, which solves the defects that rely on manual assistance in the prior art, and improves detection efficiency and automation.
Patent Information
- Application Number
- CN202210569455.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-24
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2042-05-24
AI Technical Summary
The existing laser misaligned speckle interference defect determination technology relies on manual assistance, making it difficult to achieve automated and precise measurements, and cannot meet the needs of large-scale industrial production inspection.
The laser misaligned speckle defect image is denoised pre-processed by using cosine filtering, and then defect determination is performed through threshold segmentation and morphological operations. Finally, defect positioning and dimension measurement are completed by finding the contour and minimum circle operations.
Automatic defect determination and high-precision defect size measurement of laser misaligned speckle images are realized, which improves detection efficiency and automation, and meets the needs of industrial production inspection.
Smart Images

Figure CN114881991B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of nondestructive testing, and in particular to a method and system for automatically determining defects using laser misaligned speckle images. Background Art
[0002] As a new non-destructive testing technology, laser speckle interferometry has the advantages of large area, full field, non-contact, low vibration isolation requirements and simple structure, and is widely used in non-destructive testing of composite materials. At present, laser speckle interferometry defect determination technology mainly relies on manual assisted determination, but in actual application, the phase image contrast obtained by laser speckle is often low, which brings great difficulties to the accurate delineation of defect boundaries. The measurement of the defect size of the phase relies on human judgment and cannot be accurately measured, which is difficult to meet the needs of large-scale industrial production inspection. The detection results of laser speckle interferometry technology will be given in the form of images. How to automatically determine defects from complex detection images and accurately measure the defect size, rather than relying on the experience and judgment of the inspection personnel and manual measurement, is particularly critical.
[0003] Patent document CN112362700A (application number: CN202011065157.4) discloses a method for calibrating the sensitivity of laser dislocation speckle equipment based on the thermal loading method; first, a black frosted acrylic plate is selected, and M rows and N columns of blind holes for simulating defects are processed on the same surface of the black frosted acrylic plate, where M and N are both positive integers greater than 2, and the blind holes in the row spacing direction have different apertures and the same buried depths, and the blind holes in the column spacing direction have the same apertures and different buried depths, so as to obtain a sensitivity calibration test block; then, a thin layer of white developer powder is evenly sprayed on the surface of the prepared sensitivity calibration test block using a developer spray can for penetration detection, and after the developer powder is dried, the sensitivity calibration test block is clamped and fixed with a bracket; then, the test operation is performed and the test structure is analyzed and judged to achieve non-destructive calibration. However, this invention cannot realize automatic determination of defects. Summary of the invention
[0004] In view of the defects in the prior art, the object of the present invention is to provide a method and system for automatically determining defects of laser misaligned speckle images.
[0005] A method for automatically determining defects using a laser misalignment speckle image provided by the present invention comprises:
[0006] Step S1: using sine and cosine filtering to perform image denoising preprocessing on the laser misalignment speckle defect image;
[0007] Step S2: threshold segmentation is performed on the preprocessed image to determine defects;
[0008] Step S3: Perform contour search and minimum circle search operations on the defect determination result image to complete defect location and defect equivalent size measurement.
[0009] Preferably, in step S1:
[0010] By using the continuity of sine and cosine functions, the discontinuous phase information in the fringe pattern is converted into a continuous value, and the phase pattern is transformed into a sine and cosine transform respectively to avoid the loss of information of the phase pattern jump. Then the transformed phase pattern is subjected to median filtering respectively, and finally the filtered sine phase pattern and cosine phase pattern are subjected to arc tangent processing.
[0011] Perform sine and cosine transforms on the image I(x,y):
[0012]
[0013] Where I(x,y) is the gray value of the original image wrapped with the phase map, s(x,y) is the gray value of the image after sine transformation, and c(x,y) is the gray value after cosine transformation.
[0014] Preferably, median filtering is performed on the images obtained after the transformation;
[0015] The phase image is divided into two components, and then the mean filter is used for calculation, with any pixel point (i, j) in the mean filter as the center point, and the window size is 3×3:
[0016] s′(x i ,y j )=median[s(x i-1 ,y j-1 ),s(x i ,y j-1 ),s(x i+1 ,y j-1 ),s(x i-1 ,y j ),s(x i ,y j ),s(x i+1 ,y j ),s(x i-1 ,y j+1 ),s(x i ,y j+1 ),s(x i ,y j+1 )]
[0017] c′(x i ,y j )=median[c(x i-1 ,y j-1 ),c(x i ,yj-1 ),c(x i+1 ,y j-1 ),c(x i-1 ,y j ),c(x i ,y j ),c(x i+1 ,y j ),c(x i-1 ,y j+1 ),c(x i ,y j+1 ),c(x i ,y j+1 )]
[0018] s'(x,y) is the image after sine phase filtering, c'(x,y) is the image after cosine phase filtering, s'(x i ,y j ) is the pixel value at coordinate (i, j) in image s', c'(x i ,y j ) is the pixel value at coordinate (i, j) in image c', s(x i ,y j ) is the pixel value at the coordinate (i, j) in image s, c(x i ,y j ) is the pixel value at coordinate (i, j) in image c;
[0019] Perform an inverse tangent operation on the filtered image:
[0020]
[0021] Where I1(x,y) is the image with smoothed edge texture after denoising.
[0022] Preferably, in step S2:
[0023] It is necessary to use image segmentation and image expansion and corrosion morphological operations to determine defects:
[0024] First, perform threshold segmentation on the image:
[0025]
[0026] In the formula, I1(x i ,y j ) is the denoised image obtained in step 1, I2(x i ,y j ) is the image after threshold segmentation, T1 is the set low threshold, T2 is the set high threshold, and after the image segmentation and binarization, in order to eliminate the influence of scattered noise, the image is subjected to a morphological operation of first dilation and then erosion;
[0027] The image I2 can be expressed as follows using the structural unit K expansion:
[0028]
[0029] In the formula, the symbol is the dilation operator, I'2 is the image after dilation, K (x,y) It means that when the origin of K moves to point (x, y), X represents the connected domain of the binary image I2;
[0030] The image I'2 eroded by the structural unit K can be expressed as:
[0031]
[0032] In the formula, the symbol is the corrosion operator, I3 is the image after corrosion, K (x,y) It means that when the origin of K moves to point (x, y), X represents the connected domain of the binary image I2;
[0033] Perform multiple iterative operations, use the structure unit K to first dilate the image I2 n times and then erode it n times to obtain the image I3.
[0034] Preferably, in step S3:
[0035] a. Perform contour and minimum circle operations on image I3 to complete defect location and defect size measurement:
[0036] b. Traverse all points and find the four points on the left, right, top and bottom, and represent them with A, B, C and D respectively;
[0037] c. Find the center and radius of the smallest circle C1 that encloses the four points A, B, C, and D;
[0038] d. In the first iteration, traverse all points and check whether there is a point out of bounds, that is, not within the circle C1 nor on the boundary;
[0039] e. If there is no out-of-bounds point, the circle obtained is the final one; if there is an out-of-bounds point, go to step f;
[0040] f. If the point farthest from the center of circle C1 among the out-of-bounds points is E, try the following four combinations in turn: (1) A / B / C / E; (2) A / B / D / E; (3) A / C / D / E; (4) B / C / D / E;
[0041] Find the minimum enclosing circle of the four points in the combination. If the minimum enclosing circle of the four points in the combination is C2, and the remaining points outside the detection combination are within circle C2, then record the center and radius of point E and circle C2;
[0042] g. The second iteration traverses all points and checks whether there are out-of-bounds points, that is, points that are neither inside the circle C2 nor on the boundary. If there are no out-of-bounds points, the circle C2 obtained is the final one; if there are out-of-bounds points, run step h;
[0043] h. If the point farthest from the center of circle C2 among the out-of-bounds points is F, try the following four combinations in turn: (I) A / B / D / F; (II) A / B / E / F; (III) A / D / E / F; (IV) B / D / E / F; process these four combinations in turn and find the minimum enclosing circle of the four points in the combination. If the combination finds circle C3, check whether the remaining points outside the combination are within circle C3, and record point F and the center and radius of circle C3;
[0044] i. The third iteration, then repeat g and h until it is found that the results of traversing all points are within the newly calculated circle boundary, then the circle is the final circle, and the iteration is exited.
[0045] A system for automatically determining defects using a laser misalignment speckle image provided by the present invention comprises:
[0046] Module M1: Use sine and cosine filtering to perform image denoising preprocessing on the laser misalignment speckle defect image;
[0047] Module M2: threshold segmentation of the preprocessed image and defect determination;
[0048] Module M3: Perform contour search and minimum circle search operations on the defect determination result image to complete defect location and defect equivalent size measurement.
[0049] Preferably, in the module M1:
[0050] By using the continuity of sine and cosine functions, the discontinuous phase information in the fringe pattern is converted into a continuous value, and the phase pattern is transformed into a sine and cosine transform respectively to avoid the loss of information of the phase pattern jump. Then the transformed phase pattern is subjected to median filtering respectively, and finally the filtered sine phase pattern and cosine phase pattern are subjected to arc tangent processing.
[0051] Perform sine and cosine transforms on the image I(x,y):
[0052]
[0053] Where I(x,y) is the gray value of the original image wrapped with the phase map, s(x,y) is the gray value of the image after sine transformation, and c(x,y) is the gray value after cosine transformation.
[0054] Preferably, median filtering is performed on the images obtained after the transformation;
[0055] The phase image is divided into two components, and then the mean filter is used for calculation, with any pixel point (i, j) in the mean filter as the center point, and the window size is 3×3:
[0056] s′(x i ,y j )=median[s(x i-1 ,y j-1 ),s(x i ,y j-1 ),s(x i+1 ,y j-1 ),s(x i-1 ,y j ),s(x i ,y j ),s(x i+1 ,y j ),s(x i-1 ,y j+1 ),s(x i ,y j+1 ),s(x i ,y j+1 )]
[0057] c′(x i ,y j )=median[c(x i-1 ,y j-1 ),c(x i ,y j-1 ),c(x i+1 ,y j-1 ),c(x i-1 ,y j ),c(x i ,y j ),c(x i+1 ,y j ),c(x i-1 ,y j+1 ),c(x i ,y j+1 ),c(x i ,y j+1 )]
[0058] s'(x,y) is the image after sine phase filtering, c'(x,y) is the image after cosine phase filtering, s'(x i ,y j ) is the pixel value at coordinate (i, j) in image s', c'(x i ,y j ) is the pixel value at coordinate (i, j) in image c', s(x i ,y j) is the pixel value at the coordinate (i, j) in image s, c(x i ,y j ) is the pixel value at coordinate (i, j) in image c;
[0059] Perform an inverse tangent operation on the filtered image:
[0060]
[0061] Where I1(x,y) is the image with smoothed edge texture after denoising.
[0062] Preferably, in the module M2:
[0063] It is necessary to use image segmentation and image expansion and corrosion morphological operations to determine defects:
[0064] First, perform threshold segmentation on the image:
[0065]
[0066] In the formula, I1(x i ,y j ) is the denoised image obtained in step 1, I2(x i ,y j ) is the image after threshold segmentation, T1 is the set low threshold, T2 is the set high threshold, and after the image segmentation and binarization, in order to eliminate the influence of scattered noise, the image is subjected to a morphological operation of first dilation and then erosion;
[0067] The image I2 can be expressed as follows using the structural unit K expansion:
[0068]
[0069] In the formula, the symbol is the dilation operator, I'2 is the image after dilation, K (x,y) It means that when the origin of K moves to point (x, y), X represents the connected domain of the binary image I2;
[0070] The image I'2 eroded by the structural unit K can be expressed as:
[0071]
[0072] In the formula, the symbol is the corrosion operator, I3 is the image after corrosion, K (x,y) It means that when the origin of K moves to the point (x, y), X represents the connected domain of the binary image I2;
[0073] Perform multiple iterative operations, use the structure unit K to first dilate the image I2 n times and then erode it n times to obtain the image I3.
[0074] Preferably, in the module M3:
[0075] a. Perform contour and minimum circle operations on image I3 to complete defect location and defect size measurement:
[0076] b. Traverse all points and find the four points on the left, right, top and bottom, and represent them with A, B, C and D respectively;
[0077] c. Find the center and radius of the smallest circle C1 that encloses the four points A, B, C, and D;
[0078] d. In the first iteration, traverse all points and check whether there is a point out of bounds, that is, not within the circle C1 nor on the boundary;
[0079] e. If there is no out-of-bounds point, the circle obtained is the final one; if there is an out-of-bounds point, go to step f;
[0080] f. If the point farthest from the center of circle C1 among the out-of-bounds points is E, try the following four combinations in turn: (1) A / B / C / E; (2) A / B / D / E; (3) A / C / D / E; (4) B / C / D / E;
[0081] Find the minimum enclosing circle of the four points in the combination. If the minimum enclosing circle of the four points in the combination is C2, and the remaining points outside the detection combination are within circle C2, then record the center and radius of point E and circle C2;
[0082] g. The second iteration traverses all points and checks whether there are out-of-bounds points, that is, points that are neither inside the circle C2 nor on the boundary. If there are no out-of-bounds points, the circle C2 obtained is the final one; if there are out-of-bounds points, run step h;
[0083] h. If the point farthest from the center of circle C2 among the out-of-bounds points is F, try the following four combinations in turn: (I) A / B / D / F; (II) A / B / E / F; (III) A / D / E / F; (IV) B / D / E / F; process these four combinations in turn and find the minimum enclosing circle of the four points in the combination. If the combination finds circle C3, check whether the remaining points outside the combination are within circle C3, and record point F and the center and radius of circle C3;
[0084] i. The third iteration, then repeat g and h until it is found that the results of traversing all points are within the newly calculated circle boundary, then the circle is the final circle, and the iteration is exited.
[0085] Compared with the prior art, the present invention has the following beneficial effects:
[0086] 1. The present invention can realize automatic defect determination: At present, the laser offset speckle interferometry defect determination technology mainly relies on manual auxiliary determination, which is difficult to meet the needs of large-scale industrial production detection. The present invention can automatically determine defects directly from complex detection images;
[0087] 2. The present invention can quantitatively measure the position of defects with high precision and automatically calculate the size of defects. In practical applications, the contrast of the phase image obtained by laser misalignment speckle is often low, which makes it extremely difficult to accurately outline the defect boundary. The corresponding defect size measurement relies on human judgment and manual measurement, which makes it difficult to achieve accurate positioning.
[0088] 3. The present invention has good real-time performance and high automation. The laser offset speckle equipment has low automation and intelligent defect assessment, and requires manual operation, interpretation, manual measurement and coordinate point marking. When the product object is inspected in multiple partitions, it is necessary to move and adjust the relative position between the system and the product multiple times. The inspection efficiency is low and the result is a single scattered image, which is not conducive to overall evaluation. The inspection result of the laser offset speckle technology will be given in the form of an image. The present invention can realize automatic defect detection, greatly improve the efficiency of laser offset speckle image defect detection, and has good real-time performance and high automation.
[0089] 4. This method helps to improve the efficiency of defect detection of laser dislocation speckle images, meet the application requirements of non-contact, high resolution, high positioning accuracy, and real-time rapid detection of aerospace products, and lay a solid foundation for the extensive engineering promotion and application of laser dislocation speckle detection technology in weapons, new energy vehicles and other fields. BRIEF DESCRIPTION OF THE DRAWINGS
[0090] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:
[0091] Figure 1 The figure is a flow chart of the method of the present invention. DETAILED DESCRIPTION
[0092] The present invention is described in detail below in conjunction with specific embodiments. The following embodiments will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, for those of ordinary skill in the art, several changes and improvements can also be made without departing from the concept of the present invention. These all belong to the protection scope of the present invention.
[0093] Embodiment 1:
[0094] In view of the shortcomings of the current laser misaligned speckle defect detection methods, the present invention proposes a method for automatically realizing defect detection and size measurement of laser misaligned speckle defect images by using laser misaligned speckle images. The method first decomposes the laser misaligned speckle image into a sine image and a cosine image, performs median filtering on the sine image and the cosine image respectively, and inversely transforms the filtered image into a filtered image; threshold segmentation is performed on the filtered image, and multiple expansion and erosion operations are performed to complete defect detection; finally, the contour is determined, the minimum circle surrounding the contour is found, and the center and radius are determined to complete defect location and defect size measurement. The method proposed by the present invention obtains its precise contour based on the grayscale distribution information of the defect, thereby completing the automatic determination of characteristic defects and accurate measurement of defect size, and can realize automatic detection of defects.
[0095] According to the present invention, a method for automatically determining defects using a laser misalignment speckle image is provided. Figure 1 As shown, including:
[0096] Step S1: using sine and cosine filtering to perform image denoising preprocessing on the laser misalignment speckle defect image;
[0097] Specifically, in step S1:
[0098] By using the continuity of sine and cosine functions, the discontinuous phase information in the fringe pattern is converted into a continuous value, and the phase pattern is transformed into a sine and cosine transform respectively to avoid the loss of information of the phase pattern jump. Then the transformed phase pattern is subjected to median filtering respectively, and finally the filtered sine phase pattern and cosine phase pattern are subjected to arc tangent processing.
[0099] Perform sine and cosine transforms on the image I(x,y):
[0100]
[0101] Where I(x,y) is the gray value of the original image wrapped with the phase map, s(x,y) is the gray value of the image after sine transformation, and c(x,y) is the gray value after cosine transformation.
[0102] Specifically, the images obtained after the transformation are subjected to median filtering respectively;
[0103] The phase image is divided into two components, and then the mean filter is used for calculation, with any pixel point (i, j) in the mean filter as the center point, and the window size is 3×3:
[0104] s′(x i ,y j )=median[s(x i-1 ,y j-1 ),s(x i ,yj-1 ),s(x i+1 ,y j-1 ),s(x i-1 ,y j ),s(x i ,y j ),s(x i+1 ,y j ),s(x i-1 ,y j+1 ),s(x i ,y j+1 ),s(x i ,y j+1 )]
[0105] c′(x i ,y j )=median[c(x i-1 ,y j-1 ),c(x i ,y j-1 ),c(x i+1 ,y j-1 ),c(x i-1 ,y j ),c(x i ,y j ),c(x i+1 ,y j ),c(x i-1 ,y j+1 ),c(x i ,y j+1 ),c(x i ,y j+1 )]
[0106] s'(x,y) is the image after sine phase filtering, c'(x,y) is the image after cosine phase filtering, s'(x i ,y j ) is the pixel value at coordinate (i, j) in image s', c'(x i ,y j ) is the pixel value at coordinate (i, j) in image c', s(x i ,y j ) is the pixel value at the coordinate (i, j) in image s, c(x i ,y j ) is the pixel value at coordinate (i, j) in image c;
[0107] Perform an inverse tangent operation on the filtered image:
[0108]
[0109] Where I1(x,y) is the image with smoothed edge texture after denoising.
[0110] Step S2: threshold segmentation is performed on the preprocessed image to determine defects;
[0111] Specifically, in step S2:
[0112] It is necessary to use image segmentation and image expansion and corrosion morphological operations to determine defects:
[0113] First, perform threshold segmentation on the image:
[0114]
[0115] In the formula, I1(x i ,y j ) is the denoised image obtained in step 1, I2(x i ,y j ) is the image after threshold segmentation, T1 is the set low threshold, T2 is the set high threshold, and after the image segmentation and binarization, in order to eliminate the influence of scattered noise, the image is subjected to a morphological operation of first dilation and then erosion;
[0116] The image I2 can be expressed as follows using the structural unit K expansion:
[0117]
[0118] In the formula, the symbol is the dilation operator, I'2 is the image after dilation, K (x,y) It means that when the origin of K moves to point (x, y), X represents the connected domain of the binary image I2;
[0119] The image I'2 eroded by the structural unit K can be expressed as:
[0120]
[0121] In the formula, the symbol is the corrosion operator, I3 is the image after corrosion, K (x,y) It means that when the origin of K moves to point (x, y), X represents the connected domain of the binary image I2;
[0122] Perform multiple iterative operations, use the structure unit K to first dilate the image I2 n times and then erode it n times to obtain the image I3.
[0123] Step S3: Perform contour search and minimum circle search operations on the defect determination result image to complete defect location and defect equivalent size measurement.
[0124] Specifically, in step S3:
[0125] a. Perform contour and minimum circle operations on image I3 to complete defect location and defect size measurement:
[0126] b. Traverse all points and find the four points on the left, right, top and bottom, and represent them with A, B, C and D respectively;
[0127] c. Find the center and radius of the smallest circle C1 that encloses the four points A, B, C, and D;
[0128] d. In the first iteration, traverse all points and check whether there is a point out of bounds, that is, not within the circle C1 nor on the boundary;
[0129] e. If there is no out-of-bounds point, the circle obtained is the final one; if there is an out-of-bounds point, go to step f;
[0130] f. If the point farthest from the center of circle C1 among the out-of-bounds points is E, try the following four combinations in turn: (1) A / B / C / E; (2) A / B / D / E; (3) A / C / D / E; (4) B / C / D / E;
[0131] Find the minimum enclosing circle of the four points in the combination. If the minimum enclosing circle of the four points in the combination is C2, and the remaining points outside the detection combination are within circle C2, then record the center and radius of point E and circle C2;
[0132] g. The second iteration traverses all points and checks whether there are out-of-bounds points, that is, points that are neither inside the circle C2 nor on the boundary. If there are no out-of-bounds points, the circle C2 obtained is the final one; if there are out-of-bounds points, run step h;
[0133] h. If the point farthest from the center of circle C2 among the out-of-bounds points is F, try the following four combinations in turn: (I) A / B / D / F; (II) A / B / E / F; (III) A / D / E / F; (IV) B / D / E / F; process these four combinations in turn and find the minimum enclosing circle of the four points in the combination. If the combination finds circle C3, check whether the remaining points outside the combination are within circle C3, and record point F and the center and radius of circle C3;
[0134] i. The third iteration, then repeat g and h until it is found that the results of traversing all points are within the newly calculated circle boundary, then the circle is the final circle, and the iteration is exited.
[0135] Embodiment 2:
[0136] Embodiment 2 is a preferred example of Embodiment 1, and is used to illustrate the present invention in more detail.
[0137] Those skilled in the art may understand the method for automatically determining defects using laser misaligned speckle images provided by the present invention as a specific implementation of a system for automatically determining defects using laser misaligned speckle images, that is, the system for automatically determining defects using laser misaligned speckle images may be implemented by executing the step flow of the method for automatically determining defects using laser misaligned speckle images.
[0138] A system for automatically determining defects using a laser misalignment speckle image provided by the present invention comprises:
[0139] Module M1: Use sine and cosine filtering to perform image denoising preprocessing on the laser misalignment speckle defect image;
[0140] Specifically, in the module M1:
[0141] By using the continuity of sine and cosine functions, the discontinuous phase information in the fringe pattern is converted into a continuous value, and the phase pattern is transformed into a sine and cosine transform respectively to avoid the loss of information of the phase pattern jump. Then the transformed phase pattern is subjected to median filtering respectively, and finally the filtered sine phase pattern and cosine phase pattern are subjected to arc tangent processing.
[0142] Perform sine and cosine transforms on the image I(x,y):
[0143]
[0144] Where I(x,y) is the gray value of the original image wrapped with the phase map, s(x,y) is the gray value of the image after sine transformation, and c(x,y) is the gray value after cosine transformation.
[0145] Specifically, the images obtained after the transformation are subjected to median filtering respectively;
[0146] The phase image is divided into two components, and then the mean filter is used for calculation, with any pixel point (i, j) in the mean filter as the center point, and the window size is 3×3:
[0147] s′(x i ,y j )=median[s(x i-1 ,y j-1 ),s(x i ,y j-1 ),s(x i+1 ,y j-1 ),s(x i-1 ,y j ),s(x i ,y j ),s(x i+1 ,y j ),s(x i-1 ,y j+1),s(x i ,y j+1 ),s(x i ,y j+1 )]
[0148] c′(x i ,y j )=median[c(x i-1 ,y j-1 ),c(x i ,y j-1 ),c(x i+1 ,y j-1 ),c(x i-1 ,y j ),c(x i ,y j ),c(x i+1 ,y j ),c(x i-1 ,y j+1 ),c(x i ,y j+1 ),c(x i ,y j+1 )]
[0149] s'(x,y) is the image after sine phase filtering, c'(x,y) is the image after cosine phase filtering, s'(x i ,y j ) is the pixel value at coordinate (i, j) in image s', c'(x i ,y j ) is the pixel value at coordinate (i, j) in image c', s(x i ,y j ) is the pixel value at the coordinate (i, j) in image s, c(x i ,y j ) is the pixel value at coordinate (i, j) in image c;
[0150] Perform an inverse tangent operation on the filtered image:
[0151]
[0152] Where I1(x,y) is the image with smoothed edge texture after denoising.
[0153] Module M2: threshold segmentation of the preprocessed image and defect determination;
[0154] Specifically, in the module M2:
[0155] It is necessary to use image segmentation and image expansion and corrosion morphological operations to determine defects:
[0156] First, perform threshold segmentation on the image:
[0157]
[0158] In the formula, I1(x i ,y j ) is the denoised image obtained in step 1, I2(x i ,y j ) is the image after threshold segmentation, T1 is the set low threshold, T2 is the set high threshold, and after the image segmentation and binarization, in order to eliminate the influence of scattered noise, the image is subjected to a morphological operation of first dilation and then erosion;
[0159] The image I2 can be expressed as follows using the structural unit K expansion:
[0160]
[0161] In the formula, the symbol is the dilation operator, I'2 is the image after dilation, K (x,y) It means that when the origin of K moves to point (x, y), X represents the connected domain of the binary image I2;
[0162] The image I'2 eroded by the structural unit K can be expressed as:
[0163]
[0164] In the formula, the symbol is the corrosion operator, I3 is the image after corrosion, K (x,y) It means that when the origin of K moves to the point (x, y), X represents the connected domain of the binary image I2;
[0165] Perform multiple iterative operations, use the structure unit K to first dilate the image I2 n times and then erode it n times to obtain the image I3.
[0166] Module M3: Perform contour search and minimum circle search operations on the defect determination result image to complete defect location and defect equivalent size measurement.
[0167] Specifically, in the module M3:
[0168] a. Perform contour and minimum circle operations on image I3 to complete defect location and defect size measurement:
[0169] b. Traverse all points and find the four points on the left, right, top and bottom, and represent them with A, B, C and D respectively;
[0170] c. Find the center and radius of the smallest circle C1 that encloses the four points A, B, C, and D;
[0171] d. In the first iteration, traverse all points and check whether there is a point out of bounds, that is, not within the circle C1 nor on the boundary;
[0172] e. If there is no out-of-bounds point, the circle obtained is the final one; if there is an out-of-bounds point, go to step f;
[0173] f. If the point farthest from the center of circle C1 among the out-of-bounds points is E, try the following four combinations in turn: (1) A / B / C / E; (2) A / B / D / E; (3) A / C / D / E; (4) B / C / D / E;
[0174] Find the minimum enclosing circle of the four points in the combination. If the minimum enclosing circle of the four points in the combination is C2, and the remaining points outside the detection combination are within circle C2, then record the center and radius of point E and circle C2;
[0175] g. The second iteration traverses all points and checks whether there are out-of-bounds points, that is, points that are neither inside the circle C2 nor on the boundary. If there are no out-of-bounds points, the circle C2 obtained is the final one; if there are out-of-bounds points, run step h;
[0176] h. If the point farthest from the center of circle C2 among the out-of-bounds points is F, try the following four combinations in turn: (I) A / B / D / F; (II) A / B / E / F; (III) A / D / E / F; (IV) B / D / E / F; process these four combinations in turn and find the minimum enclosing circle of the four points in the combination. If the combination finds circle C3, check whether the remaining points outside the combination are within circle C3, and record point F and the center and radius of circle C3;
[0177] i. The third iteration, then repeat g and h until it is found that the results of traversing all points are within the newly calculated circle boundary, then the circle is the final circle, and the iteration is exited.
[0178] Embodiment 3:
[0179] Embodiment 3 is a preferred example of Embodiment 1, and is used to illustrate the present invention in more detail.
[0180] The method first pre-processes the laser misaligned speckle image by sine and cosine filtering, then performs image segmentation and dilation-erosion morphological transformation to realize defect detection, and finally finds the contour and the minimum circle to complete defect location and defect equivalent size measurement. This method can realize automatic defect determination, help improve the efficiency of laser misaligned speckle image defect detection, meet the application requirements of non-contact, high resolution, high positioning accuracy, and real-time rapid detection of aerospace products, and lay a foundation for the extensive engineering promotion and application of laser misaligned speckle detection technology in weapons, new energy vehicles and other fields.
[0181] The present invention provides a method for automatically determining defects using laser misalignment speckle images. The main process is: Figure 1 The specific steps are as follows:
[0182] (1) Use sine and cosine filtering to perform image denoising preprocessing on the laser misalignment speckle defect image:
[0183] The sine-cosine filtering method uses the continuity of the sine-cosine function to convert the discontinuous phase information in the fringe pattern into a continuous value, that is, the phase map is subjected to sine and cosine transformations, and then median filtering is performed respectively, and finally the filtered sine phase map and cosine phase map are subjected to arc tangent processing.
[0184] The input laser misalignment speckle defect image I1 is transformed by sine and cosine to obtain I 1s and I 1c .
[0185] Perform sine and cosine transforms on the image I1(x,y):
[0186]
[0187] Where I1(x, y) is the grayscale value of the original image wrapped with the phase image, I 1s (x, y) is the grayscale value of the image after sine transformation, I 1c (x, y) is the gray value after cosine transformation. The transformed image is subjected to median filtering.
[0188] At this time, the phase map is divided into two components, and then the mean filter is used for calculation, with any pixel point (i, j) in the mean filter as the center point, and the window size is 3×3.
[0189] I′ 1s (x i ,y j )=median[I 1s (x i-1 ,y j-1 ),I 1s (x i ,y j-1 ),s(x i+1 ,y j-1 ),I 1s (x i-1 ,y j ),I 1s (x i ,y j ),I 1s (x i+1 ,y j ),I 1s (x i-1 ,yj+1 ),I 1s (x i ,y j+1 ),I 1s (x i ,y j+1 )]
[0190] I′ 1c (x i ,y j )=median[I 1c (x i-1 ,y j-1 ),I 1c (x i ,y j-1 ),I 1c (x i+1 ,y j-1 ),I 1c (x i-1 ,y j ),I 1c (x i ,y j ),I 1c (x i+1 ,y j ),I 1c (x i-1 ,y j+1 ),I 1c (x i ,y j+1 ),I 1c (x i ,y j+1 )]
[0191] I' 1s (x i ,y j ) is the image after sinusoidal phase filtering, I' 1c (x i ,y j ) is the image after the cosine phase image is filtered. Perform the arc tangent operation on the filtered image:
[0192]
[0193] Where I2(x,y) is the denoised image.
[0194] (2) Defect determination using image segmentation and image expansion and corrosion morphological operations:
[0195] First, perform threshold segmentation on the image.
[0196]
[0197] In the formula, I2(x i ,y j ) is the denoised image obtained in step 1, I3(x i ,y j ) is the image after threshold segmentation. After the image segmentation and binarization, in order to eliminate the influence of scattered noise, the image is subjected to a morphological operation of first dilation and then erosion.
[0198] In order to obtain better results, the present invention performs multiple iterative operations, using the structural unit K to first dilate the image I3 n times and then erode it n times to obtain the image I4.
[0199] For example, this time the image I3 is expanded three times and then eroded three times.
[0200] Image I3 is expanded three times with structural unit K and can be expressed as:
[0201]
[0202]
[0203]
[0204] In the formula, the symbol is the dilation operator, and I”'3 represents the image after three dilations.
[0205] Using the structure unit K to corrode the image I"'3 three times can be expressed as:
[0206]
[0207]
[0208]
[0209] In the formula, the symbol is the erosion operator, and I4 represents the image after three erosions.
[0210] (3) Perform contour and minimum circle operations on the result image of (2) to complete defect location and defect size measurement, including the following steps:
[0211] 1) Traverse all points and find the four points on the left, right, top, and bottom, and represent them as A, B, C, and D respectively.
[0212] 2) Find the center and radius of the smallest circle C1 that encloses these four points.
[0213] 3) First iteration. Traverse all points and check whether there are any points out of bounds, that is, not in the circle C1 or on the boundary. If there are no out-of-bounds points, the circle obtained is the final one. If there are out-of-bounds points, go to step 4.
[0214] 4) Assume that the point farthest from the center of circle C1 among the out-of-bounds points is E, then try the following four combinations in turn: (1) A / B / C / E (2) A / B / D / E (3) A / C / D / E (4) B / C / D / E. Find the minimum enclosing circle of the four points in this combination. Assume that the minimum enclosing circle of combination (1) A, B, C, E is C2, then check whether the remaining point D is within C2. For example, if it is not, then it is considered combination (2). Calculate the minimum enclosing circle C3 of the four points A, B, D, and E, check the remaining point C, and find that it is within circle C3, then record the center and radius of point E and circle C3.
[0215] 5) Second iteration. Traverse all points and check whether there are out-of-bounds points, that is, not in the circle C3 or on the boundary. If there are no out-of-bounds points, the circle C3 obtained is the final one. If there are out-of-bounds points, go to the next step.
[0216] 6) Assume that the point farthest from the center of circle C3 among the out-of-bounds points is F, then try the following four combinations in turn: (1) A / B / D / F (2) A / B / E / F (3) A / D / E / F (4) B / D / E / F. Process these four combinations in turn and find the minimum enclosing circle of the four points in the combination. Assume that combination (1) finds circle C4, detect that point E is inside circle C4, and record point F and the center and radius of circle C4.
[0217] 7) The third iteration. Repeat steps 5 and 6 until all points are found to be within the circle boundary found recently. This circle is the final circle found, and the iteration is exited.
[0218] Perform the above steps 1-7 for each defect, and output all the center coordinates and their corresponding radius values. The center coordinates are the defect position, and the radius is the equivalent size of the defect.
[0219] Those skilled in the art know that, in addition to implementing the system, device and its various modules provided by the present invention in a purely computer-readable program code, it is entirely possible to implement the same program in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers and embedded microcontrollers by logically programming the method steps. Therefore, the system, device and its various modules provided by the present invention can be considered as a hardware component, and the modules included therein for implementing various programs can also be considered as structures within the hardware component; the modules for implementing various functions can also be considered as both software programs for implementing the method and structures within the hardware component.
[0220] The above describes the specific embodiments of the present invention. It should be understood that the present invention is not limited to the above specific embodiments, and those skilled in the art can make various changes or modifications within the scope of the claims, which does not affect the essence of the present invention. In the absence of conflict, the embodiments of the present application and the features in the embodiments can be combined with each other arbitrarily.
Claims
1. A method for automatically determining defects using laser misalignment speckle images, characterized in that: include: Step S1: using sine and cosine filtering to perform image denoising preprocessing on the laser misalignment speckle defect image; Step S2: threshold segmentation is performed on the preprocessed image to determine defects; Step S3: performing contour search and minimum circle search operations on the defect determination result image to complete defect location and defect equivalent size measurement; In step S2: It is necessary to use image segmentation and image expansion and corrosion morphological operations to determine defects: First, perform threshold segmentation on the image: In the formula, I1(x i ,y j ) is the denoised image obtained in step 1, I2(x i ,y j ) is the image after threshold segmentation, T1 is the set low threshold, T2 is the set high threshold, and after the image segmentation and binarization, in order to eliminate the influence of scattered noise, the image is subjected to a morphological operation of first dilation and then erosion; The image I2 can be expressed as follows using the structural unit K expansion: In the formula, the symbol is the expansion operator, I2 ′ is the image after dilation, K (x,y) It means that when the origin of K moves to point (x, y), X represents the connected domain of the binary image I2; Erode image I2 using structure unit K ′ It can be expressed as: In the formula, the symbol is the corrosion operator, I3 is the image after corrosion, K (x,y) It means that when the origin of K moves to point (x, y), X represents the connected domain of the binary image I2; Perform multiple iterative operations, use the structure unit K to first dilate image I2 n times and then erode it n times to obtain image I3; In step S3: a. Perform contour and minimum circle operations on image I3 to complete defect location and defect size measurement: b. Traverse all points and find the four points on the left, right, top and bottom, and represent them with A, B, C and D respectively; c. Find the center and radius of the smallest circle C1 that encloses the four points A, B, C, and D; d. In the first iteration, traverse all points and check whether there is a point out of bounds, that is, not within the circle C1 nor on the boundary; e. If there is no out-of-bounds point, the circle obtained is the final one; if there is an out-of-bounds point, go to step f; f. If the point farthest from the center of circle C1 among the out-of-bounds points is E, try the following four combinations in turn: (1) A / B / C / E; (2) A / B / D / E; (3) A / C / D / E; (4) B / C / D / E; Find the minimum enclosing circle of the four points in the combination. If the minimum enclosing circle of the four points in the combination is C2, and the remaining points outside the detection combination are within circle C2, then record the center and radius of point E and circle C2; g. The second iteration traverses all points and checks whether there are out-of-bounds points, that is, points that are neither inside the circle C2 nor on the boundary. If there are no out-of-bounds points, the circle C2 obtained is the final one; if there are out-of-bounds points, run step h; h. If the point farthest from the center of circle C2 among the out-of-bounds points is F, try the following four combinations in turn: (I) A / B / D / F; (II) A / B / E / F; (III) A / D / E / F; (IV) B / D / E / F; process these four combinations in turn and find the minimum enclosing circle of the four points in the combination. If the combination finds circle C3, check whether the remaining points outside the combination are within circle C3, and record point F and the center and radius of circle C3; i. The third iteration, then repeat g and h until it is found that the results of traversing all points are within the newly calculated circle boundary, then the circle is the final circle, and the iteration is exited.
2. The method for automatically determining defects using laser misalignment speckle images according to claim 1, characterized in that: In step S1: By using the continuity of sine and cosine functions, the discontinuous phase information in the fringe pattern is converted into a continuous value, and the phase pattern is transformed into a sine and cosine transform respectively to avoid the loss of information of the phase pattern jump. Then the transformed phase pattern is subjected to median filtering respectively, and finally the filtered sine phase pattern and cosine phase pattern are subjected to arc tangent processing. Perform sine and cosine transforms on the image I(x,y): Where I(x,y) is the gray value of the original image wrapped with the phase map, s(x,y) is the gray value of the image after sine transformation, and c(x,y) is the gray value after cosine transformation.
3. The method for automatically determining defects using laser misalignment speckle images according to claim 2, characterized in that: The images obtained after transformation are subjected to median filtering respectively; The phase image is divided into two components, and then the mean filter is used for calculation, with any pixel point (i, j) in the mean filter as the center point, and the window size is 3×3: s′(x i ,y j ) =median[s(x i-1 ,and j-1 ),s(x i ,and j-1 ),s(x i+1 ,and j-1 ),s(x i-1 ,and j ),s(x i ,and j ),s(x i+1 ,and j ),s(x i-1 ,and j+1 ),s(x i ,and j+1 ),s(x i ,and j+1 )] c′(x i ,y j ) =median[c(x i-1 ,y j-1 ),c(x i ,y j-1 ),c(x i+1 ,y j-1 ),c(x i-1 ,y j ),c(x i ,y j ),c(x i+1 ,y j ),c(x i-1 ,y j+1 ),c(x i ,y j+1 ),c(x u ,y j+1 )] s′(x,y) is the image after sine phase filtering, c′(x,y) is the image after cosine phase filtering, s′(x i ,y j ) is the image s ′ The pixel value at the coordinate (i, j), c ′ (x i ,y j ) is image c ′ The pixel value at the coordinate (i, j) in the middle, s(x i ,y j ) is the pixel value at the coordinate (i, j) in image s, c(x i ,y j ) is the pixel value at coordinate (i, j) in image c; Perform an inverse tangent operation on the filtered image: Where I1(x,y) is the image with smoothed edge texture after denoising.
4. A system for automatically determining defects using laser misalignment speckle images, characterized in that: include: Module M1: Use sine and cosine filtering to perform image denoising preprocessing on the laser misalignment speckle defect image; Module M2: threshold segmentation of the preprocessed image and defect determination; Module M3: Perform contour and minimum circle operations on the defect determination result image to complete defect location and defect equivalent size measurement; In the module M2: It is necessary to use image segmentation and image expansion and corrosion morphological operations to determine defects: First, perform threshold segmentation on the image: In the formula, I1(x i ,y j ) is the denoised image obtained in step 1, I2(x i ,y j ) is the image after threshold segmentation, T1 is the set low threshold, T2 is the set high threshold, and after the image segmentation and binarization, in order to eliminate the influence of scattered noise, the image is subjected to a morphological operation of first dilation and then erosion; The image I2 can be expressed as follows using the structural unit K expansion: In the formula, the symbol is the expansion operator, I2 ′ is the image after dilation, K (x,y) It means that when the origin of K moves to point (x, y), X represents the connected domain of the binary image I2; Erode image I2 using structure unit K ′ It can be expressed as: In the formula, the symbol is the corrosion operator, I3 is the image after corrosion, K (x,y) It means that when the origin of K moves to point (x, y), X represents the connected domain of the binary image I2; Perform multiple iterative operations, use the structure unit K to first dilate image I2 n times and then erode it n times to obtain image I3; In the module M3: a. Perform contour and minimum circle operations on image I3 to complete defect location and defect size measurement: b. Traverse all points and find the four points on the left, right, top and bottom, and represent them with A, B, C and D respectively; c. Find the center and radius of the smallest circle C1 that encloses the four points A, B, C, and D; d. In the first iteration, traverse all points and check whether there is a point out of bounds, that is, not within the circle C1 nor on the boundary; e. If there is no out-of-bounds point, the circle obtained is the final one; if there is an out-of-bounds point, go to step f; f. If the point farthest from the center of circle C1 among the out-of-bounds points is E, try the following four combinations in turn: (1) A / B / C / E; (2) A / B / D / E; (3) A / C / D / E; (4) B / C / D / E; Find the minimum enclosing circle of the four points in the combination. If the minimum enclosing circle of the four points in the combination is C2, and the remaining points outside the detection combination are within circle C2, then record the center and radius of point E and circle C2; g. The second iteration traverses all points and checks whether there are out-of-bounds points, that is, points that are neither inside the circle C2 nor on the boundary. If there are no out-of-bounds points, the circle C2 obtained is the final one; if there are out-of-bounds points, run step h; h. If the point farthest from the center of circle C2 among the out-of-bounds points is F, try the following four combinations in turn: (I) A / B / D / F; (II) A / B / E / F; (III) A / D / E / F; (IV) B / D / E / F; process these four combinations in turn and find the minimum enclosing circle of the four points in the combination. If the combination finds circle C3, check whether the remaining points outside the combination are within circle C3, and record point F and the center and radius of circle C3; i. The third iteration, then repeat g and h until it is found that the results of traversing all points are within the newly calculated circle boundary, then the circle is the final circle, and the iteration is exited.
5. The system for automatically determining defects using laser misalignment speckle images according to claim 4, characterized in that: In the module M1: By using the continuity of sine and cosine functions, the discontinuous phase information in the fringe pattern is converted into a continuous value, and the phase pattern is transformed into a sine and cosine transform respectively to avoid the loss of information of the phase pattern jump. Then the transformed phase pattern is subjected to median filtering respectively, and finally the filtered sine phase pattern and cosine phase pattern are subjected to arc tangent processing. Perform sine and cosine transforms on the image I(x,y): Where I(x,y) is the gray value of the original image wrapped with the phase map, s(x,y) is the gray value of the image after sine transformation, and c(x,y) is the gray value after cosine transformation.
6. The system for automatically determining defects using laser misaligned speckle images according to claim 5, characterized in that: The images obtained after transformation are subjected to median filtering respectively; The phase image is divided into two components, and then the mean filter is used for calculation, with any pixel point (i, j) in the mean filter as the center point, and the window size is 3×3: s ′ (x i ,y j ) =median[s(x i-1 ,y j-1 ),s(x i ,y j-1 ),s(x i+1 ,y j-1 ),s9x i-1 ,y j ),s(x i ,y j ),s(x i+1 ,y j ),s(x i-1 ,y j+1 ),s(x i ,y j+1 ),s(x i ,y j+1 )] c′(x i ,y j ) =median[c(x i-1 ,y j-1 ),c(x i ,y j-1 ),c(x i+1 ,y j-1 ),c(x i-1 ,y j ),c(x i ,y j ),c(x i+1 ,y j ),c(x i-1 ,y j+1 ),c(x i ,y j+1 ),c(x i ,y j+1 )] s′(x,y) is the image after sine phase filtering, c′(x,y) is the image after cosine phase filtering, s′(x i ,y j ) is the pixel value at the coordinate (i, j) in the image s′, c′(x i ,y j ) is image c ′ The pixel value at the coordinate (i, j) in the middle, s(x i ,y j ) is the pixel value at the coordinate (i, j) in image s, c(x i ,y j ) is the pixel value at coordinate (i, j) in image c; Perform an inverse tangent operation on the filtered image: Where I1(x,y) is the image with smoothed edge texture after denoising.
Citation Information
Patent Citations
Laser dislocation speckle equipment detection sensitivity verification method based on thermal loading method
CN112362700A