Automatic focusing method in high-precision measurement system

By setting the AOI and mask area in the high-precision imaging device, the maximum definition value is calculated to obtain the focus position, the problem of unclear image of the target under the depth of field limitation is solved, and the measurement accuracy is improved.

CN119810206APending Publication Date: 2025-04-11PIOTECH (HAINING) SEMICON EQUIP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411747168.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

Under the limitation of the depth of field of the imaging system, the prior art cannot accurately focus the target image to be measured with depth differences, resulting in unclear measurement results and affecting the measurement accuracy.

Method used

The image to be tested is obtained through a high-precision imaging device, the AOI area is set, the mask area is drawn, the maximum definition value of the AOI area image is calculated, and the focus position is obtained. The high-precision imaging device acquires the image at this position.

Benefits of technology

It achieves accurate focus on the measured targets with large depth differences under the limitation of depth limit, improving the image clarity and accuracy of measurement results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119810206A_ABST
    Figure CN119810206A_ABST
Patent Text Reader

Abstract

The invention relates to the field of measurement of semiconductor high-precision equipment, in particular to an automatic focusing method in a high-precision measurement system. The method comprises the following steps: acquiring a to-be-detected image through high-precision imaging equipment, and setting an AOI area for the to-be-detected image; drawing a mask area according to the AOI area image of the to-be-detected image to obtain a to-be-detected target image, the to-be-detected target image comprising a plurality of sub-target images; according to the to-be-detected target image, obtaining a position corresponding to the maximum definition value of the AOI area image; according to the position corresponding to the maximum definition value of the AOI area, the focusing position of the to-be-detected image is obtained, and a high-precision imaging device collects the image at the focusing position. By adopting a local focusing function, a mask function and a polynomial fitting mode, not only is the focusing precision improved, but also errors are reduced, and the measurement accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of measurement of semiconductor high-precision equipment, and more particularly to an automatic focusing method in a high-precision measurement system. Background Art

[0002] In the measurement process of semiconductor high-precision equipment, it is crucial to accurately measure the relevant information of the chip. To this end, high-precision imaging equipment is needed to collect images of the target to be measured in the wafer, and use measurement algorithms to identify and measure them. However, the clarity of the target to be measured has a significant impact on the measurement results, so in the image acquisition process, a focusing algorithm is needed to obtain the clearest image of the target to be measured.

[0003] In the prior art, the clearest image is usually obtained by improving the image clarity evaluation algorithm. Although improving the resolution of the imaging system can improve image clarity, due to the limitation of depth of field, it is often impossible to focus on the targets to be measured at different heights at the same time, which makes the original image evaluation algorithm unable to obtain clear measurement results, thus affecting the measurement accuracy.

[0004] Therefore, there is an urgent need for a method of achieving precise focusing on a target to be measured with depth differences under the depth of field limitation of an imaging system to obtain clear imaging and improve the accuracy of measurement results. Summary of the invention

[0005] The purpose of the present invention is to provide an automatic focusing method in a high-precision measurement system to solve the problem of accurately focusing an image of a target to be measured with depth difference under the limitation of the depth of field of an imaging system in the prior art.

[0006] In order to achieve the above object, the present invention provides an automatic focusing method in a high-precision measurement system, comprising:

[0007] Acquire the image to be tested by high-precision imaging equipment, and set the image to be tested as an AOI area;

[0008] Drawing a mask area according to the AOI area image of the image to be tested, so as to obtain a target image to be tested, wherein the target image to be tested includes a plurality of sub-target images;

[0009] According to the target image to be measured, obtaining a position corresponding to the maximum value of the image clarity in the AOI area;

[0010] The focus position of the image to be measured is obtained according to the position corresponding to the maximum value of the clarity of the AOI area, and the high-precision imaging device collects the image at the focus position.

[0011] In one embodiment, the step of obtaining a position corresponding to a maximum value of image clarity in the AOI area according to the target image to be measured, and obtaining a focus position of the image to be measured according to the position corresponding to the maximum value of image clarity in the AOI area, further comprises:

[0012] Calculate the clarity value of the AOI area image using an image clarity evaluation algorithm to obtain a focus curve diagram of the AOI area image;

[0013] According to the AOI area image focus curve diagram, the position corresponding to the peak point is obtained, and the position corresponding to the peak point is the focus position of the target image to be measured.

[0014] In one embodiment, the target image to be measured includes a first sub-target image and a second sub-target image;

