Defect detection method for periodically arranged products

By processing images of periodically arranged products, including tilt correction, downsampling, and frequency domain autocorrelation analysis, combined with edge detection and dynamic thresholding, efficient and accurate defect detection is achieved, solving the problems of low efficiency and high false detection rate in existing technologies.

CN121329952APending Publication Date: 2026-01-13XIAMEN WEIXINTAI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511582387.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-31
Publication Date
2026-01-13

AI Technical Summary

Technical Problem

Existing defect detection methods are difficult to adapt to the needs of multi-model products in automated production, have low efficiency, and rely on manual inspection which is prone to errors.

Method used

By acquiring the original image of the product, converting it to grayscale and calculating the tilt angle, and then performing downsampling and frequency domain autocorrelation analysis after eliminating the tilt, the size of the periodic structure is determined. The image region is then translated along the direction of the periodic structure to extract defects and restore them to the original image. Finally, edge detection and dynamic thresholding are used to extract the defects.

Benefits of technology

It achieves fast and accurate defect detection, reduces missed and false detections, improves detection efficiency, reduces computational complexity, and reduces the need for manually creating templates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121329952A_ABST
    Figure CN121329952A_ABST
Patent Text Reader

Abstract

The invention discloses a defect detection method for periodically-arranged products, and the method comprises the steps: obtaining an original image of a product, and converting the original image into a gray-scale map to obtain a first image; and calculating the inclination angle of the product in the first image, and eliminating the inclination of the product in the first image to obtain a second image. Down-sampling the second image to obtain a third image; the third image is converted from the spatial domain to the frequency domain, the autocorrelation of the image is calculated in the frequency domain to obtain a fourth image, and the fourth image can highlight the periodic structure in the image. And searching a local maximum value closest to the original point in the fourth image so as to determine the size of the periodic structure. Restoring the obtained size information of the periodic structure to the scale of the second image; and according to the size of the periodic structure and along the arrangement direction of the periodic structure, carrying out translation operation on the image area, obtaining a first screenshot and a second screenshot, then extracting defects, and restoring the defects to a second image so as to obtain a real defect image and accurately extract the defects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of defect detection, and more specifically to a method for detecting defects in periodically arranged products. Background Technology

[0002] In modern industry, periodically arranged products such as electronic circuit boards, wafers, and conductive films play a crucial role, their quality directly impacting product performance and reliability. Taking electronic circuit boards as an example, they serve as the supporting and connecting platform for electronic components in electronic devices, and their quality determines the stability and lifespan of these devices. High-quality electronic circuit boards can operate stably under various environmental conditions, while low-quality boards may lead to equipment malfunctions or even complete failure. Similarly, the quality of conductive films determines their performance in fields such as touchscreens and solar cells. High-quality conductive films possess high conductivity and transparency, ensuring efficient equipment operation. Defect detection allows for the timely identification of flaws in the production process, ensuring products meet quality standards. This is significant for improving production efficiency and reducing costs. Traditional defect detection methods typically rely on manual labor, which is inefficient and prone to errors. Modern defect detection technologies, such as those based on image processing, can achieve automated detection, quickly and accurately identifying defects. This not only improves detection efficiency but also reduces rework and scrap due to quality issues, lowering production costs.

[0003] Existing detection methods involve creating templates from acquired standard images and comparing them with test images to determine defect locations. However, template matching technology is difficult to adapt to the needs of multi-model production in automated manufacturing, requiring the creation of corresponding templates based on product models, which results in low efficiency. Summary of the Invention

[0004] The purpose of this invention is to overcome the aforementioned defects or problems existing in the prior art or to provide a material basis for overcoming the aforementioned defects or problems existing in the prior art, and to provide a defect detection method for periodically arranged products.

[0005] To achieve the above objectives, the present invention and its preferred embodiments employ the following technical solutions, but the embodiments are not limited to the following solutions:

