Periodic texture image defect detection method

By using frequency domain image processing technology, the problems of missed detection and high cost in periodic texture image detection are solved, achieving efficient and low-cost defect detection and avoiding manual annotation and high computing power requirements.

CN116452578BActive Publication Date: 2026-06-23GUANGDONG AOPUTE TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGDONG AOPUTE TECH CO LTD
Filing Date
2023-05-09
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

Existing technologies for defect detection in periodic texture images suffer from problems such as missed detections, high false detection rates, low detection efficiency, high computational costs, and a large demand for manual annotation.

Method used

By employing frequency domain image processing technology, and combining two-dimensional discrete Fourier transform and inverse Fourier transform with saturation subtraction and connected component analysis, defect detection of periodic texture images can be achieved, avoiding manual period calculation and reducing computational load and computational power requirements.

Benefits of technology

It improves detection efficiency, reduces detection costs, and does not rely on artificial intelligence models, thus ensuring the accuracy and completeness of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116452578B_ABST
    Figure CN116452578B_ABST
Patent Text Reader

Abstract

The application discloses a periodic texture image defect detection method, which comprises the following steps: obtaining a to-be-detected image f(x, y); performing reconstruction processing on the to-be-detected image f(x, y) to obtain a reconstructed image f'(x, y) of the to-be-detected image f(x, y); performing connected domain processing on the to-be-detected image f(x, y) and the reconstructed image f'(x, y) after saturation subtraction to obtain a first defect binary image; performing connected domain processing on the reconstructed image f'(x, y) and the to-be-detected image f(x, y) after saturation subtraction to obtain a second defect binary image; and performing bit-by-bit or operation on the first defect binary image and the second defect binary image to obtain a final defect binary image; the periodic texture image with defects is taken as an object, a traditional algorithm such as a frequency domain image processing technology is adopted to perform complete defect detection on the periodic texture image, and the edge position of the periodic texture image is not left in the detection process, so that the calculation amount is small and the algorithm cost is low during defect detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of visual defect detection technology, and in particular to a method for detecting defects in periodic texture images. Background Technology

[0002] Surface defect detection in industrial products has always been an important aspect of industrial production quality control. Many products, such as metal mesh, filter screens, and fabrics, have periodic textures on their surfaces. Current technologies for detecting defects on periodically textured surfaces mainly employ translation-subtraction methods, visual inspection, and deep learning methods.

[0003] The translation subtraction method highlights the defect location by translation subtraction. In the implementation process, the period of the pattern needs to be manually measured for translation. Moreover, translation will inevitably cause some areas at the edge to be undetectable. Furthermore, different images have different periods, which can easily lead to missed detections and false detections.

[0004] The manual visual inspection method has low detection efficiency in industrial production, and the error rate is high for periodic texture images.

[0005] Deep learning methods require extensive manual annotation of data in the early stages, posing significant computational demands and resulting in high learning costs. Furthermore, different types of periodic texture products require re-annotation and retraining of the network, leading to poor universality and inconvenience for industrial production. Summary of the Invention

[0006] The purpose of this invention is to provide a method for detecting defects in periodic texture images. This method uses periodic texture images with defects as the object and employs traditional algorithms such as frequency domain image processing technology to perform complete defect detection on the periodic texture images. The detection process does not miss the edge positions of the periodic texture images and does not require manual calculation of the period. The computational load is small and the computing power cost is low during defect detection. It does not require the introduction of artificial intelligence models, thereby avoiding reliance on training with large amounts of data and a large amount of manual annotation work. While ensuring detection accuracy, it greatly improves detection efficiency and reduces detection costs.

[0007] To achieve the above objectives, this invention discloses a method for detecting defects in periodic texture images, comprising the following steps:

[0008] S1. Obtain the image to be tested f(x,y), which has M rows and N columns of pixels, where x = 0, 1, ..., M-1, y = 0, 1, ..., N-1, and M and N are natural numbers greater than or equal to 1;

[0009] S2. Reconstruct the image f(x,y) to be tested to obtain the reconstructed image f'(x,y) of the image f(x,y);

[0010] S3. After saturating subtraction of the image to be tested f(x,y) and the reconstructed image f'(x,y), connected component processing is performed to obtain the first defect binary image;

[0011] S4. After saturating subtraction of the reconstructed image f'(x,y) and the image to be tested f(x,y), connected component processing is performed to obtain the second defect binary image;

[0012] S5. Perform a bitwise OR operation on the first defect binary image and the second defect binary image to obtain the final defect binary image.

[0013] Preferably, step S2 specifically includes:

[0014] S21. Perform a two-dimensional discrete Fourier transform on the image to be tested f(x,y) to obtain the first complex matrix F(u,v), where u=0,1,……,M-1,v=0,1,……,N-1;

[0015] S22. Based on the magnitude value |F(u,v)| of the first complex matrix F(u,v), perform pixel operations on the first complex matrix F(u,v) to obtain the second complex matrix F'(u,v);

[0016] S23. Perform a two-dimensional discrete Fourier inverse transform on the second complex matrix F'(u,v) to obtain the reconstructed image f'(x,y).

[0017] Specifically, according to the formula A two-dimensional discrete Fourier transform is performed on the image to be tested f(x,y) to obtain the first complex matrix F(u,v).

[0018] Specifically, the magnitude value |F(u,v)| of the first complex matrix F(u,v) is obtained through the following steps:

[0019] Formula Transform into

[0020] F(u,v)=R(u,v)+jI(u,v)=|F(u,v)|e jφ(u,v) ;

[0021] Change the formula F(u,v)=R(u,v)+jI(u,v)=|F(u,v)|e jφ(u,v) Transform into

[0022] |F(u,v)|=[R 2 (u,v)+I 2 (u,v)] 1 / 2Thus, the amplitude value |F(u,v)| of the first complex matrix F(u,v) is obtained.

[0023] Preferably, step S22 specifically includes:

[0024] S221. Based on the magnitude value |F(u,v)| of the first complex matrix F(u,v), perform a zeroing operation on the first complex matrix F(u,v) to obtain the second complex matrix F'(u,v).

[0025] Specifically, step S221 includes:

[0026] Using the magnitude value |F(u,v)| of the first complex matrix F(u,v) as a threshold, the first complex matrix F(u,v) is truncated to obtain the second complex matrix F'(u,v).

[0027] Preferably, according to the formula

[0028]

[0029] Perform a two-dimensional discrete Fourier inverse transform on the second complex matrix F'(u,v) to obtain the reconstructed image f'(x,y).

[0030] Preferably, step S3 specifically includes:

[0031] S31. Perform saturation subtraction on the image to be tested f(x,y) and the reconstructed image f'(x,y) to obtain image f1(x,y);

[0032] S32. Extract the bit layer of the image f1(x,y);

[0033] S33. Select a suitable bit layer from the bit layer of the image f1(x,y) to obtain a binarized image f2(x,y);

[0034] S34. Perform maximum or minimum value filtering on the binarized image f2(x,y) to obtain image f3(x,y);

[0035] S35. Perform connected component analysis on the image f3(x,y) to obtain the first defect binary image.

[0036] Preferably, step S4 specifically includes:

[0037] S41. Perform saturation subtraction between the reconstructed image f'(x,y) and the image to be tested f(x,y) to obtain the image f1'(x,y);

[0038] S42. Extract the bit layer of the image f1'(x,y);

[0039] S43. Select a suitable bit layer from the bit layer of the image f1'(x,y) to obtain a binarized image f2'(x,y);

[0040] S44. Perform maximum or minimum value filtering on the binarized image f2'(x,y) to obtain image f3'(x,y);

[0041] S45. Perform connected component analysis on the image f3'(x,y) to obtain the second defect binary image.

[0042] Specifically, connected component analysis of the image is performed through the following steps:

[0043] Each connected component of the image is labeled sequentially.

[0044] Calculate the area of ​​each connected region in the image;

[0045] Sort all connected components of the image in ascending order according to their area.

[0046] Remove the connected components with the largest area from the image;

[0047] Perform k-means binary clustering on the remaining connected components in the image to obtain the first and second classifications;

[0048] Calculate the total area of ​​all connected components under the first category, and calculate the total area of ​​all connected components under the second category;

[0049] The categories with larger total areas are designated as defect areas, and the categories with smaller total areas are designated as background areas.

[0050] Compared with existing technologies, this invention uses defective periodic texture images as the target and employs traditional algorithms such as frequency domain image processing technology to perform complete defect detection on periodic texture images. The detection process does not miss the edge positions of periodic texture images and does not require manual calculation of the period. The computational load is small and the computing power cost is low during defect detection. There is no need to introduce artificial intelligence models, thereby avoiding reliance on training with large amounts of data and a large amount of manual annotation work. While ensuring detection accuracy, it greatly improves detection efficiency and reduces detection costs. Attached Figure Description

[0051] Figure 1 This is a flowchart of the periodic texture image defect detection method of the present invention;

[0052] Figure 2 This is a schematic diagram of the image to be tested f(x,y) according to the present invention;

