System and method for selective SEM autofocusing

By analyzing and comparing the measurement results and adjusting the focus conditions, the problem of automatic focus failure on the electronic device with limited structural features is solved, and the accurate inspection and measurement of the circuit layer characteristics is achieved.

CN112840433BActive Publication Date: 2024-12-24APPLIED MATERIALS INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201980067572.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2018-10-15
Filing Date
2019-09-30
Publication Date
2024-12-24
Estimated Expiration
2039-09-30

AI Technical Summary

Technical Problem

When an electronic device has a limited number of structural features, the autofocus operation may fail, resulting in the scanning electron microscope being unable to accurately verify the circuit layer characteristics.

Method used

By acquiring the preliminary SEM image of the sample, the comparison changes in measurements are analyzed to determine the region of interest, and the focus conditions are adjusted based on this to obtain a more detailed image, ensuring that the optimal focus parameters are obtained in areas with rich structural features.

Benefits of technology

The automatic focusing capability on electronic devices with limited structural features is improved, ensuring accurate inspection and measurement of circuit layer features.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112840433B_ABST
    Figure CN112840433B_ABST
Patent Text Reader

Abstract

A system and method for focusing a scanning electron microscope (SEM) includes acquiring a first SEM image of a sample using a first focus condition; analyzing the first SEM image to determine contrast change measurements; determining a region of interest based on the contrast change measurements; adjusting the SEM from the first focus condition to a second focus condition based at least in part on the region of interest, wherein the first focus condition is different from the second focus condition; and acquiring a second SEM image of the sample using the second focus condition.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] background

[0002] field

[0003] Embodiments of the present disclosure relate generally to apparatus and methods for focusing a scanning electron microscope (SEM), and more particularly to a selective focusing system and method for a scanning electron microscope.

[0004] Description of related technologies

[0005] In various examples, SEM is used to inspect circuit layer features of electronic devices. For example, SEM can be used to inspect electrodes, transistors and / or connectors of electronic devices. In various examples, SEM acquires multiple images, which are processed to determine the best focus condition of SEM. Various autofocus methods can be used to determine the sharpness (or contrast) gradient of each image and the best focus condition of SEM. SEM uses the best focus condition to obtain an image with sharp circuit layer features in the image, and the image will support image processing algorithms for defect review (DR) and / or critical dimension (CD) measurement.

[0006] The best focusing condition can generally be found by changing the focus influencing parameters of the SEM. For example, the objective current of the SEM, the accelerating voltage of the SEM, the working distance of the SEM and / or other focus influencing parameters of the SEM can be changed. Generally speaking, during the autofocus operation, one or more focus influencing parameters of the SEM are changed when acquiring images. The images are processed to find the image with the highest level of sharpness (or contrast) gradient. Generally speaking, only a portion of each image is processed to increase the speed of the autofocus operation. Furthermore, the focus condition of the SEM is set to the focus condition for acquiring the image with the highest sharpness gradient.

[0007] Although the above-described focusing operation is generally capable of determining the optimal focusing condition of the SEM device, in the case of an electronic device having a limited number of structural features (e.g., circuit features), the autofocus may fail because the portion of each image analyzed may have a low sharpness gradient. The autofocus may fail because the sharpness gradient of each image may not show that the SEM can be focused using any image. Therefore, since the autofocus may fail to be performed on an electronic device having a limited number of structural features, the SEM may not be able to accurately inspect the circuit layer features of the electronic device.

[0008] However, a need exists for an improved autofocus operation that is usable with electronic devices having a limited number of structural features so that circuit layer features of these electronic devices can be inspected.

[0009] Overview

[0010] In one embodiment, a method for focusing a scanning electron microscope (SEM) includes acquiring a first SEM image of a sample using a first focus condition; analyzing the first SEM image to determine a plurality of contrast change measurements; determining a region of interest based on the contrast change measurements; adjusting the SEM from the first focus condition to a second focus condition based at least in part on the region of interest, wherein the first focus condition is different from the second focus condition; and acquiring a second SEM image of the sample using the second focus condition.

