Image detection method, image detection device and storage medium

By calculating and median filtering the grayscale image difference value of the area to be measured on the surface of the object, generating a color difference distribution map and setting an image defect threshold, the problem that local color difference affects the accuracy of defect detection is solved, and higher defect detection accuracy is achieved.

CN119515757APending Publication Date: 2025-02-25SKYVERSE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311031100.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-15
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

When the prior art detects defects on the surface of an object, it is difficult to effectively reduce the impact of local chromatic aberration, resulting in inaccurate defect detection results.

Method used

By obtaining the grayscale images of any two areas to be measured on the surface of the object, and performing median filtering to obtain a color difference distribution map, the image defect threshold corresponding to the color difference is set based on the graph, and these thresholds are used for defect detection.

Benefits of technology

This method can effectively reduce the impact of local chromatic aberration on the surface of an object and improve the accuracy of defect detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119515757A_ABST
    Figure CN119515757A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses an image detection method, an image detection device and a storage medium, and is applied to the technical field of image detection. The method comprises the following steps: acquiring a first grayscale image and a second grayscale image of any two to-be-detected areas on the surface of a preset object; obtaining a gray scale difference image between the first gray scale image and the second gray scale image; performing median filtering on the gray difference image to obtain a corresponding chromatic aberration distribution diagram; and setting an image defect threshold value corresponding to the chromatic aberration based on the chromatic aberration distribution diagram, and performing defect detection on the surface of a preset object by using the image defect threshold value. The gray difference value is used as the color difference between the gray images of the to-be-detected area, the corresponding image defect threshold value is set based on the color difference, and when the image defect threshold value is used for defect detection, the influence of local color difference on the surface of an object can be reduced, and the defect detection accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of image detection technology, and in particular to an image detection method, an image detection device, and a storage medium. Background Art

[0002] At present, with the rapid development of mechanized production, mechanical equipment, daily necessities, chip integrated circuits, etc. have achieved mechanized mass production. However, some products have high requirements on surface shape, color, etc. Products produced by mechanization need to use image detection methods to detect defects on the product surface before they can leave the factory.

[0003] The existing defect detection method is to detect defects by comparing images of the product surface. There may be color differences between the images of the product surface. Usually, global processing is performed on images with color differences. If the color difference between the images is the global color difference of the product surface, the defect detection results will not be affected after global processing. However, if the color difference between the images is the local color difference of the product surface, the local color difference will affect the global processing, which may easily lead to inaccurate defect detection results. Summary of the invention

[0004] The embodiments of the present application provide an image detection method, an image detection device, and a storage medium, which can reduce the influence of local chromatic aberration on the surface of an object and improve the accuracy of defect detection.

[0005] The present application provides an image detection method, including:

[0006] Acquire a first grayscale image and a second grayscale image corresponding to any two areas to be measured on the surface of a preset object;

[0007] Acquire a grayscale difference image between the first grayscale image and the second grayscale image;

[0008] Performing median filtering on the grayscale difference image to obtain a corresponding color difference distribution map;

[0009] An image defect threshold corresponding to the color difference is set based on the color difference distribution map, and defect detection is performed on the preset object surface using the image defect threshold.

[0010] Furthermore, before acquiring the grayscale difference image, a step of performing translation alignment on the first grayscale image and the second grayscale image is also included, and the translation alignment processing process includes:

[0011] Acquire a sub-pixel offset of the second grayscale image relative to the first grayscale image;

[0012] Performing sub-pixel translation on the second grayscale image based on the sub-pixel offset so that the second grayscale image is aligned with the first grayscale image;

[0013] The aligned first grayscale image and the second grayscale image are used to obtain the grayscale difference image.

[0014] Furthermore, obtaining a sub-pixel offset of the second grayscale image relative to the first grayscale image includes:

[0015] The first grayscale image is used as an image template, and template matching is performed on the second grayscale image and the image template to obtain a sub-pixel offset of the second grayscale image relative to the first grayscale image.

[0016] Furthermore, the acquiring a grayscale difference image between the first grayscale image and the second grayscale image includes:

[0017] The grayscale difference image is obtained by subtracting the grayscale value of the second pixel in the first grayscale image from the grayscale value of the first pixel in the second grayscale image; wherein the first pixel corresponds to the second pixel.

[0018] Furthermore, the grayscale difference image is subjected to median filtering to obtain a corresponding color difference distribution map, including:

[0019] Obtaining the grayscale median value of the pixel area where the target pixel point in the grayscale difference image is located, wherein the target pixel point is any pixel point in the grayscale difference image;

[0020] The grayscale value of the target pixel is updated based on the grayscale median, the grayscale value of the target pixel is obtained through one update or multiple iterative updates, the updated grayscale value of the target pixel is used as the color difference of the target pixel, and the corresponding color difference distribution map is obtained.

[0021] Further, setting the image defect threshold corresponding to the color difference based on the color difference distribution map includes:

[0022] Identify a first pixel point in the color difference distribution map whose color difference is greater than a preset color difference threshold, and set the image defect threshold corresponding to the first pixel point to be less than the preset defect threshold;

[0023] A second pixel point in the color difference distribution map whose color difference is less than a preset color difference threshold is identified, and an image defect threshold corresponding to the second pixel point is set to be greater than the preset defect threshold.

[0024] Further, the using the image defect threshold to perform defect detection on the preset object surface includes:

[0025] Acquire a grayscale image corresponding to at least one area to be measured on the surface of the preset object;

[0026] Performing translation alignment on the grayscale image based on the color difference distribution map;

[0027] Comparing the grayscale value of a pixel in the aligned grayscale image with the image defect threshold of the corresponding pixel in the color difference distribution image;

[0028] Defect detection is performed on the surface of the preset object based on the comparison result.

[0029] Furthermore, the preset object includes a wafer, and the area to be tested is an area where a single wafer body is located on the wafer.

[0030] The present application also provides an image detection device, including:

[0031] A first acquisition unit is used to acquire a first grayscale image and a second grayscale image respectively corresponding to any two to-be-tested areas on a preset object surface;

[0032] A second acquisition unit, used for acquiring a grayscale difference image between the first grayscale image and the second grayscale image;

[0033] A filtering unit, used for performing median filtering on the grayscale difference image to obtain a corresponding color difference distribution map;

[0034] The detection unit is used to set an image defect threshold corresponding to the color difference based on the color difference distribution map, and use the image defect threshold to perform defect detection on the preset object surface.

[0035] Furthermore, it also includes a positioning unit;

[0036] The alignment unit is used to obtain a sub-pixel offset of the second grayscale image relative to the first grayscale image; perform sub-pixel translation on the second grayscale image based on the sub-pixel offset so that the second grayscale image is aligned with the first grayscale image; and the aligned first grayscale image and second grayscale image are used to obtain the grayscale difference image.

[0037] Furthermore, the filtering unit is specifically used to obtain the grayscale median of the pixel area where the target pixel point in the grayscale difference image is located, wherein the target pixel point is any pixel point in the grayscale difference image; based on the grayscale median, the grayscale value of the target pixel point is updated, and the grayscale value of the target pixel point is obtained through one update or multiple iterative updates, and the updated grayscale value of the target pixel point is used as the color difference of the target pixel point to obtain a corresponding color difference distribution map.

[0038] Furthermore, the detection unit is specifically used to confirm a first pixel point in the color difference distribution map whose color difference is greater than a preset color difference threshold, and set the image defect threshold corresponding to the first pixel point to be less than the preset defect threshold; confirm a second pixel point in the color difference distribution map whose color difference is less than a preset color difference threshold, and set the image defect threshold corresponding to the second pixel point to be greater than the preset defect threshold.

[0039] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium includes instructions, and when the instructions are executed by a processor on a computer, the method described above is implemented.

[0040] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:

[0041] In the present application, a first grayscale image and a second grayscale image of any two areas to be tested on the surface of a preset object are obtained; a grayscale difference image between the first grayscale image and the second grayscale image is obtained; the grayscale difference image is subjected to median filtering to obtain a corresponding color difference distribution map; an image defect threshold corresponding to the color difference is set based on the color difference distribution map, and the image defect threshold is used to perform defect detection on the surface of the preset object. The grayscale difference is used as the color difference between the grayscale images of the areas to be tested, and the corresponding image defect threshold is set based on the color difference. When the image defect threshold is used for defect detection, the influence of local color difference on the surface of the object can be reduced, thereby improving the accuracy of defect detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0043] Figure 1 A flowchart of an image detection disclosed in an embodiment of the present application;

[0044] Figure 2 A flowchart of another image detection disclosed in an embodiment of the present application;

[0045] Figure 3 A schematic diagram of an image processing disclosed in an embodiment of the present application;

[0046] Figure 4 A schematic diagram of an image detection device disclosed in an embodiment of the present application;

[0047] Figure 5 A schematic diagram of another image detection device disclosed in an embodiment of the present application. DETAILED DESCRIPTION

[0048] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0049] In the description of the embodiments of the present application, it should be noted that the terms "center", "up", "down", "left", "right", "vertical", "horizontal", "inside", "outside", etc. indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings. They are only for the convenience of describing the embodiments of the present application and simplifying the description, and do not indicate or imply that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation. Therefore, they cannot be understood as limitations on the embodiments of the present application.

[0050] In the description of the embodiments of the present application, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the embodiments of the present application can be understood according to specific circumstances.

[0051] The existing method of defect detection on the surface of an object is to detect defects by comparing images of the product surface. There may be color differences between images of the product surface. Usually, global processing is performed on images with color differences. If the color difference between the images is the global color difference of the product surface, the defect detection result will not be affected after global processing. However, if the color difference between the images is the local color difference of the product surface, the local color difference will affect the global processing, which may easily lead to inaccurate defect detection results. Therefore, the embodiment of the present application provides an image detection method that can reduce the impact of local color differences on the surface of an object and improve the accuracy of defect detection, such as Figure 1 As shown, the specific steps are as follows:

[0052] 101. Obtain a first grayscale image and a second grayscale image respectively corresponding to any two to-be-tested areas on a surface of a preset object.

[0053] When the embodiment of the present application performs defect detection on the surface of a preset object, a first grayscale image and a second grayscale image corresponding to any two areas to be tested on the surface of the preset object can be obtained, and multiple areas to be tested on the surface of the preset object can be scanned and imaged. Among them, the surface of the preset object is generally a flat surface of an object, such as a glass surface, a film surface, a steel plate surface or a wafer surface, which is not specifically limited here. Preferably, the shape and size of each area to be tested on the surface of the preset object are the same, the size and shape of the pattern on each area to be tested are also the same, and the pattern of each area to be tested corresponds to each other. Among them, there may be color difference between the two areas to be tested. For example, when the preset object is a wafer, the corresponding area to be tested can be the area where a single wafer body (die) is located on the wafer, and the shape and size of each wafer body on the wafer are generally the same, and the colors presented by different wafer bodies may be different, that is, there is a corresponding color difference between different wafer bodies, and the wafer surface can be scanned to determine the boundary corresponding to the area where the wafer body is located on the wafer, and obtain multiple areas to be tested on the wafer surface.

[0054] Among them, the first grayscale image and the second grayscale image corresponding to any two areas to be tested are single-channel images of the areas to be tested, and each pixel in the grayscale image uses a grayscale value to represent the color of the pixel. Grayscale value refers to the different degrees of grayness of each point on a black-and-white photo or a black-and-white image reproduced by a TV due to the different colors and brightness of each point in the scene. The logarithmic relationship between white and black is divided into several levels, called grayscale levels, generally ranging from 0 to 225. The color image of the area to be tested can be converted into a corresponding grayscale image by floating-point arithmetic, integer method, shift method or averaging method, which is not limited here. In the present application, it is also possible to first obtain a grayscale image of the surface of a preset object, detect the regional boundary lines on the surface of the preset object, and obtain multiple areas to be tested corresponding to the surface of the preset object.