[0006] Option 1: A defect detection method for periodically arranged products.

[0007] Obtain the original image of the product, convert it to grayscale to obtain the first image, calculate the tilt angle of the product in the first image, and remove the tilt of the product in the first image to obtain the second image;

[0008] The second image is downsampled to obtain the third image. The third image is transformed from the spatial domain to the frequency domain. The autocorrelation of the image is calculated in the frequency domain to obtain the fourth image. The local maxima closest to the origin are found in the fourth image to determine the size of the periodic structure. The size information of the obtained periodic structure is restored to the scale of the second image.

[0009] Based on the size of the periodic structure, the image region is translated along the arrangement direction of the periodic structure to obtain a first screenshot and a second screenshot; defects are extracted, and the defects extracted from the first and second screenshots are restored onto the second image to obtain the true defect image; the translation distance is equal to an integer multiple of the size of the periodic structure.

[0010] Option 2, based on Option 1, applies Fast Fourier Transform to transform the third image from the spatial domain to the frequency domain.

[0011] Option 3, based on Option 1, extracts the product edges using an edge detection algorithm, fits a straight line or finds the minimum bounding rectangle of the product, and calculates the product's tilt angle based on the above features.

[0012] Option 4, based on Option 1, involves transforming the first image using image geometric operations or affine transformation methods according to the calculated tilt angle of the product, in order to eliminate the tilt of the product and obtain the second image.

[0013] Option 5, based on Option 1, achieves downsampling through pixel extraction or by using a Gaussian pyramid.

[0014] Option 6, based on Option 1, involves shifting the image region in both positive and negative directions along the arrangement direction of the periodic structure.

[0015] Solution 7 addresses the shortcomings of Solution 1 by using dynamic thresholding, hysteresis thresholding, or binarization extraction to achieve the set threshold.

[0016] Scheme 8, based on Scheme 1, intersects the translated region and the image region to obtain a first difference region and a second difference region respectively; uses the first difference region and the second difference region to crop the image on the second image to obtain a first screenshot and a second screenshot respectively; performs absolute value difference operation on the first screenshot and the second screenshot to obtain a difference image; extracts defects that reach a certain set threshold from the difference image; restores the extracted defects to the second image to obtain a first defect image and a second defect image respectively; takes the intersection of the first defect image and the second defect image to obtain the real defect image.

[0017] Scheme 9, based on Scheme 8, uses the first differential region as the detection region, with the first screenshot as the detection image and the second screenshot as the template image. The defect is directly restored to the second image to obtain the first defect image. When the second differential region is used as the detection region, the second screenshot is the detection image and the first screenshot is the template image. The defect is restored to the second image by translating the size of a periodic structures to obtain the second defect image. When the second screenshot is obtained by translating the size of a periodic structures, the restoration process requires translating the size of a periodic structures.

[0018] As can be seen from the above description of the present invention and its preferred embodiments, compared with the prior art, the technical solution of the present invention and its preferred embodiments have the following beneficial effects due to the adoption of the following technical means:

[0019] A defect detection method for periodically arranged products.

[0020] Obtain the original image of the product, convert it to grayscale to obtain the first image, which will facilitate subsequent processing.

[0021] Calculating the tilt angle of the product in the first image and eliminating the tilt of the product in the first image to obtain the second image can effectively improve the accuracy of subsequent image processing.

[0022] Since the process of determining the size of the periodic structure does not focus on the location of the defect, and in order to reduce computational complexity and improve processing efficiency, the second image is downsampled to obtain the third image.

[0023] The third image is transformed from the spatial domain to the frequency domain, and the autocorrelation of the image is calculated in the frequency domain to obtain the fourth image, which can highlight the periodic structure in the image.

[0024] In the fourth image, the nearest local maxima to the origin are searched to determine the size of the periodic structure; these maxima typically correspond to periodic structures in the image. By analyzing the locations of these maxima, the size of the periodic structure can be determined.