[0015] Calculating the clarity values ​​of the first sub-target image and the second sub-target image using an image clarity evaluation algorithm to obtain focus curve graphs of the first sub-target image and the second sub-target image;

[0016] A polynomial fitting algorithm is used according to the focusing curve diagrams of the first sub-target image and the second sub-target image to obtain the position corresponding to the peak point, and the position corresponding to the peak point is the focusing position of the target image to be measured.

[0017] In one embodiment, the image clarity evaluation algorithm includes:

[0018]

[0019] Where V is the clarity value, AW is the width of the AOI area image, AH is the height of the AOI area image, i and j are the coordinates of each pixel in the target image to be measured, sx is the horizontal coordinate of the starting point of the AOI area image, sy is the vertical coordinate of the starting point of the AOI area, and f m (i,j) is the pixel size in the mask area image.

[0020] In one embodiment, a polynomial fitting algorithm is used according to the AOI area image focus curve diagram to obtain a position corresponding to a peak point;

[0021] The polynomial fitting algorithm includes:

[0022]

[0023] Among them, a i is the coefficient corresponding to the polynomial, n is the number of pixels involved in the fitting, i is the i-th pixel, x i is the position of the high-precision imaging device at the i-th pixel, y iis the clarity value of the i-th pixel.

[0024] In one embodiment, the multiple sub-target images are not on the same focal plane.

[0025] In one embodiment, the focus curve diagram is a relationship diagram between the position of a high-precision imaging device and a clarity value.

[0026] In one embodiment, the polynomial fitting algorithm applies the least squares method to determine the best fit.

[0027] In one embodiment, the pixels of the mask area are used to participate in the image clarity evaluation algorithm and are represented in the form of a binary image.

[0028] In one embodiment, the AOI area should be smaller than the image area to be measured and larger than the target image area to be measured.

[0029] The present invention proposes an automatic focusing method in a high-precision measurement system, which solves the blurring problem caused by the target images to be measured not being in the same plane, and improves the measurement accuracy through local focusing function, mask function and polynomial fitting. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] The above and other features, properties and advantages of the present invention will become more apparent through the following description in conjunction with the accompanying drawings and embodiments, in which the same reference numerals always represent the same features, wherein:

[0031] Figure 1a The top view of the target image to be measured is revealed;

[0032] Figure 1b A side view of the image of the target to be measured is revealed;

[0033] Figure 2 A flow chart of an automatic focusing method in a high-precision measurement system according to an embodiment of the present invention is disclosed;

[0034] Figure 3a An AOI area image according to an embodiment of the present invention is disclosed;

[0035] Figure 3b A first sub-target image according to an embodiment of the present invention is disclosed;

[0036] Figure 3c A second sub-target image according to an embodiment of the present invention is disclosed;

[0037] Figure 4a A mask region of a first sub-target image according to an embodiment of the present invention is disclosed;

[0038] Figure 4bA mask region of a second sub-target image according to an embodiment of the present invention is disclosed;

[0039] Figure 5 A focus curve diagram according to an embodiment of the present invention is disclosed;

[0040] Figure 6 A curve fitting graph according to an embodiment of the present invention is disclosed. DETAILED DESCRIPTION

[0041] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the invention and are not used to limit the invention.

[0042] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0043] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention. Although the illustrations only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation, the form, quantity and proportion of each component in actual implementation may be changed arbitrarily, and the component layout may also be more complicated.

[0044] The purpose of the present invention is to automatically focus the measurement target clearly and then measure it, but the edges of other objects and image noise will always interfere with the focusing algorithm, resulting in the collected target image not being clear. Therefore, the present invention is to remove the noise and edge interference of other targets, so that the high-precision imaging device can automatically focus the target clearly.

[0045] Figure 1a The top view of the target image to be tested is revealed. Figure 1b The side view of the target image to be tested is revealed, such as Figure 1a and Figure 1b As shown, the target image to be measured consists of an upper target 101 and a lower target 102, wherein the upper and lower targets are not at the same height, which will result in that the high-precision imaging device can only focus on one of the targets clearly, while the feature edge of the other target is relatively blurred.

[0046] In practical applications, when the clarity evaluation algorithm is selected in the best case, the imaging quality of the target object can be improved by improving the resolution of the imaging system, but at the same time the depth of field of the imaging system will become smaller. Especially in some wafers, a complete target to be measured usually consists of two parts, one in the upper wafer and one in the lower wafer. The two sub-objects to be measured are not on the same plane, which ultimately causes the original image evaluation algorithm to be unable to focus the target to be measured clearly, and finally affects the measurement results, resulting in a decrease in positioning accuracy.