[0055] 102. Obtain a grayscale difference image between the first grayscale image and the second grayscale image.

[0056] After obtaining the first grayscale image and the second grayscale image, a grayscale difference image between the first grayscale image and the second grayscale image can be obtained. Specifically, the pixel grayscale value of the first grayscale image can be subtracted from the pixel grayscale value of the second grayscale image to obtain a corresponding grayscale difference image. It can be understood that there are differences in the color difference corresponding to different colors in the image, and the grayscale value can be used to reflect the color. Therefore, in an embodiment of the present application, the grayscale difference between the two grayscale images can be used to reflect the color difference between the two grayscale images, that is, the size of the grayscale difference in the grayscale difference image can be used as the size of the color difference in the grayscale difference image, and the grayscale difference image can be used as the corresponding initial color difference distribution image.

[0057] 103. Perform median filtering on the grayscale difference image to obtain a corresponding color difference distribution map.

[0058] After obtaining the grayscale difference image, the grayscale difference image can be subjected to median filtering to obtain the corresponding color difference distribution map. It can be understood that in the grayscale difference image, there may be a relatively obvious gradient in the grayscale values ​​between different pixels. Directly using the grayscale difference as the corresponding color difference is prone to produce salt and pepper noise. However, median filtering the grayscale difference image, that is, using the median value in the adjacent area of ​​the pixel point as the grayscale value of the pixel point, can eliminate the influence of salt and pepper noise, and in the obtained color difference distribution map, the pixel area corresponding to the color difference can obtain a better preserved boundary.

[0059] 104. An image defect threshold corresponding to the color difference is set based on the color difference distribution map, and the image defect threshold is used to perform defect detection on a preset object surface.

[0060] After obtaining the color difference distribution map, the image defect threshold corresponding to the color difference can be set based on the color difference distribution map, and the image defect threshold is used to perform defect detection on the preset object surface. It can be understood that the image defect threshold corresponding to the color difference based on the color difference distribution map is to determine the pixel area with color difference in the color difference distribution map, that is, the pixel area corresponding to the grayscale difference in the color difference distribution map, and set the image defect threshold corresponding to the color difference in the pixel area. Generally, the image defect threshold in the pixel area is inversely proportional to the color difference corresponding to the pixel area, that is, the larger the color difference of the pixel area, the smaller the image defect threshold of the corresponding pixel area, so that when performing defect detection using the image defect threshold in the pixel area during image detection, the impact of color difference can be reduced.

[0061] It can be seen that in the present application, the first grayscale image and the second grayscale image of any two areas to be tested on the surface of the preset object are obtained; the grayscale difference image between the first grayscale image and the second grayscale image is obtained; the grayscale difference image is subjected to median filtering to obtain a corresponding color difference distribution map; the image defect threshold corresponding to the color difference is set based on the color difference distribution map, and the image defect threshold is used to perform defect detection on the surface of the preset object. The grayscale difference is used as the color difference between the grayscale images of the area to be tested, and the corresponding image defect threshold is set based on the color difference. When the image defect threshold is used for defect detection, the influence of local color difference on the surface of the object can be reduced, thereby improving the accuracy of defect detection.

[0062] Further, another embodiment will be described below, detailing the image detection process, such as Figure 2 As shown, the specific steps include:

[0063] 201. Obtain a first grayscale image and a second grayscale image corresponding to any two to-be-tested areas on a surface of a preset object.

[0064] It is understandable that step 201 is similar to the above step 101 and will not be described in detail here.

[0065] 202. Perform sub-pixel offset alignment based on a sub-pixel offset of the second grayscale image relative to the first grayscale image.