[0011] In one embodiment, a computer program product for focusing a scanning electron microscope (SEM) includes a non-transitory computer readable storage medium having computer readable program code embodied therein. The computer readable program code is executable by one or more computer processors to acquire a first SEM image of a sample using a first focus condition; analyze the first SEM image to determine a plurality of contrast change measurements; determine a region of interest based on the contrast change measurements; adjust the SEM from the first focus condition to a second focus condition based at least in part on the region of interest, wherein the first focus condition is different from the second focus condition; and acquire a second image of the sample using the second focus condition.

[0012] A testing apparatus includes a scanning electron microscope (SEM); and a processing system coupled to the SEM and configured to acquire a first SEM image of a sample using a first focus condition; analyze the first SEM image to determine a plurality of contrast change measurements; determine a region of interest based on the contrast change measurements; adjust the SEM from the first focus condition to a second focus condition based at least in part on the region of interest, wherein the first focus condition is different from the second focus condition; and acquire a second image of the sample using the second focus condition.

[0013] BRIEF DESCRIPTION OF THE DRAWINGS

[0014] In order that the above-mentioned features of the present disclosure may be understood in detail, a more specific description of the present disclosure briefly summarized above may be obtained by reference to the embodiments, some of which are illustrated in the accompanying drawings. It is noted, however, that the accompanying drawings illustrate only typical embodiments of this disclosure and are not to be considered as limiting the scope of the present disclosure, as the present disclosure may admit to other equally effective embodiments.

[0015] Figure 1is a block diagram of an imaging device according to one or more embodiments.

[0016] Figure 2 An example field of view is illustrated in accordance with one or more implementations.

[0017] Figure 3 Example graphs illustrating contrast gradients in accordance with one or more implementations.

[0018] Figure 4 A method of focusing an imaging device according to one or more embodiments is illustrated.

[0019] Figure 5 An example FOV is illustrated in accordance with one or more implementations.

[0020] To facilitate understanding, identical reference numerals have been used, where possible, to designate identical elements that are common to the figures. It will be appreciated that elements disclosed in one embodiment may be beneficially utilized in other embodiments without specific recitation thereto.

[0021] Specific instructions

[0022] Embodiments of the present disclosure generally relate to improved autofocus techniques for scanning electron microscopes (SEMs). The autofocus techniques described herein improve the ability to focus the SEM when the sample has a limited amount of electronic layer features (for example, structural features). For example, the autofocus technique uses a coarse image that may be slightly out of focus to determine an area of ​​the image that includes circuit layer features. A region of interest (ROI) may be determined based on this area, and one or more images of the ROI may then be used to determine optimal focus parameters for the SEM.

[0023] Figure 1 An exemplary imaging device 100 is shown. The imaging device 100 includes a SEM 110 and a processing system 130. In one embodiment, the SEM 110 includes an electron gun 120, a lens assembly 122, a stage 126, and a detector assembly 128. The SEM 110 is coupled to the processing system 130. In one embodiment, a sample 124 to be inspected may be located on the stage 126. Furthermore, the SEM 110 may be configured to acquire one or more images of the sample 124.

[0024] In one embodiment, the electron gun 120 may include a field emission gun (cathode), but is not limited thereto. The electron gun 120 may be configured to output a primary electron beam as a predetermined emission current. In one embodiment, an accelerating voltage is applied between the cathode and anode of the electron gun 120 to output the beam 112 toward the lens assembly 122.

[0025] The beam 112 may be shaped by a lens assembly 122 before the beam is emitted onto the sample 124. In one embodiment, the lens assembly 122 may be configured to converge the beam and / or eliminate unwanted regions of the beam before the beam is scanned onto the sample 124.

[0026] The lens assembly 122 may be adjustable to control the focus of the beam 112 produced by the electron gun 120 .

[0027] like Figure 1 , the SEM 110 may be configured to output a single beam 112. In other embodiments, the SEM 110 may be a multi-beam imaging device. In such embodiments, the electron gun 120 may output multiple beams. In other embodiments, the lens assembly 122 may be configured to separate the beam provided by the electron gun 120 into multiple beams.