[0047] Figure 2 A flow chart of an automatic focusing method in a high-precision measurement system according to an embodiment of the present invention is disclosed. Figure 2 As shown, the present invention proposes an automatic focusing method in a high-precision measurement system, comprising:

[0048] Acquire the image to be tested by high-precision imaging equipment, and set the image to be tested as an AOI area;

[0049] Drawing a mask area according to the AOI area image of the image to be tested, so as to obtain a clear target image to be tested, wherein the target image to be tested includes a first sub-target image and a second sub-target image;

[0050] According to the target image to be measured, obtaining a position corresponding to the maximum value of the image clarity in the AOI area;

[0051] The focus position of the image to be measured is obtained according to the position corresponding to the maximum value of the clarity of the AOI area, and the high-precision imaging device collects the image at the focus position.

[0052] The calculation range of the traditional algorithm for evaluating image clarity is the entire image. In this embodiment, by adding the AOI function, only the edge of the image to be tested is extracted for clarity evaluation, focusing on whether the contour of the image to be tested is clear, while ignoring other irrelevant edge information.

[0053] In one embodiment, the area range of AOI is as follows: Figure 3a As shown. Among them, AOI (Area of ​​Interest) focuses on the edges and key features of the target image to be measured, such as identifiers, textures or structures, to improve the accuracy of recognition. By adding AOI function to the traditional algorithm for evaluating image clarity, it helps to reduce interference and ensure the accuracy of clarity evaluation. The AOI area can also be dynamically adjusted according to the measurement conditions to always keep the focus on the target, thereby achieving efficient and accurate image clarity evaluation.

[0054] In one embodiment, by setting a masking region, covering two or more sub-regions of the target to be measured, such as the upper and lower parts located at different focal planes, each sub-target is processed independently to ensure that each sub-region can be focused on its clearest focal plane. In addition, it can be dynamically adjusted according to the position and height of the target to ensure that the actual position and shape of the target are always focused during the automatic focusing process.

[0055] In this embodiment, Figure 3b A first sub-target image according to an embodiment of the present invention is disclosed, Figure 3c A second sub-target image according to an embodiment of the present invention is disclosed, such as Figure 3b and 3c As shown, Figure 3b and 3c yes Figure 3a The two sub-target images that are not on the same focal plane, when the focusing is completed, Figure 3c The edges of the area are obviously not very clear. When the mask function is added to the clarity evaluation algorithm, the algorithm will separately calculate the two images corresponding to the two sub-targets when they are clearest, thereby improving the recognition and measurement accuracy.

[0056] More specifically, the mask area is usually represented in the form of a binary image, and only the pixels within the mask area are involved in the clarity calculation, thereby ensuring that only the target pixels affect the focusing result. This makes it possible to find the clearest imaging position for each sub-target at different depths, significantly improving image quality and measurement accuracy.

[0057] The present invention solves the limitations of traditional image clarity evaluation algorithms when processing sub-targets with different focal planes by adding AOI and mask functions. During the focusing process, a polynomial fitting method is used to find the peak point, which effectively avoids noise interference and ensures image clarity and focusing accuracy.

[0058] According to the following Figure 2 The method for automatic focusing in the high-precision measurement system provided further describes its specific implementation method, by adding AOI function, mask function and least squares fitting image acquisition and automatic focusing.

[0059] Acquire the image to be tested by high-precision imaging equipment, and set the image to be tested as an AOI area;

[0060] In this embodiment, a template image is first prepared, an image to be tested is acquired by a high-precision imaging device, and an AOI area is set on the image to be tested.

[0061] Drawing a mask area according to the AOI area image of the image to be tested, so as to obtain a target image to be tested, wherein the target image to be tested includes a plurality of sub-target images;

[0062] The multiple sub-target images are not on the same focal plane.

[0063] Figure 4a The mask area of ​​the first sub-target image according to an embodiment of the present invention is disclosed. Figure 4b The mask area of ​​the second sub-target image according to an embodiment of the present invention is disclosed, such as Figure 4a and 4b As shown, Figure 4a The gray shaded area of ​​is the mask area of ​​the first sub-target image. Figure 4b The gray shaded portion is the mask area of ​​the second sub-target image.