[0066] It is understandable that before obtaining the grayscale difference image, the first grayscale image and the second grayscale image may also be translated and aligned. It is understandable that the first grayscale image and the second grayscale image are grayscale images of any two areas to be measured on the surface of a preset object. There may be a pixel deviation between the first grayscale image and the second grayscale image, and translation and alignment are required. Among them, the second grayscale image can be translated based on the first grayscale image so that the second grayscale image is relative to the first grayscale image; the first grayscale image can also be translated based on the second grayscale image so that the first grayscale image is relative to the second grayscale image, and the specifics are not limited here. Among them, the relative position of the grayscale images can be understood as the matching of the patterns on the first grayscale image and the second grayscale image, or the matching of the image boundaries, and the specifics are not limited here.

[0067] Among them, sub-pixel offset alignment can be performed based on the sub-pixel offset of the second grayscale image relative to the first grayscale image. Specifically, the sub-pixel offset of the second grayscale image relative to the first grayscale image can be obtained, that is, the first grayscale image is used as an image template, and the second grayscale image is template matched with the image template to obtain the sub-pixel offset of the second grayscale image relative to the first grayscale image. During template matching, the correlation matrix of the two grayscale images can be calculated to find the maximum value of the correlation matrix or the centroid of the correlation matrix to obtain the sub-pixel offset. The second grayscale image is sub-pixel shifted based on the sub-pixel offset so that the second grayscale image is aligned with the first grayscale image, that is, the second grayscale image is Fourier transformed into the frequency domain, and then phase modulated based on the sub-pixel offset to achieve sub-pixel shift. After the sub-pixel offset alignment, there is no pixel deviation in the alignment between the first grayscale image and the second grayscale image, and the aligned first grayscale image and the second grayscale image are then used to obtain a grayscale difference image, so that a more accurate grayscale difference can be obtained.

[0068] 203. Subtract the grayscale value of the second pixel in the first grayscale image from the grayscale value of the first pixel in the second grayscale image to obtain a grayscale difference image.

[0069] The grayscale value of the first pixel in the second grayscale image can be subtracted from the grayscale value of the second pixel in the first grayscale image to obtain a grayscale difference image; wherein the first pixel corresponds to the second pixel, that is, the first pixel and the second pixel are located at the same position in the corresponding test area, and after translation and alignment, the first pixel can overlap with the second pixel. Figure 3As shown, when the preset object surface is a wafer surface, the area to be tested is a single wafer surface, and the grayscale images of any two wafer surfaces are a first grayscale image (die1) and a second grayscale image (die2). The grayscale value of the aligned pixel in the second grayscale image can be subtracted from the grayscale value of the corresponding pixel in the first grayscale image, and the obtained grayscale difference can be used as the color difference corresponding to the pixel in the two areas to be tested.

[0070] In one practicable manner, after the first grayscale image and the second grayscale image are aligned, the grayscale value of the first pixel in the second grayscale image is subtracted from the grayscale value of the second pixel in the first grayscale image to obtain a grayscale difference image. At this time, the first pixel and the second pixel are overlapping pixels on the two grayscale images after alignment, that is, the grayscale values ​​of the overlapping pixels after alignment are used for subtraction to obtain the grayscale difference image. Among them, the grayscale value of the first pixel in the second grayscale image can also be directly subtracted from the grayscale value of the second pixel in the first grayscale image to obtain the grayscale difference image. At this time, there is a pixel deviation between the second grayscale image and the first grayscale image, but because the first pixel to be subtracted corresponds to the second pixel, the grayscale difference image obtained by direct grayscale subtraction is the same as the grayscale difference image obtained by grayscale subtraction after alignment.

[0071] 204. Perform median filtering on the grayscale values ​​of the pixels in the grayscale difference image to update the grayscale values, and obtain a corresponding color difference distribution map.