[0028] In one or more embodiments, sample 124 can be any object to be inspected by imaging device 100. For example, in one embodiment, sample 124 can be a substrate having one or more layers, including one or more circuit elements. The circuit elements can include traces, electrodes, transistors, connectors, and the like. In a specific embodiment, sample 124 is a display panel having a glass substrate. Different layers of the glass substrate can have different circuit elements. For example, various layers can include gates, sources, transistors, pixel electrodes, and / or connectors.

[0029] The detector assembly 128 can acquire one or more images of the sample 124 located on the platform 126. The detector assembly 128 receives the signal 114 from the sample 124. In one embodiment, the beam 112 causes a corresponding signal, such as the signal 114. The images acquired by the detector assembly 128 can be output to the processing system 130, where the images can be analyzed. In one or more embodiments, the detector assembly 128 is configured to acquire images with various different focus conditions. Furthermore, the detector assembly 128 can be configured to acquire a single image of the sample 124 based on the best focus condition.

[0030] In one or more embodiments, the detector assembly 128 has a field of view (FOV) that corresponds to the size of an image acquired using the detector assembly 128 .

[0031] The processing system 130 may control the functions of the SEM 110. The processing system 130 may include a programmable central processing unit (CPU) 132 that is operable with a memory 134. In various embodiments, the processing system 130 may be referred to as a controller. The processing system 130 may additionally include or be configured to communicate with a mass storage device (not shown), an input control unit, and a display unit (not shown), such as clocks, caches, input / output (I / O) circuits, and the like, coupled to various components of the SEM 110 to facilitate control of the SEM 110. The processing system 130 further includes support circuits (not shown). In one embodiment, the CPU 132 may be any form of a general purpose computer processor that may be used in an industrial setting to control various chambers and subprocessors. The memory 134 is in the form of a computer readable storage medium that contains instructions that facilitate the operation of the SEM 110 when executed by the CPU 132. The instructions in the memory 134 are in the form of a program product, such as a program that applies the methods of the present disclosure. In various implementations, processing system 130 includes multiple CPUs and various memory elements.

[0032] The processing system 130 may be configured to change one or more focus-affecting parameters of the SEM 110 so that each image acquired by the detector assembly 128 has a different focus. In one embodiment, the processing system 130 controls the objective current of the lens assembly 122, the accelerating voltage of the electron gun 120, the working distance of the SEM 110 (e.g., the distance between the lens assembly 122 and the platform 126), and / or other focus-affecting parameters.

[0033] In one or more embodiments, the processing system 130 processes the images and / or data acquired by the detector assembly 128. For example, the processing system 130 may determine a contrast gradient (eg, a sharpness gradient) for each image and determine the image with the highest contrast gradient.

[0034] The images acquired by the SEM 110 can be used to detect one or more defects within the sample 124 and / or to measure features within the sample 124. For example, the images can be used to study the identified defects to determine the cause of the defects. Furthermore, the images can be used to measure structural features. For example, the width of the connector area and / or the electrode can be measured.

[0035] In one embodiment, the processing system 130 performs an autofocus function on the SEM 110 to ensure that the images acquired by the SEM 110 and analyzed by the processing system 130 are in-focus and have a high level of sharpness (e.g., contrast between pixels). In some embodiments, the imaging device 100 acquires multiple images, each with a different focus. The images are analyzed to determine the sharpness level of each image, or to determine the sharpness level of a portion of the analyzed image. The image with the highest amount of sharpness (e.g., the highest contrast gradient) can be used to set the focus parameters of the SEM 110. In one embodiment, only a portion of each image is analyzed to determine the contrast gradient of the image to reduce the total amount of time required to analyze each image. However, it is possible that the area of ​​each image selected for analysis may lack sufficient structural features. Therefore, the processing system 130 may not be able to identify an image with a contrast gradient that can be used to autofocus.

[0036] In various embodiments, the contrast gradient is determined by comparing each pixel to neighboring pixels, and unless some pixels are brighter than other pixels, the contrast gradient may be calculated to have a low value for the image.