[0064] In this embodiment, a mask area is drawn according to the AOI area image of the image to be tested. More specifically, in this embodiment, the target image to be tested includes a first sub-target image and a second sub-target image, and mask areas of the two sub-target images are drawn respectively. The pixel points of the mask area are used to participate in the image clarity evaluation algorithm and are represented in the form of a binary image.

[0065] In this embodiment, an AOI area is set on the image to be tested, and then mask areas of two sub-images are drawn respectively to obtain a clear target image to be tested, and then the target image to be tested is accurately detected and processed.

[0066] In one embodiment, an image recognition algorithm is used to identify the target area to be measured on the wafer, and the target to be measured is moved to the center of the field of view to ensure that the target area to be measured is in the best position in subsequent acquisition and processing. After finding the position, the image clarity evaluation algorithm will dynamically adjust the AOI and mask area positions to calculate the clearest image. The clearer the image, the larger the result calculated by the clarity algorithm. Finally, the camera is called to capture the image at the point where the calculated result is the largest.

[0067] According to the target image to be measured, the position corresponding to the maximum value of the image clarity in the AOI area is obtained, and according to the position corresponding to the maximum value of the image clarity in the AOI area, the focusing position of the image to be measured is obtained, and the high-precision imaging device captures the image at the focusing position.

[0068] In one embodiment, an image clarity evaluation algorithm is used to calculate the clarity value of the AOI area image to obtain a focus curve diagram of the AOI area image;

[0069] According to the AOI area image focus curve diagram, the position corresponding to the peak point is obtained, and the position corresponding to the peak point is the focus position of the target image to be measured.

[0070] More specifically, the focus curve diagram is a relationship diagram between the position of the high-precision imaging device and the clarity value.

[0071] Calculating the clarity values ​​of the first sub-target image and the second sub-target image using an image clarity evaluation algorithm to obtain focus curve graphs of the first sub-target image and the second sub-target image;

[0072] A polynomial fitting algorithm is used according to the focusing curve diagrams of the first sub-target image and the second sub-target image to obtain the position corresponding to the peak point, and the position corresponding to the peak point is the focusing position of the target image to be measured.

[0073] Figure 5 A focusing curve diagram according to an embodiment of the present invention is disclosed, such as Figure 5 As shown, the target image to be measured is focused, and the clarity value of the currently captured target image to be measured is calculated using the image clarity evaluation algorithm. When the high-precision imaging device finishes scanning, the relationship data between the position of the high-precision imaging device and the clarity will be obtained, and the focus curve diagram will be obtained using this data.

[0074] Among them, the high-precision imaging device can be a camera.

[0075] In this embodiment, since the first sub-target image and the second sub-target image have their own masks, Figure 5 As shown, the focus curve of the image to be tested is the result curve of the calculated clarity without adding the AOI function and the mask function, and the first sub-target image and the second sub-target image are the clarity curves of focusing after adding the AOI function and the mask function.

[0076] The peak curve of the image to be tested is similar to the peak curve of the first sub-target image, so the difference is not big. Figure 4a and Figure 4b As shown in the figure, the first sub-target image is relatively clear, but the edge of the second sub-target image is relatively blurred. By adding the mask function, the problem of the blurred edge of the second sub-target image caused by applying full image focusing can be effectively compensated.

[0077] Among them, the first sub-target image and the second sub-target image are not on the same focal plane, that is, the peak points corresponding to the focusing curves of the first sub-target image and the second sub-target image are different. It can be seen that the method of calculating the clarity without adopting the local focusing function (image to be tested) will cause the peak point found to have a slightly larger deviation.

[0078] It is worth noting that the image in the present invention is manually drawn, the upper and lower targets are clear, and there is no circuit other than the target in the image. The image in the actual scene contains other objects in addition to the target. The edges of these objects are not at the same height as the edges of the two targets. At the same time, only one target is clear in the field of view of the high-precision imaging device.

[0079] More specifically, the clarity evaluation algorithm includes:

[0080]

[0081] Where V is the clarity value, AW is the width of the AOI area image, AH is the height of the AOI area image, i and j are the coordinates of each pixel in the image to be tested, sx is the horizontal coordinate of the starting point of the AOI area image, sy is the vertical coordinate of the starting point of the AOI area, and f m (i,j) is the pixel size in the mask area image.

[0082] In one embodiment, the AOI area should be smaller than the image area to be tested and larger than the target image area to be tested.

[0083] Among them, f m (i, j) is the pixel size in the mask area image. Furthermore, the mask area image is a binary image. When the pixel value in the mask image is 0, it means that the pixel at the corresponding position in the target image to be measured will be included in the calculation of the clarity; when the pixel value in the mask image is 1, it means that the pixel at the corresponding position in the target image to be measured will not be included in the calculation of the clarity.