[0025] The size information of the obtained periodic structure is restored to the scale of the second image for subsequent use;

[0026] Based on the size of the periodic structure, the image region is translated along the arrangement direction of the periodic structure to obtain the first and second screenshots. Defects are then extracted, and the defects extracted from the first and second screenshots are restored onto the second image to obtain the true defect image. Defects are extracted from both the first and second screenshots to prevent missed detections and thus accurately extract defects. The translation distance is equal to an integer multiple of the size of the periodic structure to prevent information loss. Attached Figure Description

[0027] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments are briefly introduced. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0028] Figure 1 This is the first image after grayscale processing in Example 1;

[0029] Figure 2 This is the corrected second image from Example 1;

[0030] Figure 3 This is the scaled-down third image from Example 1;

[0031] Figure 4 This is the fourth image after autocorrelation calculation processing in Example 1;

[0032] Figure 5 The periodic structural dimensions are those in Example 1;

[0033] Figure 6 This is a schematic diagram of the differential region in Example 1;

[0034] Figure 7 This refers to the absolute value difference structure in Example 1;

[0035] Figure 8 This is a defect diagram from Example 1;

[0036] Figure 9 This is a defective result from Example 1.

[0037] Figure 10 This is a flowchart of a defect detection method for periodically arranged products in Example 1. Detailed Implementation

[0038] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are preferred embodiments of the present invention and should not be considered as excluding other embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0039] Unless otherwise expressly defined, the use of terms such as "first," "second," or "third" in the claims, description, and accompanying drawings of this invention is for distinguishing different objects and not for describing a specific order.

[0040] Unless otherwise expressly defined, in the claims, description, and accompanying drawings of this invention, the use of directional terms such as "center," "lateral," "longitudinal," "horizontal," "vertical," "top," "bottom," "inner," "outer," "upper," "lower," "front," "rear," "left," "right," "clockwise," and "counterclockwise" to indicate orientation or positional relationships is based on the orientation and positional relationships shown in the accompanying drawings and is only for the convenience of describing the invention and simplifying the description, and is not intended to indicate or imply that the device or element referred to must have a specific orientation or be constructed and operated in a specific orientation, and therefore should not be construed as limiting the specific scope of protection of this invention.

[0041] Unless otherwise expressly defined, the terms "fixed connection" or "fixed connection" used in the claims, description and drawings of this invention should be interpreted broadly to refer to any connection in which there is no displacement or relative rotation relationship between the two parties, including non-removable fixed connection, detachable fixed connection, integral connection and fixed connection by other means or components.

[0042] In the claims, description and accompanying drawings of this invention, the terms "comprising," "having," and variations thereof are used to mean "including but not limited to."

[0043] refer to Figures 1-10 A defect detection method for periodically arranged products includes an image correction method, a periodic structure size determination method, and a self-differentiation method. The following will elaborate on each method in detail with examples of conductive film products; however, it should be noted that the technical solution of this patent is not limited to conductive film products.

[0044] Image correction methods include the following steps:

[0045] refer to Figure 1 The original image of the product is acquired through an image acquisition device and converted into a grayscale image to obtain the first image;

[0046] Calculate the tilt angle of the product in the first image: Specifically, image processing techniques, such as edge detection algorithms, are used to extract the product edges and fit straight lines or find the minimum bounding rectangle of the product to remove burrs, jagged edges, etc. Based on these features, the tilt angle of the product is calculated to provide a basis for subsequent image correction.

[0047] refer to Figure 2To eliminate the product's tilt in the first image and obtain the second image: Specifically, based on the calculated tilt angle of the product, image geometric operations or affine transformations are used to transform the first image to eliminate the tilt and obtain the second image. For example, a rotation matrix can be used to rotate the image to a horizontal position, thus obtaining the corrected second image. This process can effectively improve the accuracy of subsequent image processing. The reason for product tilt is that when the automated mechanism receives the material, it cannot guarantee that the product is perfectly aligned. Therefore, the acquired product image may have some degree of tilt. According to the needs of subsequent processing, the product image needs to be corrected to facilitate subsequent translation of the detection area in all directions.