[0037] The imaging device 100 can be part of a larger testing system. For example, the imaging device 100 can be part of a testing system that is configured to inspect identified defects within a display glass substrate. Furthermore, the testing system can be utilized to inspect a display glass substrate after processing (e.g., electrodes, transistors, and / or connectors are formed within a layer of the display glass substrate) to generate measurements of structural features of the display glass substrate. In one embodiment, the processing system 130 is remote from the SEM 110. For example, the SEM 110 can be mounted in a test chamber of the testing system, and the processing system 130 can be housed outside of the test chamber. Furthermore, the processing system 130 can also receive input from an input device (e.g., a mouse, keyboard, touch screen, etc.) and output data to a display device.

[0038] For example, Figure 2 An image 200 having a field of view (FOV) 210 is illustrated. Figure 2210. In addition, image 200 includes region of interest (ROI) 220, ROI 230, and ROI 240. ROI 220 corresponds to the entirety of FOV 210, and ROI 230 and ROI 240 are similar at least in size but correspond to different regions of FOV 210. For example, ROI 230 corresponds to a central region of FOV 210 without any structural features, while ROI 240 corresponds to a region of FOV 210 that includes structural features (for example, structural feature 212). In one embodiment, ROI 240 is less than ROI 230.

[0039] In one embodiment, the contrast gradient of each ROI 220, 230, 240 may be different. For example, by analyzing the image of each ROI, the contrast gradient (eg, sharpness change or gradient) of the image 200 is significantly different. For example, Figure 3 Graphs 310 , 320 , and 330 illustrate graphs of contrast gradients of images of each of the ROIs 220 , 230 , and 240 , respectively.

[0040] Figure 3 Each of the graphs 310, 320, and 330 illustrates a graph illustrating a focus change versus a sharpness value. Each point along the focus change axis corresponds to a different image acquired with a different focus condition. For example, the focus condition of the SEM 110 is changed between acquisitions of each image. Each image is analyzed to determine a sharpness value (for example, a contrast gradient value), which can be used to generate each corresponding graph. A peak value of the sharpness value can be determined, and the image with the peak sharpness value can be used to set the focus of the SEM.

[0041] As can be seen, graphs 310 and 330 include discernible peak sharpness values ​​(sharpness values ​​312 and 332, respectively), while graph 320 lacks discernible peak sharpness values. Thus, ROIs 220 and 240 each include one or more portions of structural feature 212, while ROI 230 lacks structural feature 212. However, peak sharpness value 312 is less than peak sharpness value 332 because ROI 220 includes a smaller number of structural features relative to the evaluated area of ​​ROI 220 than ROI 240. Thus, graph 330 generated from ROI 240 has significantly clear peak sharpness values ​​due to the larger number of structural features relative to the evaluated area of ​​ROI 240.

[0042] Furthermore, because the area of ​​ROI 220 is larger in size than both ROI 230 and ROI 240, the total amount of time required to analyze ROI 220 is also greater than the total amount of time required to analyze ROI 230 and ROI 240. In one embodiment, the total amount of time required to analyze ROI 220 may negatively affect the performance of imaging device 100, such that analysis of sample 124 may fail and / or may not be completed within the required time allotment. Furthermore, because ROI 230 lacks feature structures, the corresponding graph 320 lacks a graph having a peak sharpness value, and an autofocus process performed using ROI 230 may fail.

[0043] Thus, in embodiments where the processing system 130 relies on the ROI 220 to determine the optimal focus condition, the optimal focus condition may not be found. Similarly, in embodiments where the processing system 130 relies on the ROI 230 to determine the optimal focus condition, the optimal focus condition may not be found due to the lack of structural features in the ROI. In contrast, in embodiments where the processing system 130 relies on the ROI 240 to determine the optimal focus condition for the SEM 110, the optimal focus condition may be determined. However, the imaging device 100 needs to be able to identify the ROI 240. For example, in one embodiment, the ROI 240 may be determined by first obtaining a coarse (e.g., out-of-focus) image of the sample 124; processing the image to identify changes in contrast; and determining the ROI from the coarse image, wherein the location of the ROI corresponds to a region of the image that does include structural features (e.g., structural features 212). In one embodiment, after the ROI is determined, the ROI may be used to determine the optimal focus condition for the SEM 110.