[0053] Figure 3This is a schematic diagram of the reconstructed image f'(x,y) of the present invention;

[0054] Figure 4 This is a schematic diagram of the image f1'(x,y) of the present invention;

[0055] Figure 5 This is a schematic diagram of the image f3'(x,y) of the present invention;

[0056] Figure 6 This is a schematic diagram of the second defect binary image of the present invention;

[0057] Figure 7 This is a schematic diagram of the final defect binary image of the present invention. Detailed Implementation

[0058] To illustrate the technical content, structural features, objectives, and effects of the present invention in detail, the following description is provided in conjunction with the embodiments and accompanying drawings.

[0059] Please see Figures 1-7 As shown, the periodic texture image defect detection method of this embodiment is used to detect defects in periodic texture images. The periodic texture image defect detection method includes the following steps:

[0060] S1. Obtain the image to be tested f(x,y), which has M rows and N columns of pixels, where x = 0, 1, ..., M-1, y = 0, 1, ..., N-1, and M and N are natural numbers greater than or equal to 1.

[0061] The image to be tested here, f(x,y), is the original image, i.e., a periodic texture image with defects, such as... Figure 2 As shown, this embodiment uses an image f(x,y) with a width and height of 1024 as an example. The matrix pixel values ​​of the image f(x,y) are as follows:

[0062]

[0063] S2. Perform reconstruction processing on the image to be tested f(x,y) to obtain the reconstructed image f'(x,y) of the image to be tested f(x,y).

[0064] Preferably, step S2 specifically includes:

[0065] S21. Perform a two-dimensional discrete Fourier transform on the image to be tested f(x,y) to obtain the first complex matrix F(u,v), where u=0,1,……,M-1,v=0,1,……,N-1.

[0066] Specifically, according to the formula Perform a two-dimensional discrete Fourier transform on the image to be tested f(x,y) to obtain the first complex matrix F(u,v).

[0067] S22. Based on the magnitude value |F(u,v)| of the first complex matrix F(u,v), perform pixel operations on the first complex matrix F(u,v) to obtain the second complex matrix F'(u,v).

[0068] Specifically, the magnitude value |F(u,v)| of the first complex matrix F(u,v) is obtained through the following steps:

[0069] Formula Transform into

[0070] F(u,v)=R(u,v)+jI(u,v)=|F(u,v)|e jφ(u,v) ;

[0071] Change the formula F(u,v)=R(u,v)+jI(u,v)=|F(u,v)|e jφ(u,v) Transform into

[0072] |F(u,v)|=[R 2 (u,v)+I 2 (u,v)] 1 / 2 Thus, the amplitude value |F(u,v)| of the first complex matrix F(u,v) is obtained.

[0073] Preferably, step S22 specifically includes:

[0074] S221. Based on the magnitude value |F(u,v)| of the first complex matrix F(u,v), perform a zeroing operation on the first complex matrix F(u,v) to obtain the second complex matrix F'(u,v).

[0075] Specifically, step S221 includes:

[0076] Using the magnitude value |F(u,v)| of the first complex matrix F(u,v) as a threshold, the first complex matrix F(u,v) is truncated to obtain the second complex matrix F'(u,v).

[0077] This embodiment uses a simple threshold truncation method. The first complex matrix F(u,v) is truncated using the modulus of the elements; in this embodiment, 100000 is chosen, thus obtaining the second complex matrix F'(u,v). The second complex matrix F'(u,v) is specifically as follows:

[0078]

[0079] S23. Perform a two-dimensional discrete Fourier inverse transform on the second complex matrix F'(u,v) to obtain the reconstructed image f'(x,y).

[0080] Preferably, according to the formula

[0081]

[0082] Performing a two-dimensional discrete inverse Fourier transform on the second complex matrix F'(u,v) yields the following: Figure 3 The reconstructed image f'(x,y) is shown.

[0083] S3. After saturating subtraction of the image to be tested f(x,y) and the reconstructed image f'(x,y), connected component processing is performed to obtain the first defect binary image.

[0084] Preferably, step S3 specifically includes:

[0085] S31. Perform saturation subtraction on the image to be tested f(x,y) and the reconstructed image f'(x,y) to obtain the image f1(x,y).

[0086] S32. Extract the bit layer of the image f1(x,y).

[0087] S33. Select a suitable bit layer from the bit layer of the image f1(x,y) to obtain a binarized image f2(x,y).

[0088] S34. Perform maximum value filtering on the binarized image f2(x,y), with the filtering kernel being: The image f3(x,y) is obtained.