[0084] In one embodiment, the value with the largest clarity and the focus position in the two sets of data are found from the focus curve diagrams of the first sub-target image and the second sub-target image, the value with the largest clarity and the corresponding focus position are collected by a high-precision imaging device, and several data points near the point are extracted to provide sufficient data samples for curve fitting.

[0085] In this embodiment, V represents the clarity value of the image to be measured, and a larger clarity value indicates a clearer focused area in the image.

[0086] In one embodiment, the polynomial fitting algorithm includes:

[0087]

[0088] Among them, n is the number of pixels involved in fitting, i is the i-th pixel, x i is the position of the high-precision imaging device at the i-th pixel, y i is the clarity value of the i-th pixel, a i It is the coefficient corresponding to this fifth-order polynomial. It has been verified experimentally that when the focusing curve model is assumed to be a fifth-order curve, the deviation of the fitted curve is the smallest, and the image clarity corresponding to the peak point of the curve is within the recognition accuracy range.

[0089] In one embodiment, during the focusing process, the method of finding the peak point of the focusing curve includes, but is not limited to, polynomial fitting, full disk scanning method, dichotomy method, hill climbing method and other related algorithms.

[0090] If there is noise near the peak point, the peak point searched by the algorithm will not be the true peak point due to the interference of the noise. Therefore, in this embodiment, a polynomial fitting method is adopted to collect the high-precision imaging device to the maximum clarity value and the corresponding focus position, and extract several data points near the point, and perform curve fitting on these data. Then, the peak point position is calculated according to the fitted curve model. Applying this method of finding the peak can avoid the interference of noise at the edge of the peak on the result, thereby finding the clearest image.

[0091] Figure 6 A curve fitting diagram according to an embodiment of the present invention is disclosed, such as Figure 6 As shown in the figure, the black solid scattered points are the pixel points involved in the fitting, and the black curve is the fitted curve.

[0092] Among them, the y value corresponding to point F represents the peak point on the curve, and the corresponding x value represents the position of the high-precision imaging device.

[0093] Among them, point i represents the i-th point, the horizontal axis corresponding to the high-precision imaging device represents the position, and the vertical axis represents the clarity value.

[0094] In this embodiment, the black solid scattered points represent the clarity of the image collected by the camera when it moves 0.1um, and the black curve is the curve fitted by the polynomial. Figure 6 It can be seen that the clarity value of each point near the peak value does not change smoothly. The true peak point can be found by curve fitting. The least squares method is used to fit the collected data to effectively reduce the impact of noise on the data and calculate the position corresponding to the peak point of the curve.

[0095] In one embodiment, the maximum value is first found based on the peak curve data of the first sub-target image and the second sub-target image, and then a number of data near the peak are extracted based on this value. The specific number of data is appropriately selected according to the current project. In this embodiment, 28 fitting pixel points are selected, and then the least squares method is applied to fit the extracted 28 data points into a curve.

[0096] In this embodiment, through multiple experiments, the model of the curve is assumed to be a curve of the fourth power with the highest order, and the coefficients of the curve are determined by the least squares method to minimize the cost function value, and the peak value of the fitted curve and the corresponding high-precision imaging device position are calculated.

[0097] In one embodiment, the high-precision imaging device is adjusted to the position corresponding to the calculated peak point to capture the image, so that the image is captured in the best focus state, thereby obtaining the clearest image result.

[0098] The present invention effectively compensates for the problem of blurred edge of the lower target caused by applying full-image focusing by adopting local focusing function and mask function. It can solve the technical problem that when two sub-targets are not on the same focal plane, calculating the clarity of the entire image will cause deviation of the peak point. The polynomial fitting method is adopted, which not only improves the focusing accuracy, but also reduces errors and improves the measurement accuracy.

[0099] As shown in this application and claims, unless the context clearly indicates an exception, the words "a", "an", "an" and / or "the" do not refer to the singular and may also include the plural. Generally speaking, the terms "include" and "comprise" only indicate the inclusion of the steps and elements that have been clearly identified, and these steps and elements do not constitute an exclusive list. The method or device may also include other steps or elements.

[0100] In the description of the present invention, it should be noted that the directions or positional relationships indicated by terms such as “upper”, “lower”, “front”, “back”, “left”, “right”, “vertical”, “inside” and “outside” are based on the directions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore cannot be understood as a limitation on the present invention.