[0044] Figure 4A method 400 for determining a ROI containing one or more structural features of a FOV is illustrated. In one embodiment, the ROI may be used to focus the SEM 110 of the imaging device 100. At operation 410, a first SEM image is acquired. For example, the processing system 130 may instruct the SEM 110 to acquire the first SEM image. In one embodiment, the processing system 130 provides instructions to the electron gun 120 to scan the beam 112 over the sample 124, resulting in the generation of the signal 114, which is received by the detector assembly 128. Furthermore, the detector assembly 128 may generate a SEM image from the signal 114. In another embodiment, the detector assembly 128 outputs data corresponding to the signal 114 to the processing system 130, and the processing system 130 generates a first image. In one embodiment, the processing system 130 configures the SEM with a first focusing condition to acquire the first image. The first focusing condition may place the sample 124 out of focus. In one embodiment, the processing system 130 determines the first focus condition by setting one or more of an objective lens current of the SEM, an accelerating voltage of the SEM, a working distance of the SEM, and a column voltage of the SEM.

[0045] At operation 420, the SEM image is analyzed to determine a contrast change measurement between pixels of the SEM image. In one embodiment, the processing system 130 is configured to analyze the SEM image to determine a contrast change measurement of the image. For example, the processing system 130 may compare each pixel of the SEM image with each adjacent pixel to determine the difference in contrast between each pixel. In one embodiment, the SEM image includes a plurality of rows and columns of pixels, and the processing system 130 is configured to analyze the SEM image row by row and then column by column. For example, each pixel of the first row is compared with each adjacent pixel of the first row, and then each pixel of the second row is compared with each adjacent pixel of the second row. This process is repeated until each row of the SEM image has been analyzed. In addition, each pixel of the first column is compared with each adjacent pixel of the first column, and then each pixel of the second column is compared with each adjacent pixel of the second column. This process is repeated until each column of the SEM image has been analyzed. In one embodiment, the SEM image includes 512 rows and 512 columns. In other embodiments, the SEM image may include more or fewer rows and / or columns. Furthermore, the number of rows and columns may be different.

[0046] Neighboring pixels may include any pixels adjacent to pixels in a common row or column. Again, while rows and columns are described, other configurations may be used in other embodiments.

[0047] Figure 5A sample SEM image 500 is shown that can be analyzed to determine the ROI. For example, each row of pixels can be compared with each adjacent pixel of the row, and each column of pixels can be compared with each adjacent pixel of the column. Figure 5 As shown in , the rows of pixels are along the Y direction, exemplified by rows R1-Row RY, and the columns of pixels are along the X direction, exemplified by columns C1-Cx. For example, a pixel in row R1 is compared with every other pixel in R1, and every pixel in column C1 is compared with every other pixel in C1.

[0048] In one embodiment, to determine the difference in contrast for each pixel (e.g., a contrast change measurement), the brightness value of each pixel is compared to the brightness value of each adjacent pixel. For example, the brightness value of each pixel may be subtracted from the brightness value of each adjacent pixel. The value corresponding to the difference in brightness between each pixel and each adjacent pixel may be referred to as a contrast change measurement. Pixels with larger contrast change measurements may correspond to regions or locations of the image where structural features are located in the image, and pixels with lower contrast change measurements may correspond to regions of the image where structural features are absent.

[0049] In one embodiment, a baseline value may be used to remove noise from the contrast change measurement results. The baseline value may also be referred to as a contrast change baseline. The processing system 130 may be configured to compare each contrast change measurement result for each pixel with the baseline value. In one embodiment, the processing system 130 looks for differences between the contrast change measurement results and the baseline value. Contrast measurement results that exceed the baseline value may be used to determine the ROI of interest. In other embodiments, contrast change measurements that exceed a threshold amount over the baseline value may be used to determine the ROI of interest. In one embodiment, the threshold amount may be about 20 percent above the baseline value. In other embodiments, a threshold value less than or equal to 20 percent above the baseline value may be used.

[0050] In one embodiment, the processing system 130 determines the baseline value by finding the average contrast change of the SEM images. In other embodiments, the baseline value is based on the median or minimum value of the SEM images.