[0048] The method for determining the dimensions of periodic structures includes the following steps:

[0049] refer to Figure 3 Since the process of determining the size of the periodic structure does not focus on the defect location, and to reduce computational complexity and improve processing efficiency, the second image is downsampled at a large scale to obtain the third image. Downsampling can be achieved through various methods, such as simple pixel extraction or using a Gaussian pyramid. By downsampling, a lower-resolution third image is obtained, which is helpful for subsequent Fast Fourier Transform and autocorrelation calculations. The scale is an open-ended parameter, its size mainly influenced by the smallest unit in the product; when the smallest unit size is small, the scale is small, and when the smallest unit size is large, the scale is large.

[0050] refer to Figure 4 Applying a Fast Fourier Transform (FFT) to the third image transforms it from the spatial domain to the frequency domain. The autocorrelation of the image is then calculated in the frequency domain to obtain the fourth image, which highlights the periodic structure within the original image. Specifically, the grayscale value at point (x, y) in the fourth image can be understood as the correlation value obtained by horizontally shifting the image by x and vertically shifting it by y, and then performing a correlation operation with the original image. The specific calculation method involves multiplying the shifted image pixel-by-pixel and summing the results. This method is quite complex. Converting it to the frequency domain significantly reduces the computational complexity; multiplying the frequency domain signal by its complex conjugate completes the calculation. Finally, inversely transforming the frequency domain signal back to the spatial domain yields the autocorrelation image (the fourth image).

[0051] refer to Figure 5In the fourth image, the nearest local maxima to the origin are found. These maxima typically correspond to periodic structures in the image. By analyzing the positions of these maxima, the size of the periodic structure is determined. The obtained size information of the periodic structure is then restored to the scale of the second image for subsequent defect detection. In the figure, the green crosses mark the locations of the found local maxima, where the size of the periodic structure corresponds to the arrow positions. It should be understood that the size of the periodic structure is usually the smallest periodic structure that makes up the product, but periodic structures composed of two or more smallest periodic structures can also be used in subsequent processing. The origin is the top-left corner of the autocorrelation image. The origin in the autocorrelation image has a high gray value because this point represents the correlation between the unmoved image and itself. If there is a rectangular structure with a periodic width w and height h in the original image, a high correlation value will also be obtained at the (w,h) position in the autocorrelation image. The size of the periodic structure can be obtained by finding the nearest local maxima to the origin in the autocorrelation image. When the correlation is poor, the local maxima will be very small; a threshold parameter can be set to filter out erroneous local maxima.

[0052] The self-difference method includes the following steps:

[0053] Along the arrangement direction of the periodic structure, the image region is translated in both positive and negative directions. The translation distance is an integer multiple of the size of the periodic structure, including 1. In this embodiment, the translation is one size of the periodic structure. The translated region intersects with the image region to obtain the first difference region and the second difference region, respectively. Figure 6 As shown in the diagram, the blue dashed lines can be interpreted as the height of the periodic structure. The first difference region can be understood as the original image with the height of the periodic structure cropped out from the bottom, and the second difference region can be understood as the original image with the height of the periodic structure cropped out from the top. It should be understood that the regions obtained after translating the image region in both positive and negative directions are not the same as the first and second difference regions. After translation, the parts intersecting with the image region are calculated as the two difference regions, which correspond to the range of the screenshot.

[0054] For example (this example is only for understanding the scheme and is not the specific scheme when performing normal operation): Assume the image region is 0-10; translate in the positive direction to obtain region 1: 1-11; translate in the negative direction to obtain region 2: -1-9; region 1 intersects with the image region to obtain the first difference region: 1-10; region 2 intersects with the image region to obtain the second difference region: 0-9.