[0089] It is understood that the defect in this embodiment is a bright spot defect, so the maximum value filter is selected for processing. For other images with dark spot defects, the maximum value filter or the minimum value filter can be selected for processing according to actual needs.

[0090] S35. Perform connected component analysis on the image f3(x,y) to obtain the first defect binary image.

[0091] Specifically, the connected component analysis of the image f3(x,y) is performed through the following steps:

[0092] Each connected component of the image f3(x,y) is labeled sequentially. Specifically, all connected components in the image f3(x,y) are labeled (0, 1, 2, ..., n), where the connected components labeled 0 are usually the background.

[0093] Calculate the area of ​​each connected component in the image. Specifically, perform area statistics on each labeled connected component, denoted as S0, S1, S2, ..., Sn.

[0094] Sort all connected components of the image in ascending order according to their area.

[0095] Remove the connected component with the largest area in the image. The first maximum value is usually the background. Remove the area value of the first connected component S0.

[0096] Perform k-means binary clustering on the remaining connected components in the image to obtain the first and second classifications;

[0097] Calculate the total area of ​​all connected components under the first category, and calculate the total area of ​​all connected components under the second category;

[0098] The category with the larger total area is designated as the defect area. The defect area is set to 255 (white), and the background area is set to 0 (black), thereby improving the contrast of the defect area and obtaining the first defect binary image.

[0099] S4. After saturating subtraction of the reconstructed image f'(x,y) and the image to be tested f(x,y), connected component processing is performed to obtain the second defect binary image.

[0100] Preferably, step S4 specifically includes:

[0101] S41. Perform a saturated subtraction between the reconstructed image f'(x,y) and the image to be tested f(x,y) to obtain the following result: Figure 4 The image shown is f1'(x,y).

[0102] S42. Extract the bit layer of the image f1'(x,y).

[0103] S43. Select a suitable bit layer from the bit layers of the image f1'(x,y) to obtain a binarized image f2'(x,y).

[0104] S44. Perform maximum value filtering on the binarized image f2'(x,y) to obtain the following... Figure 5 The image shown is f3'(x,y).

[0105] It is understood that the defect in this embodiment is a bright spot defect, so the maximum value filter is selected for processing. For other images with dark spot defects, the maximum value filter or the minimum value filter can be selected for processing according to actual needs.

[0106] S45. Perform connected component analysis on the image f3'(x,y) to obtain the second defect binary image.

[0107] Specifically, the connected component analysis of the image f3'(x,y) is performed through the following steps:

[0108] Each connected component of the image f3'(x,y) is labeled sequentially. Specifically, all connected components in the image f3'(x,y) are labeled (0, 1, 2, ..., n), where the connected components labeled 0 are usually the background.

[0109] Calculate the area of ​​each connected component in the image. Specifically, perform area statistics on each labeled connected component, denoted as S0, S1, S2, ..., Sn.

[0110] Sort all connected components of the image in ascending order according to their area.

[0111] Remove the connected component with the largest area in the image. The first maximum value is usually the background. Remove the area value of the first connected component S0.

[0112] Perform k-means binary clustering on the remaining connected components in the image to obtain the first and second classifications;

[0113] Calculate the total area of ​​all connected components under the first category, and calculate the total area of ​​all connected components under the second category;

[0114] The category with the larger total area is designated as the defect area. This defect area is set to 255 (white), while the background area is set to 0 (black), thereby increasing the contrast of the defect area and achieving the desired result. Figure 6 The second defect binary image is shown.

[0115] S5. Perform a bitwise OR operation on the first defect binary image and the second defect binary image to obtain the following: Figure 7 The final binary image of the defect shown here completes the defect detection.

[0116] Combination Figures 1-7 This invention takes defective periodic texture images as the object and uses traditional algorithms such as frequency domain image processing technology to perform complete defect detection on periodic texture images. The detection process does not leave the edge positions of periodic texture images and does not require manual calculation of the period. The computational load is small and the computing power cost is low during defect detection. There is no need to introduce artificial intelligence models, thereby avoiding reliance on training with a large amount of data and a large amount of manual annotation work. While ensuring detection accuracy, it greatly improves detection efficiency and reduces detection costs.

[0117] The above-disclosed embodiments are merely preferred embodiments of the present invention and should not be construed as limiting the scope of the present invention. Therefore, any equivalent variations made in accordance with the claims of the present invention are still within the scope of the present invention.

Claims