[0072] After obtaining the grayscale difference image, the grayscale values ​​of the pixels in the grayscale difference image can be updated by median filtering to obtain the corresponding color difference distribution map. Specifically, the grayscale median of the pixel area where the target pixel in the grayscale difference image is located can be obtained, wherein the target pixel is any pixel in the grayscale difference image, and the pixel area can be a 3×3 pixel area or a 4×4 pixel area centered on the target pixel. Of course, the specific size of the pixel area can also be unlimited, and the grayscale median is the median corresponding to the grayscale value of the pixels contained in the pixel area; based on the grayscale median, the grayscale value of the target pixel is updated to obtain the grayscale value of the target pixel, and the updated grayscale value of the target pixel is used as the color difference of the target pixel to obtain the corresponding color difference distribution map. It can be understood that the grayscale value of the target pixel can be obtained by one update or multiple iterations, which is not limited here; preferably, the grayscale median of the target pixel and its surroundings can be calculated each time through the idea of ​​multiple iterations as the grayscale value of the target pixel, and after multiple times, a better color difference distribution map can be obtained. Compared with the grayscale difference image, the obtained color difference distribution map is flat inside and the pixel area boundary is well preserved, such as Figure 3 As shown, the grayscale difference between the pixel areas at the edge and the middle square is relatively large, that is, the corresponding color difference is relatively large.

[0073] 205. Set an image defect threshold of a pixel point in the color difference distribution map based on a preset color difference threshold.

[0074] After obtaining the color difference distribution map, the image defect threshold of the pixel point can be set in the color difference distribution map based on the preset color difference threshold. Specifically, the first pixel point in the color difference distribution map whose color difference is greater than the preset color difference threshold can be confirmed, and the image defect threshold corresponding to the first pixel point is set to be less than the preset defect threshold; the second pixel point in the color difference distribution map whose color difference is less than the preset color difference threshold is confirmed, and the image defect threshold corresponding to the second pixel point is set to be greater than the preset defect threshold. Among them, a pixel area integrating multiple adjacent pixels with the same color difference is determined, and an image defect value is set for the pixel area. It can be understood that if the color difference distribution map is a grayscale image, the preset color difference threshold can be expressed by a grayscale value, wherein the preset color difference threshold can be a grayscale value of 10 or 20. Of course, the specific data used here can also be not limited. The preset defect threshold is the image basic threshold used for image defect detection. Generally, if the grayscale value in the image is greater than the preset defect threshold, it is determined that there is a defect. That is, in the color difference distribution map, the image defect threshold corresponding to the pixel area with larger color difference can be set looser (such as the original image basic threshold multiplied by a coefficient of 0.8), and the image defect threshold corresponding to the pixel area with larger color difference can be set stricter (such as the original image basic threshold multiplied by a coefficient of 1.2).

[0075] 206. Compare the grayscale values ​​of the pixels in the grayscale image of the area to be tested with the corresponding image defect threshold, and perform defect detection on the preset object surface.

[0076] After obtaining the image defect threshold, the grayscale value of the pixel in the grayscale image of the area to be tested can be compared with the corresponding image defect threshold to perform defect detection on the preset object surface. Specifically, a grayscale image of at least one area to be tested on the preset object surface can be obtained; the grayscale image is translated and aligned based on the color difference distribution map (or template image), that is, the grayscale image of the area to be tested and the color difference distribution map need to be sub-pixel offset aligned so that there is no pixel deviation between the grayscale image of the area to be tested and the color difference distribution map. The grayscale value of the pixel in the aligned grayscale image is compared with the image defect threshold of the corresponding pixel in the color difference distribution image; based on the comparison result, the preset object surface is detected for defects.

[0077] It can be understood that the pixel points with color difference in the color difference distribution map have corresponding image defect thresholds. The grayscale value of the corresponding pixel point in the grayscale image of the area to be tested is compared with the corresponding image defect threshold. If the grayscale value is greater than the corresponding image defect threshold, it is determined that there is a defect in the area to be tested where the pixel point is located. By detecting the grayscale image of each area to be tested on the surface of the preset object, the defective area on the surface of the preset object can be accurately detected.

[0078] Based on the image detection methods of the various embodiments described above, the present application provides an image detection device, such as Figure 4 As shown, it mainly includes a first acquisition unit 401, a second acquisition unit 402, a filtering unit 403 and a detection unit 404, which are described below respectively.

[0079] The first acquisition unit 401 is used to acquire a first grayscale image and a second grayscale image respectively corresponding to any two to-be-tested areas on a preset object surface.

[0080] The second acquisition unit 402 is configured to acquire a grayscale difference image between the first grayscale image and the second grayscale image.