[0055] Of course, the left and right sides can also be periodically cropped according to the arrangement pattern. The first and second difference regions are the same size. The image region is the area where the product is located in the image. This area can be obtained by separating the product from the background region through simple image processing such as binarization and thresholding.

[0056] The first and second difference regions are used to crop the image onto the second image to obtain the first and second screenshots respectively. Due to the translation operation, it is necessary to note that the position of the defect on the second screenshot differs from that of the second image by a periodic structural dimension. This dimension will be needed when restoring the defect onto the second image later.

[0057] refer to Figure 7 The difference image is obtained by performing absolute value difference operation on the first and second screenshots;

[0058] refer to Figure 8 Defects reaching a certain threshold are extracted from the difference image to obtain a defect image. Specifically, defects reaching a certain threshold can be extracted using dynamic thresholding, hysteresis thresholding, or binarization. Dynamic thresholding, hysteresis thresholding, and binarization are methods for extracting specified grayscale regions from the image. The range of this threshold is between 0 and 255. The purpose of this threshold is to extract defects. The following example illustrates the function of this threshold: After the above series of image processing, assuming the grayscale range of the defect in the defect image is between 100 and 180, and the grayscale range of the background is between 0 and 50, a threshold range such as 80-255 can be set to extract the defect area within the grayscale range of 100-180, while filtering out the background area between 0 and 50, thus obtaining an accurate defect. It should be noted that when a defect is located in both the first and second screenshots, two identical defects will be extracted into the defect image, one in the first screenshot and one in the second screenshot.

[0059] The defects extracted from the defect image are restored onto the second image. When the first difference region is used as the detection region, the first screenshot serves as the detection image, and the second screenshot serves as the template image. The defects are directly restored to the second image to obtain the first defect image. When the second difference region is used as the detection region, the second screenshot serves as the detection image, and the first screenshot serves as the template image. The defects are restored to the second image by translating by the size of a periodic structure to obtain the second defect image. Since the above method involves translating by the size of a periodic structure to obtain the second screenshot, the restoration process also requires translating by the size of a periodic structure. When the second screenshot is obtained by translating by the size of a periodic structures, the restoration process also requires translating by the size of a periodic structures.

[0060] refer to Figure 9The actual defects are located at the same position in the first and second defect images, but the defect positions in the template images are different. Therefore, the intersection of the first and second defect images is used to obtain the actual defect image. In the actual defect image, the extracted defects are filled with pure white, and some obvious extracted defects are marked with red outlines.

[0061] The following example illustrates the solution (this example is only for understanding the solution and is not a specific solution for normal operation): In the original diagram, 0 represents a defect.

[0062] Original image: 1, 2, 3, 4, 0, 5, 6, 7, 8, 9;

[0063] First screenshot: 1, 2, 3, 4, 0, 5, 6, 7, 8;

[0064] Second screenshot: 2, 3, 4, 0, 5, 6, 7, 8, 9;

[0065] Perform an absolute value difference analysis on the first and second screenshots:

[0066] Difference image: 1, 1, 1, 4, 5, 1, 1, 1, 1;

[0067] Binarization: Set values ​​greater than 2 to 1, and all others to 0;

[0068] Defect diagram: 0, 0, 0, 1, 1, 0, 0, 0;

[0069] The defect is restored to the original image; * indicates that zeros are added during restoration.

[0070] First defect diagram: 0, 0, 0, 1, 1, 0, 0, 0, *;

[0071] Second defect diagram: *, 0, 0, 0, 1, 1, 0, 0, 0, 0;

[0072] The intersection of the first and second defect maps yields the actual defect.

[0073] Intersection graph: 0, 0, 0, 0, 1, 0, 0, 0, 0, where 1 represents the actual defect.