1. A method for detecting defects in periodic texture images, characterized in that, Includes the following steps: Obtain the image to be tested f(x,y), which has M rows and N columns of pixels, where x=0,1,……,M-1, y=0,1,……,N-1, and M and N are natural numbers greater than or equal to 1; The image to be tested, f(x,y), is reconstructed to obtain the reconstructed image f'(x,y). The image to be tested f(x,y) and the reconstructed image f'(x,y) are saturated and then connected component processing is performed to obtain the first defect binary image; After saturating subtraction of the reconstructed image f'(x,y) and the image to be tested f(x,y), connected component processing is performed to obtain the second defect binary image; Perform a bitwise OR operation on the first and second defect binary images to obtain the final defect binary image. The step of performing saturated subtraction between the image to be tested f(x,y) and the reconstructed image f'(x,y) followed by connected component processing to obtain the first defect binary image specifically includes: The image f(x,y) to be tested and the reconstructed image f'(x,y) are saturated and subtracted to obtain the image f1(x,y); Extract the bit layer of the image f1(x,y); Select a suitable bit layer from the bit layers of the image f1(x,y) to obtain the binarized image f2(x,y); The binarized image f2(x,y) is subjected to maximum or minimum value filtering to obtain image f3(x,y); Perform connected component analysis on the image f3(x,y) to obtain the first defect binary image; The step of performing saturated subtraction between the reconstructed image f'(x,y) and the image to be tested f(x,y) followed by connected component processing to obtain a second defect binary image specifically includes: The reconstructed image f'(x,y) and the image to be tested f(x,y) are saturated and subtracted to obtain the image f1'(x,y); Extract the bit layer of the image f1'(x,y); Select a suitable bit layer from the bit layers of the image f1'(x,y) to obtain the binarized image f2'(x,y); The binarized image f2'(x,y) is subjected to maximum or minimum value filtering to obtain image f3'(x,y); Connectivity analysis is performed on the image f3'(x,y) to obtain the second defect binary image; The following steps are used to perform connected component analysis on the image: Each connected component of the image is labeled sequentially. Calculate the area of ​​each connected region in the image; Sort all connected components of the image in ascending order according to their area. Remove the connected components with the largest area from the image; Perform k-means binary clustering on the remaining connected components in the image to obtain the first and second classifications; Calculate the total area of ​​all connected components under the first category, and calculate the total area of ​​all connected components under the second category; The categories with larger total areas are designated as defect areas, and the categories with smaller total areas are designated as background areas.

2. The method for detecting defects in periodic texture images as described in claim 1, characterized in that, The process of reconstructing the image f(x,y) to obtain the reconstructed image f'(x,y) specifically includes: Perform a two-dimensional discrete Fourier transform on the image to be tested f(x,y) to obtain the first complex matrix F(u,v), where u=0,1,……,M-1,v=0,1,……,N-1; Based on the magnitude value |F(u,v)| of the first complex matrix F(u,v), pixel operations are performed on the first complex matrix F(u,v) to obtain the second complex matrix F'(u,v); Perform a two-dimensional discrete Fourier inverse transform on the second complex matrix F'(u,v) to obtain the reconstructed image f'(x,y).

3. The periodic texture image defect detection method as described in claim 2, characterized in that, According to the formula A two-dimensional discrete Fourier transform is performed on the image to be tested f(x,y) to obtain the first complex matrix F(u,v).

4. The periodic texture image defect detection method as described in claim 3, characterized in that, The magnitude value |F(u,v)| of the first complex matrix F(u,v) is obtained through the following steps: Formula Transform into ; Formula Transform into Thus, the amplitude value |F(u,v)| of the first complex matrix F(u,v) is obtained.

5. The method for detecting defects in periodic texture images as described in claim 3, characterized in that, The step of performing pixel operations on the first complex matrix F(u,v) based on the magnitude value |F(u,v)| of the first complex matrix F(u,v) to obtain the second complex matrix F'(u,v) specifically includes: Based on the magnitude value |F(u,v)| of the first complex matrix F(u,v), the first complex matrix F(u,v) is set to zero to obtain the second complex matrix F'(u,v).

6. The method for detecting defects in periodic texture images as described in claim 5, characterized in that, The step of setting the first complex matrix F(u,v) to zero based on the magnitude value |F(u,v)| of the first complex matrix F(u,v) to obtain the second complex matrix F'(u,v) specifically includes: Using the magnitude value |F(u,v)| of the first complex matrix F(u,v) as a threshold, the first complex matrix F(u,v) is truncated to obtain the second complex matrix F'(u,v).

7. The method for detecting defects in periodic texture images as described in claim 2, characterized in that, According to the formula ; Perform a two-dimensional discrete Fourier inverse transform on the second complex matrix F'(u,v) to obtain the reconstructed image f'(x,y).