[0101] In the present invention, unless otherwise clearly specified and limited, a first feature being "above" or "below" a second feature may include that the first and second features are in direct contact, or may include that the first and second features are not in direct contact but are in contact through another feature between them. Moreover, a first feature being "above", "above" and "above" a second feature includes that the first feature is directly above and obliquely above the second feature, or simply indicates that the first feature is higher in level than the second feature. A first feature being "below", "below" and "below" a second feature includes that the first feature is directly below and obliquely below the second feature, or simply indicates that the first feature is lower in level than the second feature.

[0102] In the description of the present invention, 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 directly connected, or indirectly connected through an intermediate medium, or it can be the connection inside two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0103] The above embodiments are provided for persons familiar with the art to implement or use the present invention. Personnel familiar with the art can make various modifications or changes to the above embodiments without departing from the inventive concept of the present invention. Therefore, the protection scope of the present invention is not limited to the above embodiments, but should be the maximum scope of the innovative features mentioned in the claims.

Claims

1. A method for automatic focusing in a high-precision measurement system, characterized in that: include: Acquire the image to be tested by high-precision imaging equipment, and set the image to be tested as an AOI area; Drawing a mask area according to the AOI area image of the image to be tested, so as to obtain a target image to be tested, wherein the target image to be tested includes a plurality of sub-target images; According to the target image to be measured, obtaining a position corresponding to the maximum value of the image clarity in the AOI area; The focus position of the image to be measured is obtained according to the position corresponding to the maximum value of the clarity of the AOI area, and the high-precision imaging device collects the image at the focus position.

2. The method for automatic focusing in a high-precision measurement system according to claim 1, characterized in that: The step of obtaining a position corresponding to a maximum value of image clarity in the AOI region according to the target image to be measured, and obtaining a focus position of the image to be measured according to the position corresponding to the maximum value of image clarity in the AOI region, further comprises: Calculate the clarity value of the AOI area image using an image clarity evaluation algorithm to obtain a focus curve diagram of the AOI area image; According to the AOI area image focus curve diagram, the position corresponding to the peak point is obtained, and the position corresponding to the peak point is the focus position of the target image to be measured.

3. The method for automatic focusing in a high-precision measurement system according to claim 2, characterized in that: The target image to be measured includes a first sub-target image and a second sub-target image; Calculating the clarity values ​​of the first sub-target image and the second sub-target image using an image clarity evaluation algorithm to obtain focus curve graphs of the first sub-target image and the second sub-target image; A polynomial fitting algorithm is used according to the focusing curve diagrams of the first sub-target image and the second sub-target image to obtain the position corresponding to the peak point, and the position corresponding to the peak point is the focusing position of the target image to be measured.

4. The method for automatic focusing in a high-precision measurement system according to claim 2, characterized in that: The image clarity evaluation algorithm includes: Where V is the clarity value, AW is the width of the AOI area image, AH is the height of the AOI area image, i and j are the coordinates of each pixel in the target image to be measured, sx is the horizontal coordinate of the starting point of the AOI area image, sy is the vertical coordinate of the starting point of the AOI area, and f m (i,j) is the pixel size in the mask area image.

5. The method for automatic focusing in a high-precision measurement system according to claim 2, characterized in that: Using a polynomial fitting algorithm according to the AOI area image focus curve diagram, obtaining a position corresponding to a peak point; The polynomial fitting algorithm includes: Among them, a i is the coefficient corresponding to the polynomial, n is the number of pixels involved in the fitting, i is the i-th pixel, x i is the position of the high-precision imaging device at the i-th pixel, y i is the clarity value of the i-th pixel.

6. The method for automatic focusing in a high-precision measurement system according to claim 1, characterized in that: The multiple sub-target images are not on the same focal plane.

7. The method for automatic focusing in a high-precision measurement system according to claim 3, characterized in that: The focus curve diagram is a relationship diagram between the position of the high-precision imaging device and the clarity value.

8. The method for automatic focusing in a high-precision measurement system according to claim 5, characterized in that: The polynomial fitting algorithm uses the least squares method to determine the best fitting method.

9. The method for automatic focusing in a high-precision measurement system according to claim 1, characterized in that: The pixels in the mask area are used to participate in the image clarity evaluation algorithm and are represented in the form of a binary image.

10. The method for automatic focusing in a high-precision measurement system according to claim 1, characterized in that: The AOI area should be smaller than the image area to be measured and larger than the target image area to be measured.