[0074] Using the above method, defects in periodic products can be extracted quickly and accurately without the need for manual template creation, reducing the time required for defect identification by 65% ​​compared to traditional Fast Fourier Transform. Taking the processing of a 9344*7000 image as an example, the Fast Fourier Transform and inverse transform alone take 600ms, while using this solution, the defect detection time is only about 200ms.

[0075] Compared with the prior art, this embodiment has the following advantages:

[0076] In one exemplary embodiment, a defect detection method for periodically arranged products is provided.

[0077] Obtain the original image of the product, convert it to grayscale to obtain the first image, which will facilitate subsequent processing.

[0078] Calculating the tilt angle of the product in the first image and eliminating the tilt of the product in the first image to obtain the second image can effectively improve the accuracy of subsequent image processing.

[0079] Since the process of determining the size of the periodic structure does not focus on the location of the defect, and in order to reduce computational complexity and improve processing efficiency, the second image is downsampled to obtain the third image.

[0080] The third image is transformed from the spatial domain to the frequency domain, and the autocorrelation of the image is calculated in the frequency domain to obtain the fourth image, which can highlight the periodic structure in the image.

[0081] In the fourth image, the nearest local maxima to the origin are searched to determine the size of the periodic structure; these maxima typically correspond to periodic structures in the image. By analyzing the locations of these maxima, the size of the periodic structure can be determined.

[0082] The size information of the obtained periodic structure is restored to the scale of the second image for subsequent use;

[0083] Based on the size of the periodic structure, the image region is translated along the arrangement direction of the periodic structure to obtain the first and second screenshots. Defects are then extracted, and the defects extracted from the first and second screenshots are restored onto the second image to obtain the true defect image. Defects are extracted from both the first and second screenshots to prevent missed detections and thus accurately extract defects. The translation distance is equal to an integer multiple of the size of the periodic structure to prevent information loss.

[0084] In one exemplary embodiment, the third image is transformed from the spatial domain to the frequency domain using Fast Fourier Transform. After downsampling, the Fourier Transform time can be reduced by a factor of two. Since the Fourier Transform is only used to determine the size of the periodic structure and is not used for defect detection, there will be no problem of missed detection.

[0085] In one exemplary embodiment, the product edge is extracted by an edge detection algorithm. The product edge extracted by the edge detection method is usually irregular and has burrs, jagged edges, etc. By fitting a straight line or finding the minimum bounding rectangle of the product, the influence of burrs, jagged edges, etc. can be removed, which facilitates the subsequent calculation of the tilt angle. Thus, the tilt angle of the product can be calculated based on the above features.

[0086] In one exemplary embodiment, based on the calculated tilt angle of the product, the first image is transformed using image geometric operations or affine transformation methods to eliminate the tilt of the product and obtain the second image, which is simple and convenient.

[0087] In one exemplary embodiment, downsampling is achieved through pixel extraction or by using a Gaussian pyramid, which is simple and convenient.

[0088] In one exemplary embodiment, the image region is translated in both positive and negative directions along the arrangement direction of the periodic structure to facilitate calculation and prevent omissions.

[0089] In one exemplary embodiment, defects that reach a set threshold are extracted using dynamic thresholding, hysteresis thresholding, or binarization, thereby obtaining accurate defects.

[0090] In one exemplary embodiment, the translated region and the image region intersect to obtain a first difference region and a second difference region, respectively; the first difference region and the second difference region are used to crop the image on the second image to obtain a first screenshot and a second screenshot, respectively; the first screenshot and the second screenshot are used to perform an absolute value difference operation to obtain a difference image; defects that reach a set threshold are extracted from the difference image; the extracted defects are restored to the second image to obtain a first defect image and a second defect image, respectively; the real defect is located at the same position in the first defect image and the second defect image, but the defect position in the template image is different, so the intersection of the first defect image and the second defect image is taken to obtain the real defect image.