[0081] The filtering unit 403 is used to perform median filtering on the grayscale difference image to obtain a corresponding color difference distribution map.

[0082] The detection unit 404 is used to set an image defect threshold corresponding to the color difference based on the color difference distribution map, and use the image defect threshold to perform defect detection on the preset object surface.

[0083] Furthermore, the image detection device also includes a positioning unit; the positioning unit is used to obtain the sub-pixel offset of the second grayscale image relative to the first grayscale image; based on the sub-pixel offset, the second grayscale image is sub-pixel translated so that the second grayscale image is aligned with the first grayscale image; the aligned first grayscale image and the second grayscale image are used to obtain the grayscale difference image.

[0084] Furthermore, the filtering unit 403 is specifically used to obtain the grayscale median of the pixel area where the target pixel point in the grayscale difference image is located, wherein the target pixel point is any pixel point in the grayscale difference image; based on the grayscale median, the grayscale value of the target pixel point is updated, and the grayscale value of the target pixel point is obtained through one update or multiple iterative updates, and the updated grayscale value of the target pixel point is used as the color difference of the target pixel point to obtain a corresponding color difference distribution map.

[0085] Furthermore, the detection unit 404 is specifically used to confirm the first pixel point in the color difference distribution map whose color difference is greater than a preset color difference threshold, and set the image defect threshold corresponding to the first pixel point to be less than the preset defect threshold; confirm the second pixel point in the color difference distribution map whose color difference is less than the preset color difference threshold, and set the image defect threshold corresponding to the second pixel point to be greater than the preset defect threshold.

[0086] Of course, the specific functions of the first acquisition unit 401, the second acquisition unit 402, the filtering unit 403, the detection unit 404, and the alignment unit can refer to the corresponding content of the image detection method above, and will not be described in detail here.

[0087] The present application also provides an image detection device 500, such as Figure 5 As shown, the image detection device 500 of the embodiment of the present application may include one or more central processing units (CPU) 501 and a memory 502 , and the memory 502 stores one or more application programs or data.

[0088] The memory 502 may be a volatile storage or a persistent storage. The program stored in the memory 502 may include one or more modules, each of which may include a series of instruction operations in the electronic device. Furthermore, the central processing unit 501 may be configured to communicate with the memory 502 and execute a series of instruction operations in the memory 502 on the image detection device 500.

[0089] The image detection device 500 may also include one or more power supplies 505, one or more wired or wireless network interfaces 504, one or more input and output interfaces 503, and / or one or more operating systems, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.

[0090] The central processing unit 501 can execute the operations performed by any of the specific method embodiments described above, and the details will not be repeated here.

[0091] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0092] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0093] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0094] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0095] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, read-only memory), random access memory (RAM, random access memory), disk or optical disk and other media that can store program code.

Claims

1. An image detection method, characterized in that: include: Acquire a first grayscale image and a second grayscale image corresponding to any two areas to be measured on the surface of a preset object; Acquire a grayscale difference image between the first grayscale image and the second grayscale image; Performing median filtering on the grayscale difference image to obtain a corresponding color difference distribution map; An image defect threshold corresponding to the color difference is set based on the color difference distribution map, and defect detection is performed on the preset object surface using the image defect threshold.

2. The image detection method according to claim 1, characterized in that: Before acquiring the grayscale difference image, the method further includes performing a translation alignment step on the first grayscale image and the second grayscale image. The translation alignment process includes: Acquire a sub-pixel offset of the second grayscale image relative to the first grayscale image; Performing sub-pixel translation on the second grayscale image based on the sub-pixel offset so that the second grayscale image is aligned with the first grayscale image; The aligned first grayscale image and the second grayscale image are used to obtain the grayscale difference image.

3. The image detection method according to claim 2, characterized in that: The obtaining of the sub-pixel offset of the second grayscale image relative to the first grayscale image comprises: The first grayscale image is used as an image template, and template matching is performed on the second grayscale image and the image template to obtain a sub-pixel offset of the second grayscale image relative to the first grayscale image.