[0051] In one embodiment, if none of the contrast change measurements exceed the baseline value and / or meet a threshold, it may be determined that the SEM image may include too much noise and a new SEM image may be acquired. The SEM image may be acquired for the same FOV or a new FOV.

[0052] At operation 430, a region of interest is determined based at least in part on the contrast change measurements. For example, in one embodiment, the processing system 130 generates a contrast change map from the contrast change measurements. The contrast change map can be a two-dimensional representation of the contrast change measurements. The processing system 130 can identify regions of the image corresponding to locations of one or more maximum contrast changes. The location of the maximum contrast change can be determined from the contrast change map or from any other representation of the contrast change measurements. Furthermore, the processing system 130 can set the location of the ROI to the region with the maximum contrast change or change.

[0053] For example, refer to Figure 5 , the processing system 130 may generate a contrast change map from the contrast change measurements generated from the pixels of the SEM image 500. The processing system 130 may analyze the contrast change map and determine that an area 540 of the SEM image 500 may correspond to the maximum contrast change measurement. Therefore, the processing system 130 may set the area 540 as the ROI to be used for autofocus. In one embodiment, the ROI may be set to an area larger than the area 540 but including the area 540.

[0054] In one embodiment, the size of the ROI may be about 10% to 20% of the area of ​​the FOV used to acquire the SEM image. In other embodiments, the ROI may be less than 10% or greater than 20%. The area of ​​the FOV may be about one or more square microns to about one or more square nanometers. In one embodiment, the size of the ROI and / or FOV may vary depending on the total amount of structural features present in the SEM image. For example, because the selected ROI is predetermined to include one or more structural features, the area of ​​the selected ROI may be smaller than the area of ​​the ROI used in a conventional focusing system. Therefore, the focusing routine performed on the selected ROI is faster because the focusing routine has a smaller area to analyze.

[0055] At operation 440, the focus condition of the SEM is adjusted. For example, the processing system 130 adjusts the focus condition of the SEM 110. In one embodiment, the processing system 130 acquires multiple images of the sample 124 using varying focus conditions, and analyzes a selected ROI of each SEM image to determine a sharpness gradient for each image. The ROI is the same for each SEM image. A SEM image corresponding to a high level of sharpness (for example, having a peak contrast gradient) is selected to determine the best focus condition for the SEM 110. For example, the processing system 130 may adjust the focus condition of the SEM 110 based on the identified image.

[0056] At operation 450, a second SEM image of the sample 124 is acquired. The second SEM image of the sample is acquired using the adjusted focus conditions. In one embodiment, the processing system 130 is configured to perform a CD measurement of the sample using the second SEM image. For example, the processing system 130 may be configured to measure the diameter of the connector 520 or the width of the electrode 530. These measurements may be stored in a memory. Furthermore, in one or more embodiments, the second SEM image may be utilized to verify one or more identified defects. The defects may be verified to determine whether the defects were properly identified and / or to determine the cause of the defects.

[0057] While the foregoing is directed to embodiments of the present disclosure, other and further embodiments may be devised without departing from the basic scope of the present disclosure, and the scope of the present disclosure is determined by the claims that follow.

Claims

1. A method for focusing a scanning electron microscope (SEM), the method comprising: acquiring a first SEM image of the sample using a first focusing condition, wherein the first SEM image comprises a plurality of pixels; analyzing the first SEM image to determine a plurality of contrast change measurements by comparing each of the plurality of pixels of the first SEM image to each of the plurality of neighboring pixels; determining a region of interest based on the contrast change measurements, wherein the location of the region of interest is set to the region having the largest contrast change measurements; adjusting the SEM from the first focus condition to a second focus condition based at least in part on the region of interest, wherein the first focus condition is different from the second focus condition; and A second SEM image of the sample is acquired using the second focusing condition.

2. The method of claim 1, wherein analyzing the first SEM image further comprises: A contrast change measurement is determined for each pixel of the plurality of pixels.

3. The method of claim 2, wherein determining the region of interest comprises: determining the maximum contrast change measurement from the contrast change measurements, and determining a location of the maximum contrast change measurement within the first SEM image; and The position of the region of interest is set to correspond to the position of the maximum contrast change measurement.