[0091] In one exemplary embodiment, when the first difference region is used as the detection region, the first screenshot is the detection image and the second screenshot is the template image. The defect is directly restored to the second image to obtain the first defect image. When the second difference region is used as the detection region, the second screenshot is the detection image and the first screenshot is the template image. The defect is restored to the second image by translating the size of a periodic structure to obtain the second defect image. The two are templates for each other, and there is no need to manually create a template. When the second screenshot is obtained by translating the size of a periodic structure, it is necessary to translate the size of a periodic structure to restore it.

[0092] The foregoing description of the specifications and embodiments is intended to explain the scope of protection of this invention, but does not constitute a limitation on the scope of protection of this invention. Modifications, equivalent substitutions, or other improvements to the embodiments of this invention or a portion thereof that can be obtained by those skilled in the art through logical analysis, reasoning, or limited experimentation, based on the teachings of this invention or the foregoing embodiments, in conjunction with common knowledge, general technical knowledge, and / or existing technology, should all be included within the scope of protection of this invention.

Claims

1. A defect detection method for periodically arranged products, characterized in that: Obtain the original image of the product, convert it to grayscale to obtain the first image, calculate the tilt angle of the product in the first image, and remove the tilt of the product in the first image to obtain the second image; The second image is downsampled to obtain the third image. The third image is transformed from the spatial domain to the frequency domain. The autocorrelation of the image is calculated in the frequency domain to obtain the fourth image. The local maxima closest to the origin are found in the fourth image to determine the size of the periodic structure. The size information of the obtained periodic structure is restored to the scale of the second image; Based on the size of the periodic structure, the image region is translated along the arrangement direction of the periodic structure to obtain the first and second screenshots. Defects are extracted, and the defects extracted from the first and second screenshots are restored onto the second image to obtain the true defect image; the translation distance is equal to an integer multiple of the size of the periodic structure.

2. The defect detection method for periodically arranged products as described in claim 1, characterized in that: The third image is transformed from the spatial domain to the frequency domain by applying Fast Fourier Transform.

3. The defect detection method for periodically arranged products as described in claim 1, characterized in that: The product edges are extracted using an edge detection algorithm, and a straight line is fitted or the minimum bounding rectangle of the product is obtained. The tilt angle of the product is then calculated based on the above features.

4. The defect detection method for periodically arranged products as described in claim 1, characterized in that: Based on the calculated tilt angle of the product, the first image is transformed using image geometric operations or affine transformation methods to eliminate the tilt of the product and obtain the second image.

5. The defect detection method for periodically arranged products as described in claim 1, characterized in that: Downsampling can be achieved through pixel extraction or by using a Gaussian pyramid.

6. The defect detection method for periodically arranged products as described in claim 1, characterized in that: The image region is translated in both positive and negative directions along the arrangement direction of the periodic structure.

7. The defect detection method for periodically arranged products as described in claim 1, characterized in that: The limitations of achieving a set threshold through dynamic thresholding, hysteresis thresholding, or binarization extraction.

8. The defect detection method for periodically arranged products as described in claim 1, characterized in that: The first difference region and the second difference region are obtained by intersecting the translated region and the image region, respectively. The first and second difference regions are used to crop the image from the second image to obtain the first and second screenshots respectively; the absolute value difference operation is performed on the first and second screenshots to obtain the difference image; Defects that reach a set threshold are extracted from the difference image; the extracted defects are restored onto the second image to obtain the first defect image and the second defect image respectively; the intersection of the first defect image and the second defect image is used to obtain the real defect image.

9. The defect detection method for periodically arranged products as described in claim 8, characterized in that: When the first difference region is used as the detection region, the first screenshot is the detection image and the second screenshot is the template image. The defect is directly restored to the second image to obtain the first defect image. When the second difference region is used as the detection region, the second screenshot is the detection image and the first screenshot is the template image. By translating the size of a periodic structures, the defect is restored to the second image to obtain the second defect image. When the second screenshot is obtained by translating the size of a periodic structures, it is necessary to translate the size of a periodic structures to restore it.