4. The image detection method according to any one of claims 1 to 3, characterized in that: The acquiring of a grayscale difference image between the first grayscale image and the second grayscale image comprises: The grayscale difference image is obtained by subtracting the grayscale value of the second pixel in the first grayscale image from the grayscale value of the first pixel in the second grayscale image; wherein the first pixel corresponds to the second pixel.

5. The image detection method according to claim 1, characterized in that: The performing median filtering on the grayscale difference image to obtain a corresponding color difference distribution map comprises: Obtaining the grayscale median value of the pixel area where the target pixel point in the grayscale difference image is located, wherein the target pixel point is any pixel point in the grayscale difference image; The grayscale value of the target pixel is updated based on the grayscale median, the grayscale value of the target pixel is obtained through one update or multiple iterative updates, the updated grayscale value of the target pixel is used as the color difference of the target pixel, and the corresponding color difference distribution map is obtained.

6. The image detection method according to claim 1, characterized in that: The setting of the image defect threshold corresponding to the color difference based on the color difference distribution map comprises: Identify a first pixel point in the color difference distribution map whose color difference is greater than a preset color difference threshold, and set the image defect threshold corresponding to the first pixel point to be less than the preset defect threshold; A second pixel point in the color difference distribution map whose color difference is less than a preset color difference threshold is identified, and an image defect threshold corresponding to the second pixel point is set to be greater than the preset defect threshold.

7. The image detection method according to claim 1, characterized in that: The using the image defect threshold to perform defect detection on the preset object surface includes: Acquire a grayscale image corresponding to at least one area to be measured on the surface of the preset object; Performing translation alignment on the grayscale image based on the color difference distribution map; Comparing the grayscale value of a pixel in the aligned grayscale image with the image defect threshold of the corresponding pixel in the color difference distribution image; Defect detection is performed on the surface of the preset object based on the comparison result.

8. The image detection method according to claim 1, characterized in that: The preset object includes a wafer, and the area to be tested is an area where a single wafer body is located on the wafer.

9. An image detection device, characterized in that: include: A first acquisition unit is used to acquire a first grayscale image and a second grayscale image respectively corresponding to any two to-be-tested areas on a preset object surface; A second acquisition unit, used for acquiring a grayscale difference image between the first grayscale image and the second grayscale image; A filtering unit, used for performing median filtering on the grayscale difference image to obtain a corresponding color difference distribution map; The detection unit is used to set an image defect threshold corresponding to the color difference based on the color difference distribution map, and use the image defect threshold to perform defect detection on the preset object surface.

10. The image detection device according to claim 9, characterized in that: Also includes a counterpoint unit; The alignment unit is used to obtain a sub-pixel offset of the second grayscale image relative to the first grayscale image; and perform sub-pixel translation on the second grayscale image based on the sub-pixel offset so that the second grayscale image is aligned with the first grayscale image; The aligned first grayscale image and the second grayscale image are used to obtain the grayscale difference image.

11. The image detection device according to claim 9, characterized in that: The filtering unit is specifically used to obtain the grayscale median value of the pixel area where the target pixel point in the grayscale difference image is located, wherein the target pixel point is any pixel point in the grayscale difference image; based on the grayscale median value, the grayscale value of the target pixel point is updated, and the grayscale value of the target pixel point is obtained through one update or multiple iterative updates, and the updated grayscale value of the target pixel point is used as the color difference of the target pixel point to obtain a corresponding color difference distribution map.

12. The image detection device according to claim 9, characterized in that: The detection unit is specifically used to confirm a first pixel point in the color difference distribution map whose color difference is greater than a preset color difference threshold, and set the image defect threshold corresponding to the first pixel point to be less than the preset defect threshold; confirm a second pixel point in the color difference distribution map whose color difference is less than the preset color difference threshold, and set the image defect threshold corresponding to the second pixel point to be greater than the preset defect threshold.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium comprises instructions, and when the instructions are executed by a processor on a computer, the method according to any one of claims 1 to 8 is implemented.