4. The method according to any one of claims 1 to 3, further comprising: A contrast change map is generated from each contrast change measurement.

5. The method of any one of claims 1 to 3, wherein analyzing the first SEM image further comprises: determining a contrast change baseline from the first SEM image; and Each of these contrast change measurements is compared to the contrast change baseline to produce a plurality of baseline contrast change measurements.

6. The method of claim 5, wherein determining the contrast change baseline comprises determining an average contrast change measurement from the contrast change measurements.

7. The method of any one of claims 1 to 3, wherein the area of ​​the region of interest is smaller than the area of ​​the first SEM image.

8. A computer program product for focusing a scanning electron microscope (SEM), the computer program product comprising: A non-transitory computer readable storage medium having computer readable program code embodied therein, the computer readable program code being executable by one or more computer processors to: acquiring a first SEM image of the sample using a first focusing condition, wherein the first SEM image comprises a plurality of pixels; analyzing the first SEM image to determine a plurality of contrast change measurements by comparing each of the plurality of pixels of the first SEM image to each neighboring pixel of the plurality of pixels; determining a region of interest based on the contrast change measurements, wherein the location of the region of interest is set to the region having the largest contrast change measurements; adjusting the SEM from the first focus condition to a second focus condition based at least in part on the region of interest, wherein the first focus condition is different from the second focus condition; and A second image of the sample is acquired using the second focus condition.

9. The computer program product of claim 8, wherein analyzing the first SEM image further comprises: A contrast change measurement is determined for each pixel of the plurality of pixels.

10. The computer program product of claim 9, wherein determining the region of interest comprises: determining the maximum contrast change measurement from the contrast change measurements, and determining a location of the maximum contrast change measurement within the first SEM image; and The position of the region of interest is set to correspond to the position of the maximum contrast change measurement.

11. The computer program product according to any one of claims 8 to 10, further comprising: A contrast change map is generated from each contrast change measurement.

12. The computer program product of any one of claims 8 to 10, wherein analyzing the first SEM image further comprises: determining a contrast change baseline from the first SEM image; and Each of these contrast change measurements is compared to the contrast change baseline to produce a plurality of baseline contrast change measurements.

13. The computer program product of claim 12, wherein determining the contrast change baseline comprises determining an average contrast change measurement from the contrast change measurements.

14. The computer program product of any one of claims 8 to 10, wherein the area of ​​the region of interest is smaller than the area of ​​the first SEM image.

15. A testing device comprising: Scanning electron microscopy (SEM); and A processing system coupled to the SEM, the processing system being configured to: acquiring a first SEM image of the sample using a first focusing condition, wherein the first SEM image comprises a plurality of pixels; analyzing the first SEM image to determine a plurality of contrast change measurements by comparing each of the plurality of pixels of the first SEM image to each of the plurality of neighboring pixels; determining a region of interest based on the contrast change measurements, wherein the location of the region of interest is set to the region having the largest contrast change measurements; adjusting the SEM from the first focus condition to a second focus condition based at least in part on the region of interest, wherein the first focus condition is different from the second focus condition; and A second image of the sample is acquired using the second focus condition.

16. The testing device of claim 15, wherein analyzing the first SEM image further comprises: A contrast change measurement is determined for each pixel of the plurality of pixels.

17. The test apparatus of claim 16, wherein determining the region of interest comprises: determining the maximum contrast change measurement from the contrast change measurements, and determining a location of the maximum contrast change measurement within the first SEM image; and The position of the region of interest is set to correspond to the position of the maximum contrast change measurement.

18. The testing device of any one of claims 15 to 17, wherein analyzing the first SEM image further comprises: determining a contrast change baseline from the first SEM image; and Each of these contrast change measurements is compared to the contrast change baseline to produce a plurality of baseline contrast change measurements.

19. The testing apparatus of claim 18, wherein determining the contrast change baseline comprises determining an average contrast change measurement from the contrast change measurements.

20. The testing device of any one of claims 15 to 17, wherein an area of ​​the region of interest is smaller than an area of ​​the first SEM image.