Chip surface flaw detection method and device based on image region difference and medium
By judging the difference between the area to be detected and the standard reference area in chip surface defect detection, and adjusting the position of the detection area when the difference is greater than a preset value, the problem of detection instability and false detection caused by chip template interference and poor consistency is solved, and efficient and accurate defect detection is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 恩纳基智能装备(无锡)股份有限公司
- Filing Date
- 2025-09-17
- Publication Date
- 2026-07-24
Smart Images

Figure CN121027147B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of chip surface defect detection technology, and in particular to a chip surface defect detection method, device and medium based on image region difference. Background Technology
[0002] In the semiconductor field, when detecting defects on the chip surface, the image region subtraction method, which involves taking two chip images of the same fixed position, is widely used due to its versatility in defect detection.
[0003] The image region subtraction method requires first acquiring a standard, flawless chip image as a matching template, and simultaneously defining the region to be detected on this image. This region typically corresponds to the chip's location within the entire image. By creating the template and defining the detection region, a mathematical positional relationship is established between the template region and the detection region, which can be represented by an affine transformation matrix. During real-time online detection, the acquired chip image is first matched using the template to locate its position. Then, the corresponding detection region in the real-time image is obtained using the affine transformation matrix and the previously defined detection region. The defined detection region is then subtracted from the real-time detection region. If a defect is present, the grayscale value after subtraction will not be zero, thus detecting the defect.
[0004] The key to defect detection using region subtraction lies in accurately locating the mapped region corresponding to the designated detection area, i.e., the target detection area, in the real-time detection image. Existing detection methods use template matching for localization. When there is interference in the area where the chip is used as a template, or when the chip itself has poor consistency, the template localization will have positional accuracy errors. This will also result in positional accuracy errors in the affine-mapped detection area, leading to instability in the detection results under critical conditions and a high probability of false detections. Summary of the Invention
[0005] In response to the aforementioned problems and technical requirements, the applicant has proposed a chip surface defect detection method, device, and medium based on image region difference to solve the problem of low defect accuracy in the prior art when there is interference in the area where the chip is used as a template or the chip itself has poor consistency, thereby achieving efficient and accurate defect detection on the chip surface.
[0006] This application provides a chip surface defect detection method based on image region difference, the method comprising:
[0007] Obtain the detection area and the preset standard reference area corresponding to the chip under test;
[0008] Determine whether the difference between the region to be detected and the standard reference region is greater than a first preset value;
[0009] If the difference is determined to be less than or equal to the first preset value, a chip surface defect detection operation is performed based on the area to be detected and the standard reference area.
[0010] If the difference is determined to be greater than the first preset value, the area to be detected is moved by a preset number of pixels in the four directions of front, back, left, and right, with each pixel as a unit, and the area to be detected after each movement is determined as the target detection area. Based on the target detection area and the standard reference area, a chip surface defect detection operation is performed, wherein the number of preset pixels is greater than or equal to 1.
[0011] The chip surface defect detection method based on image region difference provided in the embodiments of this application performs chip surface defect detection operations based on the target detection region and the standard reference region, including:
[0012] Perform the following area calculation process for each of the target detection regions and the standard parameter regions respectively:
[0013] Subtract the grayscale of the first pixel in the target detection region from the grayscale of the second pixel in the standard parameter region to obtain a first grayscale matrix; compare the value of each point in the first grayscale matrix with a second preset value; calculate the sum of the comparison results, and determine the area corresponding to the target detection region as the sum;
[0014] Chip surface defects are determined based on the area corresponding to all target detection regions.
[0015] The chip surface defect detection method based on image region difference provided in the embodiments of this application determines chip surface defects based on the area corresponding to all target detection areas, including:
[0016] Select the smallest area from all the target detection areas, and determine the chip location corresponding to the point in the first gray-scale matrix corresponding to the smallest area that is greater than the second preset value as the location of the defect.
[0017] According to the chip surface defect detection method based on image region difference provided in the embodiments of this application, the region to be detected is moved by a preset number of pixels in four directions (front, back, left, and right) in units of a single pixel, and the region to be detected after each movement is determined as the target detection region. Chip surface defect detection is then performed based on the target detection region and the standard reference region, including:
[0018] The movement prioritizes left and right directions, moving in the forward and backward direction. For each pixel moved, the following detection calculations are performed:
[0019] The moved area to be detected is defined as the target detection area. Chip surface defect detection is performed based on the target detection area and the standard reference area. Then, the area is moved by one pixel in the other direction. The moved area to be detected is defined as the target detection area. Chip surface defect detection is performed based on the target detection area and the standard reference area. This process is repeated until the area is moved by a preset number of pixels in each direction in the other direction.
[0020] Move a preset number of pixels in each of the preferred movement directions up to the specified number of times.
[0021] According to the chip surface defect detection method based on image region difference provided in the embodiments of this application, before moving the region to be detected by a preset number of pixels in four directions (front, back, left, and right) in units of a single pixel, and determining the region to be detected after each movement as the target detection region, the method further includes:
[0022] Calculate the relationship matrix based on the reference template position corresponding to the standard reference area and the detection position corresponding to the area to be detected;
[0023] The region to be detected is subjected to an affine operation using the relation matrix to obtain the affine region to be detected.
[0024] The step of moving the region to be detected by a preset number of pixels in four directions (front, back, left, and right) in units of a single pixel includes:
[0025] The affine region to be detected is moved by a preset number of pixels in each of the four directions (front, back, left, and right), with each pixel as a unit.
[0026] According to the chip surface defect detection method based on image region difference provided in the embodiments of this application, before determining whether the difference between the region to be detected and the standard reference region is greater than a first preset value, the method further includes:
[0027] Variance calculations are performed on pixels in the region to be detected and the standard reference region respectively to obtain the first variance corresponding to the region to be detected and the second variance corresponding to the standard reference region.
[0028] Calculate the variance difference between the first variance and the second variance, and determine the variance difference as the difference.
[0029] According to the chip surface defect detection method based on image region difference provided in the embodiments of this application, after obtaining the detection area and the preset standard reference area corresponding to the chip to be detected, the method further includes:
[0030] The region to be detected and the standard reference region are filtered separately to obtain the filtered region to be detected and the standard reference region.
[0031] The chip surface defect detection method based on image region difference provided in the embodiments of this application performs chip surface defect detection operations based on the region to be detected and the standard reference region, including:
[0032] Calculate the relationship matrix based on the reference template position corresponding to the standard reference area and the detection position corresponding to the area to be detected;
[0033] The region to be detected is subjected to an affine operation using the relation matrix to obtain the affine region to be detected.
[0034] Subtract the gray level of the third pixel of the affine region to be detected from the gray level of the second pixel of the standard parameter region one by one to obtain the second gray level matrix;
[0035] Each point in the second grayscale matrix is compared with the second preset value, and the chip position corresponding to the point that is greater than the second preset value is determined as the position where there is a defect.
[0036] This application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the steps of the chip surface defect detection method based on image region difference as described above.
[0037] This application also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the chip surface defect detection method based on image region difference as described above.
[0038] The chip surface defect detection method, device, and medium based on image region difference provided in this application obtain the detection area corresponding to the chip to be detected and a preset standard reference area (corresponding template); determine whether the difference between the detection area and the standard reference area is greater than a first preset value. This application determines whether there is interference in the area using the chip as a template or poor consistency of the chip itself by comparing the difference with the first preset value. If the difference is less than or equal to the first preset value (i.e., the above-mentioned problem does not exist), chip surface defect detection is performed directly based on the detection area and the standard reference area; if the difference is greater than the first preset value (i.e., the above-mentioned problem exists), the detection area is moved by a preset number of pixels in each of the four directions (front, back, left, and right), and the detection area after each movement is determined as the target detection area. Chip surface defect detection is performed based on the target detection area and the standard reference area. This application translates the detection area within a set range and then uses the moved detection area and the standard reference area to perform differential detection, which greatly eliminates the problems of unstable detection results and high false detection rate caused by the above-mentioned problems, and achieves efficient and accurate chip surface defect detection. Attached Figure Description
[0039] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. 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.
[0040] Figure 1 This is a schematic diagram of the template area and detection area provided in the embodiments of this application;
[0041] Figure 2 This is a schematic diagram of the area to be detected in real time, provided in an embodiment of this application;
[0042] Figure 3 This is a schematic diagram of the monitoring area when there is a positional deviation, as provided in the embodiments of this application;
[0043] Figure 4 This is one of the flowcharts of the chip surface defect detection method based on image region difference provided in the embodiments of this application;
[0044] Figure 5 This is the second flowchart of the chip surface defect detection method based on image region difference provided in the embodiments of this application;
[0045] Figure 6This application provides a third schematic flowchart of a chip surface defect detection method based on image region difference.
[0046] Figure 7 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0047] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0048] To clearly explain this application, the testing method is described in detail below:
[0049] First, acquire a flawless chip image (refer to the inspection image ImageA). Select the high-contrast Mark region in the image as the template region. Perform template matching on the current position of the template region and record the current position of the template region as (X). m ,Y m ), and determine the reference detection area.
[0050] Second, the area to be tested on the chip is determined manually, denoted as region D(X1,Y1,W,H), where (X1,Y1) represents the coordinates of the top-left corner of the region, W represents the width of the region, and H represents the height of the region. See details in [link to documentation]. Figure 1 .
[0051] in, Figure 1 The green box in the image represents the template area, with its center coordinates being (X). m ,Y m The red box indicates a situation where the reference detection area and the area to be detected overlap.
[0052] Third, after setting the above parameters, perform real-time online detection. During real-time online detection, the acquired images will be matched with a template to locate the center position (X) that matches the template. t ,Y t The angle is A. See details in [link / reference]. Figure 2 .
[0053] in, Figure 2 The green box in the image represents the area after the membrane template is matched, with its center coordinates being (X). t ,Y tThe red box indicates the case where the reference detection area overlaps with the area to be detected after mapping. The coordinates of the top-left corner of the area to be detected after mapping are (X...). S ,Y S ).
[0054] Fourth, based on the center coordinates (X) of the template m ,Y m ) and the center position (X) of the matched image to be detected t ,Y t ), calculate the relationship matrix between the two coordinates.
[0055] This relationship typically involves translation and rotation. The affine transformation matrix (relation matrix) can be decomposed into a rotation followed by a translation, as shown below:
[0056]
[0057] Among them, T x =X t -X m T y =Y t -Y m .
[0058] Fifth, multiply the affine transformation matrix with the image to be detected to obtain a new image to be detected after affine transformation. The region to be detected in the new image to be detected is usually made to completely overlap with the reference detection region when the chip has good consistency. For the specific formula of multiplication, please refer to formula (1):
[0059] ImageAc=Mat*ImageB………………(1)
[0060] Where ImageAc represents the image to be detected after affine transformation, ImageB represents the image to be detected before affine transformation, and Mat represents the affine transformation matrix.
[0061] Sixth, using the reference detection image ImageA and the affine image to be detected ImageAc as comparison images, and the detection area D as the detection object.
[0062] Subtract the pixel gray levels of the two regions in the two images one by one to obtain the detected region C, and obtain the region gray level matrix of region C, as shown in formula (2):
[0063] M c (i,j)=M A (i,j)-M Ac (i,j)…………(2)
[0064] Among them, i=i r i r+1 , ..., ir+W , j = j r j r+1 , ..., j r+H .
[0065] Among them, M A (i,j) represents the pixel gray level at (i,j) in the reference detection region, M Ac (i,j) represents the pixel gray level at (i,j) in the simulated image to be detected, M c (i,j) represents the grayscale matrix of region C.
[0066] 7. Compare each point p(i,j) in the grayscale matrix of the region with the preset threshold T (second preset value), binarize the comparison result, and calculate the area based on the binarization result.
[0067] Where p(i,j) represents the gray-level difference between the two regions at the image coordinates (i,j).
[0068] The comparison results are shown in formula (3):
[0069]
[0070] The area is calculated using formula (4):
[0071]
[0072] Furthermore, the size of the defect area is obtained based on the size of this area.
[0073] However, this algorithm suffers from false detections when performing region subtraction due to poor Mark consistency, which can lead to discrepancies between the reference detection region and the matched detection region. Figure 3 As shown, the edges of the misaligned areas show areas with higher brightness, leading to false detections.
[0074] To address the aforementioned problems, this application provides a chip surface defect detection method based on image region difference. This method can be applied to smart terminals and servers. This application uses the application of this method in a server as an example for illustration, and some other descriptions in the embodiments are illustrative and not intended to limit the scope of protection of this application, and will not be described in detail thereafter. The specific implementation of the method is as follows... Figure 4 As shown:
[0075] Step 401: Obtain the detection area and the preset standard reference area corresponding to the chip to be tested.
[0076] Step 402: Determine whether the difference between the area to be detected and the standard reference area is greater than the first preset value. If yes, proceed to step 403; otherwise, proceed to step 404.
[0077] Step 403: Move the area to be detected by a preset number of pixels in the four directions (front, back, left, and right) in units of a single pixel, and determine the area to be detected after each movement as the target detection area. Perform chip surface defect detection operation based on the target detection area and the standard reference area.
[0078] The number of preset pixels is greater than or equal to 1.
[0079] Step 404: Perform chip surface defect detection based on the area to be detected and the standard reference area.
[0080] The chip surface defect detection method based on image region difference provided in this application obtains the detection area corresponding to the chip to be detected and a preset standard reference area (corresponding template); determines whether the difference between the detection area and the standard reference area is greater than a first preset value. This application determines whether there is interference in the area using the chip as a template or poor consistency of the chip itself by comparing the difference with the first preset value. If the difference is less than or equal to the first preset value (i.e., the above problem does not exist), chip surface defect detection is performed directly based on the detection area and the standard reference area. If the difference is greater than the first preset value (i.e., the above problem exists), the detection area is moved by a preset number of pixels in the four directions (front, back, left, and right) in units of a single pixel, and the detection area after each movement is determined as the target detection area. Chip surface defect detection is performed based on the target detection area and the standard reference area. This application translates the detection area within a set range and then uses the moved detection area and the standard reference area to perform differential detection, which greatly eliminates the problems of unstable detection results and high false detection rate caused by the above problems, and achieves efficient and accurate chip surface defect detection.
[0081] In one specific embodiment, after obtaining the detection area and the preset standard reference area corresponding to the chip to be tested, filtering processing is performed on the detection area and the standard reference area respectively to obtain the filtered detection area and the standard reference area.
[0082] Specifically, the filtering process includes Gaussian filtering.
[0083] Specifically, Gaussian filtering is applied to both regions simultaneously to remove Gaussian noise interference caused by heat generated by external hardware such as lenses and light sources, thereby improving the accuracy of the region subtraction results.
[0084] Gaussian filtering is a linear convolution process. Given an input region R and a Gaussian kernel G of size (2k+1)*(2k+1), the filtered region R... i The calculation formula is shown in formula (5):
[0085]
[0086] Among them, R i (x,y) represents the filtered region, i = 1, 2, k represents a pre-set constant, R(x+i,y+j) represents a point in the input region, and G(i,j) represents the weight value of the Gaussian kernel at position (i,j).
[0087] Wherein, G(i,j) is obtained by a two-dimensional Gaussian function, see formula (6):
[0088]
[0089] Where σ represents the standard deviation.
[0090] This application applies Gaussian filtering to the high-frequency components in the detection area, thereby improving the stability and accuracy of defect detection.
[0091] In one specific embodiment, before determining whether the difference between the region to be detected and the standard reference region is greater than a first preset value, the difference between the region to be detected and the standard reference region is determined, specifically as follows: Figure 5 As shown:
[0092] Step 501: Calculate the variance of pixels in the detection area and the standard reference area respectively to obtain the first variance of the detection area and the second variance of the standard reference area.
[0093] Step 502: Calculate the variance difference between the first variance and the second variance, and determine the variance difference as the difference.
[0094] Specifically, the standard reference area is used as the reference variance after pixel variance calculation, and the variance of the area to be detected is compared with the reference variance after variance calculation.
[0095] The formula for calculating variance is shown in formula (7):
[0096]
[0097] Where, δ 2 Let represent the variance, N represent the total number of pixels in the region, N = W * H, u represent the average gray value of the region, and d(i,j) represent the gray value of the region at the image coordinate point (i,j).
[0098] The calculation of the average gray value is given by formula (8):
[0099]
[0100] In one specific embodiment, the implementation of chip surface defect detection based on the target detection area and the standard reference area includes:
[0101] Perform the following area calculation procedure for each target detection region and standard parameter region, respectively, see [link / reference]. Figure 6 :
[0102] Step 601: Subtract the grayscale of the first pixel in the target detection area from the grayscale of the second pixel in the standard parameter area to obtain the first grayscale matrix.
[0103] Step 602: Compare the point value of each point in the first grayscale matrix with the second preset value.
[0104] Step 603: Calculate the sum of the comparison results and determine the sum as the area corresponding to the target detection region.
[0105] Then, chip surface defects are determined based on the area corresponding to all target detection areas.
[0106] In one specific embodiment, the specific implementation of determining chip surface defects based on the area corresponding to all target detection areas includes:
[0107] Select the smallest area from all the target detection areas, and determine the chip location corresponding to the point in the first gray-scale matrix corresponding to the smallest area that is greater than the second preset value as the location of the defect.
[0108] Specifically, after performing an affine transformation on the image to be detected, the detection region is moved in four directions (forward, backward, left, right, up, down, left, and right) in pixels. For each pixel moved, the area is calculated by subtracting it from the standard reference region, and this area is saved. Finally, the minimum value of all calculated areas is taken as the detection result.
[0109] Based on the current matching position, for example, the range of movement in the forward and backward direction (up and down direction, vertical direction) is [-S, S], and the range of movement in the left and right direction (horizontal direction) is [-C, C].
[0110] Based on formula (9), iterate through all areas:
[0111]
[0112] The above formulas constitute formula (9).
[0113] The minimum area can be obtained from the above areas, as shown in formula (10):
[0114] S nin={S(0),S(1,Y S ),…,S(C,Y S ),S(-1,Y S ),…,S(-C,Y S ),
[0115] …,(X S ,1),…,S(X S ,S),S(x S ,-1),…,S(x S ,-S)
[0116] ……..…….…….…….…….…….…….…….(10)
[0117] This application uses the effective area obtained by subtracting the area after affine transformation from the standard reference area and comparing it with the second preset value, and takes the smallest area as the detection result. This can almost 100% eliminate the false detection problem caused by the deviation between the two subtracted areas due to the positioning deviation caused by product consistency differences.
[0118] In one specific embodiment, the area to be detected is moved by a preset number of pixels in four directions (front, back, left, and right), with each pixel representing a single pixel. The area to be detected after each movement is defined as the target detection area. The specific implementation of chip surface defect detection based on the target detection area and the standard reference area includes:
[0119] The movement prioritizes left and right directions, moving in the forward and backward direction. For each pixel moved, the following detection calculations are performed:
[0120] The moved area to be detected is defined as the target detection area. Chip surface defect detection is performed based on the target detection area and the standard reference area. Then, the area is moved one pixel in the other direction, and the moved area to be detected is defined as the target detection area. Chip surface defect detection is performed based on the target detection area and the standard reference area. This process is repeated until the area is moved a preset number of pixels in each direction in the other direction.
[0121] Move a preset number of pixels in each of the preferred movement directions up to the specified number of times.
[0122] For example, prioritizing left and right movement, the following detection calculation is performed after each pixel movement:
[0123] The moved area to be detected is defined as the target detection area. Chip surface defect detection is performed based on the target detection area and the standard reference area. Then, the area is moved one pixel in the forward and backward direction, and the moved area to be detected is defined as the target detection area. Chip surface defect detection is performed based on the target detection area and the standard reference area. This process is repeated until the area is moved a preset number of pixels in each forward and backward direction.
[0124] Finally, move the preset number of pixels in each direction (left and right) a certain number of times.
[0125] For example, if the movement is prioritized in the forward and backward directions, the following detection calculation is performed for each pixel moved:
[0126] The moved area to be detected is defined as the target detection area. Chip surface defect detection is performed based on the target detection area and the standard reference area. Then, the area is moved one pixel to the left and right. The moved area to be detected is defined as the target detection area. Chip surface defect detection is performed based on the target detection area and the standard reference area. This process is repeated until the area is moved a preset number of pixels in each direction.
[0127] Finally, the preset number of pixels is moved in each direction (front and back) a certain number of times.
[0128] Taking a preset pixel of 3 as an example, that is, the final movement is 36 times. This is only an example and is not intended to limit the scope of protection of this application. The preset pixel can also be 2, 4, etc.
[0129] In one specific embodiment, the region to be detected is moved by a preset number of pixels in each of the four directions (front, back, left, and right) in units of a single pixel. Before determining the region to be detected after each movement as the target detection region, a relation matrix is calculated based on the reference template position corresponding to the standard reference region and the detection position corresponding to the region to be detected. The relation matrix is then used to perform an affine operation on the region to be detected to obtain the affine region to be detected. The affine region to be detected is then moved by a preset number of pixels in each of the four directions (front, back, left, and right) in units of a single pixel.
[0130] In one specific embodiment, the implementation of chip surface defect detection based on the area to be detected and a standard reference area includes:
[0131] Based on the reference template position corresponding to the standard reference area and the detection position corresponding to the detection area, a relation matrix is calculated; an affine operation is performed on the detection area using the relation matrix to obtain the affine detection area; the gray level of the third pixel of the affine detection area is subtracted from the gray level of the second pixel of the standard parameter area to obtain the second gray level matrix; each point in the second gray level matrix is compared with the second preset value, and the chip position corresponding to the point that is greater than the second preset value is determined as the position where there is a defect.
[0132] During real-time detection, when chip inconsistency is poor or there is significant chip interference, and the lighting is slightly unstable due to the quality of imaging hardware such as the camera, lens, and light source (due to light source attenuation and external natural light interference), the grayscale of the edge information imaged for template localization will vary by about 10 gray levels. This variation directly affects template localization, leading to positional deviations in the detection area after affine transformation based on the template localization information. This results in inconsistent detection results, exhibiting a phenomenon where the results are sometimes good and sometimes bad. This directly impacts the stability of the overall detection equipment's repeatability. As a core indicator of any device, detection stability is arguably the most important of all indicators. This application addresses this by shifting the affine-transformed detection area within a set range (up, down, left, and right) before re-performing differential detection with a set reference detection area. This significantly eliminates the detection uncertainty caused by poor chip inconsistency and improves the robustness of the detection algorithm.
[0133] When poor chip consistency or significant chip interference affects positioning, subtracting the reference detection area from the real-time affine target detection area can lead to severe false detections. This application significantly reduces the false detection rate by minimizing the pixel grayscale difference area obtained after further shifting and subtracting the target detection area within a set range.
[0134] Figure 7 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 7 As shown, the electronic device may include a processor 701, a communications interface 702, a memory 703, and a communication bus 704. The processor 701, communications interface 702, and memory 703 communicate with each other via the communication bus 704. The processor 701 can call logic instructions stored in the memory 703 to execute a chip surface defect detection method based on image region difference.
[0135] Furthermore, the logical instructions in the aforementioned memory 703 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0136] On the other hand, the present invention also provides a computer program product, the computer program product including a computer program stored on a non-transitory computer-readable storage medium, the computer program including program instructions, and when the program instructions are executed by a computer, the computer is able to execute the chip surface defect detection method based on image region difference provided by the above methods.
[0137] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform the chip surface defect detection method based on image region difference provided in the above embodiments.
[0138] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0139] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0140] Finally, it should be noted that the above descriptions are merely preferred embodiments of this application, and this application is not limited to the above embodiments. It is understood that other improvements and variations directly derived or conceived by those skilled in the art without departing from the spirit and concept of this application should be considered to be included within the protection scope of this application.
Claims
1. A chip surface defect detection method based on image region difference, characterized in that, The method includes: Obtain the detection area and the preset standard reference area corresponding to the chip under test; Determine whether the difference between the region to be detected and the standard reference region is greater than a first preset value; If the difference is determined to be less than or equal to the first preset value, a chip surface defect detection operation is performed based on the area to be detected and the standard reference area. If the difference is determined to be greater than the first preset value, the area to be detected is moved by a preset number of pixels in the four directions of front, back, left, and right, with each pixel as a unit, and the area to be detected after each movement is determined as the target detection area. Based on the target detection area and the standard reference area, chip surface defect detection is performed, wherein the number of preset pixels is greater than or equal to 1. The chip surface defect detection operation based on the target detection area and the standard reference area includes: Perform the following area calculation process for each of the target detection regions and the standard reference regions respectively: Subtract the grayscale of the first pixel in the target detection region from the grayscale of the second pixel in the standard reference region to obtain a first grayscale matrix; compare the value of each point in the first grayscale matrix with a second preset value; calculate the sum of the comparison results, and determine the area corresponding to the target detection region as the sum of the results; Select the smallest area from all the target detection areas, and determine the chip location corresponding to the point in the first gray-scale matrix corresponding to the smallest area that is greater than the second preset value as the location of the defect.
2. The chip surface defect detection method based on image region difference according to claim 1, characterized in that, The area to be detected is moved by a preset number of pixels in each of the four directions (front, back, left, and right), and the area to be detected after each movement is determined as the target detection area. Based on the target detection area and the standard reference area, chip surface defect detection is performed, including: Move forward and backward, and left and right. Perform the following detection calculations for each pixel movement: The moved area to be detected is defined as the target detection area. Chip surface defect detection is performed based on the target detection area and the standard reference area. Then, the area is moved one pixel in the other direction, and the moved area to be detected is defined as the target detection area. Chip surface defect detection is performed based on the target detection area and the standard reference area. This process is repeated until the area is moved a preset number of times in each direction.
3. The chip surface defect detection method based on image region difference according to claim 1, characterized in that, Before moving the region to be detected by a preset number of pixels in each of the four directions (front, back, left, and right) and determining the region to be detected after each movement as the target detection region, the process further includes: Calculate the relationship matrix based on the reference template position corresponding to the standard reference area and the detection position corresponding to the area to be detected; The region to be detected is subjected to an affine operation using the relation matrix to obtain the affine region to be detected. The step of moving the region to be detected by a preset number of pixels in four directions (front, back, left, and right) in units of a single pixel includes: The affine region to be detected is moved by a preset number of pixels in each of the four directions (front, back, left, and right), with each pixel as a unit.
4. The chip surface defect detection method based on image region difference according to claim 1, characterized in that, Before determining whether the difference between the region to be detected and the standard reference region is greater than a first preset value, the method further includes: Variance calculations are performed on pixels in the region to be detected and the standard reference region respectively to obtain the first variance corresponding to the region to be detected and the second variance corresponding to the standard reference region. Calculate the variance difference between the first variance and the second variance, and determine the variance difference as the difference.
5. The chip surface defect detection method based on image region difference according to claim 1, characterized in that, After obtaining the detection area and the preset standard reference area corresponding to the chip under test, the process also includes: The region to be detected and the standard reference region are filtered separately to obtain the filtered region to be detected and the standard reference region.
6. The chip surface defect detection method based on image region difference according to claim 1, characterized in that, The chip surface defect detection operation is performed based on the area to be detected and the standard reference area, including: Calculate the relationship matrix based on the reference template position corresponding to the standard reference area and the detection position corresponding to the area to be detected; The region to be detected is subjected to an affine operation using the relation matrix to obtain the affine region to be detected. The grayscale value of the third pixel in the affine region to be detected is subtracted from the grayscale value of the second pixel in the standard reference region to obtain the second grayscale matrix. Each point in the second grayscale matrix is compared with the second preset value, and the chip position corresponding to the point that is greater than the second preset value is determined as the position where there is a defect.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the chip surface defect detection method based on image region difference as described in any one of claims 1 to 6.
8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the steps of the chip surface defect detection method based on image region difference as described in any one of claims 1 to 6.