Computer-implemented method, method, measuring device and computer program product

By modeling and determining the progress parameters of the curved edges based on the image gradient map, the problem of insufficient bending edge positioning accuracy in the prior art in images with extended depth of field is solved, and higher precision edge positioning is achieved.

CN119604888APending Publication Date: 2025-03-11CARL ZEISS INDUSTRIELLE MESSTECHNIKE GMBH +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202380056262.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2022-07-25
Filing Date
2023-07-21
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

The prior art has room for improvement in the accuracy of edge position determination when edge positioning is performed in images with extended depth of field, especially when dealing with curved edges.

Method used

By determining the image gradient map formed by the image gradient, the progress of the curved edge is modeled based on the image gradient map and projected using edge parameters to determine the edge distribution and edge position.

Benefits of technology

This method can more accurately locate edge positions in an image with curved edges, improving the accuracy of edge positioning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119604888A_ABST
    Figure CN119604888A_ABST
Patent Text Reader

Abstract

The invention relates to a computer-implemented method (200) for locating an edge position of an edge (166) in an image region (162) of an image (160) having an extended depth of field, the method comprising the steps of: determining (206) an image gradient for each image point in the image region (162), where the determined image gradients form an image gradient map; determining (210) at least one edge parameter of the modeled curved edge distribution based on the image gradient map; determining (212) an edge distribution (172) of the edge (166) based on a projection of image points of the image area (162) along the edge distribution using the at least one edge parameter; and determining (214) the edge location based on the edge distribution (172). The invention also relates to a method (220) for edge localization in an image having an extended depth of field, a measuring device (10) and a computer program product.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a computer-implemented method for locating an edge position of an edge in an image region of an image. The invention further relates to a method for locating an edge in an image. The invention further relates to a measuring device, in particular a coordinate measuring machine or a microscope. The invention further relates to a computer program product. Background Art

[0002] Measuring devices for measuring the surface of a workpiece (also called a measuring object) are generally known in the prior art. In principle, in industrial metrology, measuring devices that can measure 3D information of a workpiece are required. For this purpose, various types of sensors can be used in this type of measuring device to capture the coordinates of the workpiece to be measured.

[0003] For example, optical measuring devices using optical sensors are also known. The optical sensor enables the coordinates of the workpiece to be captured without contact. In an optical measuring device, the workpiece to be measured is clamped on a table that serves as a workpiece holder. In this case, the table forms an XY plane. Perpendicular to this plane, i.e. in the Z direction of the Cartesian coordinate system, the optical sensor is spaced apart from the workpiece to be measured.

[0004] Since conventional optical measuring devices, such as microscopes or coordinate measuring machines, for example, can only record 2D data, the image depth or depth information in the Z direction is determined with the aid of additional techniques.

[0005] A non-invasive and convenient solution consists in determining the depth information in the Z direction with the aid of multiple optical measurements. The image unsharpness caused by optical defocus varies in a predictable manner. The optical system of the optical sensor has a focal plane, which is the plane with maximum sharpness. If an object point located on the surface of the workpiece moves towards the focal plane, the image representation of the object point becomes sharper. If the object point moves away from the focal plane, the image representation of the object point becomes less sharp. The image representation of the object point is sharpest if the object point is arranged in the focal plane. Therefore, the unsharpness of the image can be monitored by changing the distance between the workpiece and the optical system. A focus image stack is generated by recording images as the workpiece moves through the focus. Based on the focus image stack, the depth information of the object point can be extracted with the aid of a technique known as shape recovery from focus (SFF).

[0006] In the SFF technique, the recorded focus image stack is first evaluated with the aid of an autofocus indicator, which defines the local sharpness of each image in a pixel-resolved manner. In this case, a sharpness value is determined for each image point in each image. The sharpness values ​​are stored in a 3D sharpness matrix. Therefore, each individual image point is assigned a sharpness distribution curve in the z direction. Next, the maximum value of each sharpness distribution curve is determined. The maximum value thus indicates the z position at which the sharpest imaging of the object point occurs at the image point. Thereby, depth information can be determined for each object point of the workpiece. A depth map of an area of ​​the workpiece can be generated based on the determined depth information. In addition, an image with an extended depth of field (EDOF image) can then be generated based on the depth map and the focus image stack.

[0007] Methods using SFF techniques are known in microscopy. For example, document EP 2 598 836 A1 discloses a method for compensating for insufficient illumination in microscopic "shape from focus recovery (SFF)", which involves first using a projector camera system to estimate the reflectivity of the scene and then applying the microscopic "shape from focus recovery (SFF)" to the reflectance map stack instead of the original image data.

[0008] In addition, methods of this type are described in the article "Shape from Focus Recovery System" by Shree K. Nayar (IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 1992, 302-308) and in the article "Focus Variation Instrument" by Franz Helmli (Chapter 7 of the book "Optical Measurement of Surface Topography", pages 131-166, Springer Verlag).

[0009] Based on the image that images the structure, further information about the structure represented in the image can be obtained. In particular, it is desirable to obtain further information about the contour of the imaged structure, in particular about the edge of the structure. For example, the structure may be a workpiece. In this case, the image may be evaluated in order to determine the position of the edge of the workpiece.

[0010] The image to be evaluated can be, for example, a recorded single image or an image with an extended depth of field. Measurements within an image with an extended depth of field allow multiple edge positions to be evaluated from different z positions. In contrast, single-image measurements allow edges to be evaluated within a sharply imaged focus area. Edges that are out of focus cannot then be evaluated in the image. It is therefore particularly advantageous to perform edge evaluation in images with an extended depth of field.

[0011] Various methods are known in the prior art for locating these edges in images, in particular their edge positions with sub-pixel accuracy.

[0012] The so-called search beam method is often used to determine the edge position with sub-pixel accuracy. For this purpose, the image information along the search beam line is evaluated along an arbitrarily selected search beam that contains the edge to be measured. In this case, the search beam line in the image is determined by the straight line equation

[0013]

[0014] In this equation, [x0, y0] corresponds to the origin of the search beam, [n x ,n y ] corresponds to the search beam direction and l corresponds to the free search beam parameter. The associated image information I(x 搜索光束 ,y 搜索光束 ). In the next step, the edge position is determined, for example, by means of the "Canny edge algorithm" or alternative techniques, in particular threshold methods. For example, a threshold method of this type is described in the technical article "Edge Detection with Sub-pixel Accuracy Based on Approximation of Edge with Erf Function" (HAGARA et al., RADIOENGINEERING, Vol. 20, No. 2). The central disadvantage of this edge determination method is the noise sensitivity of the algorithm used. Since the edge information is only known along a single search beam line, possible noise during the measurement process directly affects the measurement result and thus reduces its quality.

[0015] Alternatively, it is also conceivable that, instead of a separate search beam, the edge information of an area region of a so-called region of interest (RoI) is taken into account and projected relative to the surface normal of a straight edge. The ROI is therefore a particularly small image region of the image. This method is referred to in the literature as the "slant edge method" and makes it possible to extract a super-resolved and better sampled edge distribution. The edge position is then determined therefrom by means of an edge localization method. For example, the slanted-edge method is described in the technical articles “Robust edge-spread function construction methods to counter poor sample spacing uniformity in the slanted-edge method” (F. van den Bergh, J. Opt. Soc. Am. A 36, pp. 1126-1136 (2019), DOI: 10.1364 / JOSAA.36.001126) and “Comparison of MTF measurements using edge method: towards reference data set” (Viallefont-Roninet et al., Opt. Express 26, pp. 33625-33648 (2018), DOI: 10.1364 / OE.26.033625).

[0016] Compared to the search beam method, the “slant edge method” has an improved signal-to-noise ratio and allows for higher localization accuracy due to the super-resolution sampling properties.

[0017] However, the methods known in the prior art for edge localization in images with extended depth of field still have room for improvement, particularly in terms of the accuracy of edge position determination. Summary of the invention

[0018] Against this background, the technical object of the present invention is to provide a method and a device with the help of which edges in images can be better localized.

[0019] In a first aspect of the invention, there is provided a computer-implemented method for locating edge positions of edges in an image region of an image. The method comprises the following steps:

[0020] - determining an image gradient for each image point in the image region, wherein the determined image gradients form an image gradient map;

[0021] - determining at least one edge parameter of a modeled curved edge progression based on the image gradient map;

[0022] - determining an edge distribution of the edge based on projections of image points of the image area along the edge using the at least one edge parameter; and

[0023] - determining the edge position based on the edge distribution.

[0024] The image can be a recorded single image or an image with an extended depth of field. The image plane of the image can be described with the aid of a two-dimensional coordinate system. The two-dimensional coordinate system can be, for example, a Cartesian coordinate system with an x-direction and a y-direction. The image has a plurality of image points. The image points are distributed at regular distances in the x-direction and the y-direction. Each image point has a grayscale or RGB value describing the brightness or intensity of the image point. The intensity values ​​form the intensity field of the image. The intensity field assigns an intensity value to each position in the image. If images with extended depth of field are used, each image point can also be assigned a depth value in addition (see, for example, Fig.6D ), but will not be used for edge positioning in the following.

[0025] For example, the image may image an area of ​​the surface of the workpiece. The workpiece has a surface structure with edges. Therefore, the edge of the surface profile is also located in the area of ​​the surface of the workpiece imaged in the image. In other words, the edge imaged in the image may be the edge of the imaged workpiece. The edge position indicates the position of the edge in the image.

[0026] The intensities of the image points that image the same area of ​​the workpiece, in particular a flat area, are similar. In other words, these intensities differ only slightly from one another. Areas of the workpiece adjacent to the edge are imaged with different intensities in the image. Therefore, greater intensity variations occur in the edge area. In other words, the intensity deviations at the edge are greater than in areas without edges.

[0027] In order to locate the position of the edge, at least one image region of the image in which the edge develops is considered. This region may also be referred to as a "region of interest" (ROI). For example, the user may select the image region. Alternatively, the image region may be determined based on an image analysis. For this purpose, for example, an image region with a large intensity deviation may be selected.

[0028] In order to locate the edge position of an edge in an image region, the image gradient is first determined for each image point. The image gradient indicates how the intensity, i.e. the brightness of an image point, varies at the location of the image point relative to the surrounding image points. The image gradient is determined in particular from the brightness variation relative to the surrounding image points. The image gradient is therefore the gradient of the intensity field of the image and can be calculated by the formula For example, the finite difference approximation of the differential operator can be used to calculate the gradient. Thus, the image gradient is a vector indicating the intensity change at an image point, i.e., at a location (x, y) in the image. The image gradient has a direction indicating the direction of the greatest intensity change at that location, and a gradient value indicating the magnitude of the vector and corresponding to a measure of the degree of intensity change.

[0029] The image gradient can be determined based on the image of each point in the workpiece area or on the whole or part of the focus image stack. For this purpose, the image gradient is calculated for each image point. For this purpose, in the image area, a numerical approximation of the image gradient can be determined, for example, with the aid of a directional Sobel filter or a numerical finite difference method.

[0030]

[0031] In order to suppress the effects caused by image noise, it is particularly advantageous to calculate the image gradient as a weighted average of multiple images from the focus image stack, i.e.

[0032]

[0033] In other words, the image gradient [G x , G y ] indicates how the brightness changes relative to the surrounding image points. Therefore, the image gradient at an image point [G x , G y ] is the vector pointing in the direction of maximum brightness change.

[0034] The determined image gradients together form an image gradient map. The image gradient map thus contains the image gradient [G x , G y ]. In other words, the image gradient map will correspond to the image gradient [G x , G y ] is assigned to each image point position [x, y].

[0035] In principle, an edge in an image area has an edge progression. The edge progression describes the progression of the edge in the xy plane. Thus, the edge progression describes a curve in the xy plane. The edge progression can also be referred to as edge geometry. Each point of the edge has an edge tangent and an edge normal. The edge tangent is the tangent of the edge at the corresponding point. The edge normal is the normal of the edge at the corresponding point. The edge tangent and the edge normal lie in the xy plane. The edge tangent proceeds in a tangential direction relative to the edge. At the corresponding point of the edge, the tangential direction describes the direction of the edge tangent in the xy plane. Thus, the tangential direction describes the direction of the edge progression at the corresponding point. The tangential direction can also be referred to as the edge progression direction. The edge normal proceeds in a normal direction relative to the edge. At the corresponding point of the edge, the normal direction describes the direction of the edge normal in the xy plane. At each point, the normal direction and the edge progression direction are perpendicular to each other.

[0036] The edge progression may be arbitrarily curved. "Curved" is understood to mean the local deviation of a curve from a straight line. Curved therefore implies non-linearity. In the case of a linear (i.e. non-curved) edge progression, the normal direction and the edge progression direction are the same for all points of the edge. In the case of a curved edge progression, the direction of edge progression (i.e. the edge progression direction) changes in the xy plane along the edge progression (i.e. when following the edge progression). Thus, in the case of a curved edge progression, the normal direction also changes along the edge progression.

[0037] The edge progression of an edge may be modeled or described based on a model of a curved edge progression. The modeled curved edge progression is thus used to describe or approximate the actual edge progression of the edge. The modeled curved edge progression has at least one edge parameter for describing the edge progression based on the underlying model. In other words, the modeled curved edge progression has one or more edge parameters. In particular, the modeled curved edge progression may have more than one edge parameter.

[0038] Thus, the edge progression of the edge may be described or modeled with the aid of the at least one edge parameter. The edge parameter may be, for example, a parameter or parameters for describing the edge progression direction, the normal direction and / or the curvature of the edge progression. The edge progression may preferably be described with the aid of an arbitrary function, wherein each edge parameter may be a parameter of a function. For example, given a constant curvature, an edge parameter may indicate the position of the center of curvature.

[0039] As explained above, the intensity varies in the region of the edge. In this case, the intensity variation is substantially perpendicular to the edge progression, i.e. in the normal direction. In other words, the image gradient in the edge region is oriented substantially in the normal direction relative to the edge. Thus, the at least one edge parameter can be determined by means of the modeled curved edge progression and the determined image gradient.

[0040] The determined at least one edge parameter is then used to perform a projection of the image points of the image area along the edge progression (i.e. along the edge progression direction) in the normal direction. In this case, a position in the normal direction is assigned to each image point. In other words, the position of each image point relative to the edge is determined by the projection.

[0041] The edge distribution is then determined or constructed based on the projection. The edge distribution can also be called the edge transfer distribution or edge transfer function ("edge spread function"). The edge distribution is an intensity distribution. The intensity distribution indicates the intensity of each image point at the corresponding position in the normal direction. Therefore, the edge distribution indicates the intensity distribution or intensity progression in the normal direction. In other words, the edge distribution describes the intensity distribution relative to the edge. In this context, reference is also made to super-resolution edge distribution.

[0042] The edge position of the edge can then be determined based on this determined edge distribution. The intensity of the image point usually varies the most in the edge area. For example, the position where the edge distribution has the largest change or gradient in the normal direction can be determined as the edge position. Alternatively, the edge contrast reaches a threshold of 50% is usually defined as the edge position. In other words, this corresponds to the edge position where the intensity value or gray value corresponds to the average of the maximum and minimum intensity or gray value of the edge transfer function.

[0043] According to a second aspect of the present invention, there is provided a method for edge localization in an image with an extended depth of field, wherein the image images a region of a surface of a workpiece, the method comprising the following steps:

[0044] - capturing a plurality of images of the area of ​​the surface of the workpiece by means of the optical sensor, wherein each of the images images the area of ​​the surface of the workpiece at a different defined focal plane position in the depth direction, and wherein the captured images form a focus image stack; and

[0045] - generating an image having an extended depth of field in the depth direction based on the focus image stack; and

[0046] - Localizing the edge position of the edge in the image region of the image with extended depth of field by means of the method according to the first aspect of the invention.

[0047] According to a third aspect of the invention, a measuring device, in particular a coordinate measuring machine or a microscope, wherein the measuring device has a workpiece holder for a workpiece, an optical sensor and a control device, wherein the optical sensor is configured to capture an image of a region of a surface of the workpiece, wherein the optical sensor and the workpiece are spaced apart from each other in a depth direction, wherein the control device is designed to perform the following steps:

[0048] - controlling the optical sensor so as to capture a plurality of images of the area of ​​the surface of the workpiece by means of the optical sensor, wherein the images each image the area of ​​the surface of the workpiece at a different defined focal plane position in the depth direction, and wherein the captured images form a focus image stack;

[0049] - generating an image having an extended depth of field in the depth direction based on the focus image stack; and

[0050] - Localizing at least one edge position of an edge in an image region of an image with an extended depth of field by means of the method according to the first aspect of the invention.

[0051] According to a fourth aspect of the invention, a computer program product is provided, comprising a computer program, the computer program product having program code means for performing the method according to the first aspect of the invention when the computer program is executed on a measuring device. In addition, a computer program product may be provided, the computer program product comprising instructions, which, when the program is executed by a computer, cause the computer to perform the steps of the method according to the first aspect of the invention.

[0052] Advantageously, the method according to the invention is implemented using a processing unit or a control device, which can be a multi-purpose computer or a special-purpose computer, in which a suitable computer program or a computer program product is stored and executed, wherein the computer program or the computer program product is designed and configured for locating the edge position of an edge in an image region of an image according to the method described above and for edge locating in an image with an extended depth of field, respectively.

[0053] A workpiece is understood to mean an object to be measured, in particular a measurement object. The workpiece has a surface. An optical sensor of a measuring device can be used to capture an image of an area of ​​the surface. The measuring device can be, in particular, a coordinate measuring machine or a microscope. The optical sensor can have, for example, an image sensor and an optical system. The image sensor can be, for example, a charge coupled semiconductor element sensor, also referred to as a CCD (charge coupled device) sensor. The CCD sensor can be a monochrome sensor or a color sensor. The optical system can image an area of ​​the surface of the workpiece on the image sensor. The optical system can, in particular, have an objective lens which is telecentric at least on one side of the object.

[0054] An image captured using an optical sensor has a plurality of image points. Each image point images an object point of a region of the surface of the workpiece. The number of image points thus corresponds to the number of imaged object points. Modern optical sensors can have a resolution of several million pixels. The number of image points of the captured image and, accordingly, the number of imaged object points corresponds to the number of pixels of the optical sensor. Thus, a captured image can have several million image points.

[0055] During the process of capturing images, the focal plane position of the optical sensor is varied in the depth direction relative to the workpiece so that each image is captured at a different defined focal plane position.

[0056] Preferably, the optical sensor and the workpiece are movable relative to each other in the depth direction so that the distance between the workpiece and the optical sensor in the depth direction is variable. For example, the measuring device may have a drive device configured to move the optical sensor and the workpiece relative to each other in the depth direction. During the process of capturing an image, the distance between the optical sensor and the workpiece in the depth direction may be changed in order to change the focal plane position of each image. The depth direction may be the Z direction of a Cartesian coordinate system, wherein the captured image is an image representation of an area of ​​the surface of the workpiece in the X and Y directions. In other words, the imaging of the image is perpendicular to the depth direction. In this case, the image is recorded at different defined distances from the workpiece. In this case, "defined" means that the distance at which the image is captured is specified in advance and is therefore known. For example, the image may be recorded in steps of 50 μm.

[0057] Since the images are recorded from different distances relative to the workpiece, the focal plane of the optical sensor or the plane with maximum sharpness is different between the images. In this case, the optical settings of the optical sensor, in particular the focal length of the objective lens, can remain unchanged. Each image is captured with a different focal plane. Therefore, these images together form a focus image stack. A defined distance is assigned to each image of the focus image stack. The distance of the image corresponds to a depth value in the depth direction, in particular a Z position in the Z direction. In other words, the captured images each image an area of ​​the surface of the workpiece from a different defined distance relative to the workpiece in the depth direction, wherein a distance is assigned to each image of the focus image stack.

[0058] Alternatively, during the process of capturing an image, the change of the focal plane position can be achieved by means of refocusing the optical unit or changing the focal length of the objective lens of the optical sensor. That is, each focus setting at the objective lens is assigned a corresponding distance in the depth direction between the optical sensor and the focal plane of the setting. In this way, the focal plane of the optical sensor or the plane with maximum sharpness can be optically changed between images in order to form a focus image stack. The distance between the workpiece and the optical sensor can then remain constant.

[0059] Each image has the same number of image points. Each image point of the image images the corresponding object point of the workpiece from the area of ​​the surface of the workpiece. Therefore, each image point of the image is assigned to the corresponding object point on the surface of the workpiece. The object point can also be called a measurement point. Each object point on the surface of the workpiece has a position in the Cartesian coordinate system, in particular, an X position in the X direction, a Y position in the Y direction, and a Z position in the Z direction. The Z position in the Z direction can also be called a depth value in the depth direction. Since the captured images each image the same area of ​​the surface of the workpiece, the image points of these images are assigned to the same object point. In particular, the image points of the images with the same X coordinate and Y coordinate are assigned to the same object point. This means that each object point is assigned a corresponding image point from each image.

[0060] An image with an extended depth of field in the depth direction is then generated based on the recorded focus image stack. To this end, the focus areas of the individual images of the focus image stack are merged to form a sharp overall image. As described above, an object point is imaged sharply if it is located within the focal plane during the recording of the image. In other words, each object point is imaged most sharply at a specific focal plane position. The focal plane position at which the object point is imaged most sharply can be determined based on the images of the recorded focus image stack. The image with an extended depth of field can then, for example, consist of the image points of the images of the focus image stack at which the object point is imaged most sharply. The image with an extended depth of field can also be referred to as a measurement recording. The described procedure for generating an image with an extended depth of field thus produces a measurement recording in an optimally set plane.

[0061] The drive of the measuring device can set the distance between the workpiece and the optical sensor. To this end, the drive can move the workpiece holder and / or the optical sensor in the depth direction. The drive can have, for example, a piezo drive, a direct drive or a spindle drive. A spindle drive is particularly suitable because it has a high resolution, can move large loads and has a large capture range in the depth direction.

[0062] The drive device and the optical sensor can be controlled by means of a control device of the measuring device. For this purpose, the control device can have, for example, a closed-loop control unit, which can send control commands to the optical sensor and the drive device. The calculation steps for generating a correction image with an extended depth of field can also be performed by means of the control device of the measuring device. For this purpose, the control device can include, for example, a data processing unit, which performs the steps for generating a correction image with an extended depth of field.

[0063] The "slant edge method" known from the prior art has a central disadvantage. It is based on the assumption that straight edges run within the inspected image region (RoI) and that the edge information can be projected orthogonally with respect to the edge normal. In other words, the bevel edge method approximates arbitrarily shaped edge geometries by linear functions (i.e. with straight lines) in the sense of a first Taylor approximation. However, in metrological inspections, the distribution of circular or arbitrarily curved edges is usually measured, rather than a straight edge distribution, and the corresponding assumption of the "slant edge method" is violated.

[0064] The present invention provides a method that can purposefully address and avoid the limitations of the bevel edge method. To this end, edge progressions are approximated by arbitrarily curved progressions (e.g., circular arcs) instead of straight lines. In other words, compared to the bevel edge method, the proposed method allows approximating the local edge distribution within an image region (RoI) by means of an improved second-order or higher-order Taylor approximation instead of a less accurate first-order Taylor approximation.

[0065] This makes it possible to purposefully extend the overall advantages of the bevel edge method for edge location in its applicability to circular or arbitrarily curved edges that are usually relevant in measurement technology. In this way, the edge position of edges in images with an extended depth of field, in particular edges with a curved edge progression, can be determined better, in particular more accurately.

[0066] The technical objectives stated in the introduction are therefore fully achieved.

[0067] In a first configuration of the first aspect, the method further comprises the following steps:

[0068] - filtering the image gradient map, wherein image gradients below a defined threshold are discarded.

[0069] In particular, image gradients whose gradient values ​​G are below a defined threshold are discarded. As already explained, the intensity of image points in edge regions varies more than the intensity of image points over a flat region or area. Therefore, all small image gradients are discarded in the filtering step. Image gradients of image points that are not located in the edge region can be discarded in this way. Thus, the image gradient map is reduced to image gradients of those image points that are located in the edge region, i.e. close to or on the edge.

[0070] In a further configuration of the first aspect, the at least one edge parameter is one or more parameters of an edge progression model for describing the edge progression, wherein the at least one edge parameter is determined based on the edge progression model and the image gradient map.

[0071] The edge progression model is used to describe or approximate the actual edge progression of the edge. In other words, the curved edge progression is modeled with the aid of the edge progression model. Thus, the modeled curved edge progression is described with the aid of the edge progression model, wherein the at least one edge parameter is one or more parameters of the edge progression model and is used to describe the edge progression based on the basic edge progression model. Thus, the edge progression model describes or models the curved edge progression. The at least one edge parameter can then be determined based on the edge progression model and the image gradient map. In particular, the image gradient [G x ,G y ]. The at least one edge parameter may then be determined based on these known variables and the edge progression model.

[0072] In a further configuration of the first aspect, the at least one edge parameter is determined by curve fitting based on the edge progression model and the image gradient map, in particular wherein a least squares method is used for curve fitting.

[0073] By substituting the known variables from the image gradient map (i.e., the image gradient [G x ,G y ]) is inserted into the edge progression model to obtain an overdetermined system of equations. Then, the system of equations can be solved by curve fitting. In particular, the least squares method can be used for curve fitting.

[0074] In a further configuration of the first aspect, the edge parameter is determined by optimization based on the edge progression model and the image gradient map, in particular wherein, for the optimization, the edge progression model is minimized with respect to the local edge roughness.

[0075] Edge roughness is the edge roughness of an edge distribution. Edge roughness describes the local deviation of the intensity values ​​in the edge distribution. As already explained in the introduction, the edge distribution is generated using at least one edge parameter. In other words, the edge distribution is generated using one or more edge parameters. Therefore, the edge roughness ultimately depends on the determined value of each of the one or more edge parameters. The more each edge parameter deviates from its actual value, the greater the roughness of the generated edge distribution. The edge roughness can be determined, for example, by a comparison between a low-pass filtered edge distribution and an unfiltered edge distribution. With the aid of an optimization algorithm, at least one edge parameter can then be determined by minimizing the edge roughness. In other words, the edge parameter to be determined is optimized in such a way that the edge roughness of the edge distribution becomes minimal.

[0076] For example, this can be accomplished by first setting an initial value for each edge parameter of the edge progression model. In principle, the initial value of each edge parameter can be any value. Preferably, the initial value is a first rough estimate of the corresponding edge parameter. The edge roughness of the corresponding edge distribution can then be determined for the initial value of each edge parameter. By optimizing the value of each edge parameter, at least one edge parameter for which the edge roughness of the edge distribution is minimized can then be determined. For example, the method of simulated annealing can be used for this purpose. In particular, as already explained above, the initial value of each edge parameter can be determined by curve fitting based on the edge progression model and the image gradient map.

[0077] In a further configuration of the first aspect, a polynomial function is used as the edge progression model, in particular wherein the polynomial function is an at least quadratic polynomial.

[0078] In other words, a polynomial function is a polynomial of quadratic or higher order. In German, there are alternative expressions that also mean polynomial functions. For example, a polynomial function can be described by a Taylor series. In principle, only linear edge progressions can be modeled by a first-order polynomial (e.g., a first-order Taylor approximation). At least a second-order polynomial also allows the description (i.e., modeling) of curved edges. In this way, the position of curved edges can be determined very accurately.

[0079] In a further configuration of the first aspect, the curved edge progression has a constant curvature, wherein the at least one edge parameter defines a center of curvature of the edge progression with constant curvature, in particular wherein the projection is a projection of the image points in a radial direction relative to the center of curvature.

[0080] Constant curvature means that the curvature is circular. A curve with constant curvature has a center of curvature. The center of curvature can also be called the midpoint of curvature. In particular, every point of such a curve is at the same distance from the center of curvature. In other words, the curve curves around the center of curvature. Therefore, a curved edge progression with constant curvature also curves around the center of curvature. In particular, the at least one edge parameter has the coordinates [x0, y0] of the center of curvature. The edge progression model of constant curvature is described with the aid of two equations.

[0081]

[0082] In this case, x, y, G x , G y are known variables from the image gradient map and x0, y0, ρ are unknown variables to be determined.

[0083] The edge progression model can be simplified to the following equation:

[0084] (x-x0)G y =(y-y0)G x

[0085] The coordinates of the center of curvature [x0, y0] can then be determined based on the edge progression model and the known variables from the image gradient map. In particular, the values ​​x, y, G of each image point from the image gradient map can be x , G y Insert into the model. The result is an overdetermined system of equations. As described above, the overdetermined system of equations can then be solved by curve fitting, in particular by means of the least squares method, in order to determine the coordinates [x0, y0] of the center of curvature.

[0086] With respect to the center of curvature, a radial direction and a tangential direction proceeding perpendicularly thereto are defined. The tangential direction may also be referred to as a circumferential direction around the center of curvature. For an edge progression with constant curvature, the radial direction corresponds accordingly to the normal direction and the tangential direction corresponds to the edge progression direction. In other words, the edge progression progresses along a tangential direction relative to the center of curvature. The projection is therefore a projection along a tangential direction relative to the center of curvature onto a radial direction relative to the center of curvature. In other words, therefore, for projection purposes, each image point in the image area is assigned a radial distance relative to the center of curvature. The edge distribution is then determined based on this projection. The edge distribution thus indicates the intensity distribution I(r) of an image point in the radial direction relative to the center of curvature.

[0087] Alternatively, as described above, the coordinates [x0, y0] of the center of curvature can also be determined by optimization, in particular by minimization with respect to the local edge roughness. If the position of the center of curvature is shifted relative to the actual position, in particular relative to its nominal value, the extracted edge distribution has a higher edge roughness. The coordinates of the center of curvature for which the edge roughness of the corresponding edge distribution is minimized can then be determined by optimization.

[0088] The position of the curved edge can be determined accurately and simply in this way.

[0089] In a further configuration of the first aspect, in the step of determining the edge position, the edge position is determined based on an inflection point of the edge distribution.

[0090] In particular, the position where the edge distribution has the maximum change or gradient can be determined as the edge position. In other words, derivative-based methods can be used in particular, which analyze the maximum gradient point or inflection point of the edge distribution (e.g., the Canny edge method). As explained above, there is an intensity change at the edge transition. In particular, the intensity of the image points in the edge area varies more than the intensity of the image points on the adjacent area. Then, the edge position of the edge in the normal direction corresponds to the position where the edge distribution has the maximum gradient or intensity change in the normal direction. This position can also be called the inflection point of the edge distribution. Therefore, the inflection point is the global extreme value, in particular the maximum value, of the first-order derivative of the edge distribution. In particular, in order to determine the inflection point, a function can first be fitted to the determined edge distribution. Then the inflection point of the function can be determined. The position of the inflection point is then determined as the edge position of the edge.

[0091] In a further configuration of the first aspect, in the step of determining the edge position, the edge position is determined based on reaching a defined threshold of the edge distribution.

[0092] In other words, for example, a threshold method can be used to determine the edge position. In this case, the threshold value at which the edge contrast reaches this threshold value is defined as the edge position. A commonly used threshold value corresponds to an edge contrast of 50%. In other words, the edge position in this case corresponds to the position where the intensity value or gray value corresponds to the average of the maximum and minimum intensity or gray value of the edge transfer function. In particular, in order to determine the edge position, a function can first be fitted to the determined edge distribution. Then, the independent variable of the function can be determined, at which the function reaches the defined edge contrast or threshold value. The determined independent variable then corresponds to the edge position.

[0093] In a further configuration of the first aspect, the method further comprises the following steps:

[0094] - Receiving the image with the extended depth of field.

[0095] The image with the extended depth of field can be recorded, for example, by means of a measuring device or some other suitable device.The image with the extended depth of field is then received so that edge positioning can be performed based on the received image.

[0096] In a further configuration of the first aspect, the image with the extended depth of field images a region of a surface of the workpiece, wherein the method further comprises the steps of:

[0097] - receiving a focus image stack, wherein the focus image stack has a plurality of images of the workpiece, wherein the images image the area of ​​the surface of the workpiece at different defined focal plane positions in the depth direction, wherein a focal plane position is assigned to each image of the focus image stack; and

[0098] - generating an image with an extended depth of field in the depth direction based on the focus image stack.

[0099] In the method, it is also possible to directly generate an image with an extended depth of field, instead of receiving an image with an extended depth of field after it has already been generated. As already explained above, an image with an extended depth of field can be generated based on the focus image stack, which images a region of the surface of the workpiece. In this generated image, the edge position of the edge can then be located in the image region of the image.

[0100] In a further configuration of the first aspect or of the second aspect, image points of the images in the focus image stack are in each case assigned to corresponding object points on the surface of the workpiece, wherein the method further comprises the following steps:

[0101] - determining a sharpness value for each image point of each image of the focus image stack;

[0102] - determining a depth value in the depth direction for each object point on the surface of the workpiece based on the determined sharpness values,

[0103] Therein, in the generating step, the image with extended depth of field is generated based on the determined depth values ​​and the focus image stack.

[0104] A sharpness value is determined for each image point. The sharpness value may also be referred to as a focus value. The sharpness value specifies a measure relating to how sharply the respective image point is depicted. For example, the brightness, contrast value or grayscale value of the image point may be taken into account to determine the sharpness value. In particular, the gradient of the brightness, contrast value or grayscale value relative to the surrounding image points may be determined to determine the focus value. The greater the gradient, the sharper the image point and the greater the focus value. The sharpness values ​​are stored in a 3D sharpness matrix.

[0105] In order to determine the depth value of an object point, the corresponding image points of the focus image stack assigned to the corresponding object point are considered together. In this case, each of these image points comes from a different image. Therefore, each image point is assigned a different distance and correspondingly a different depth value in the depth direction. Based on this, the depth value at which the object point is most clearly imaged can be determined for each object point. The depth values ​​of all object points form a depth map.

[0106] Once a depth value has been determined for each object point from the captured area of ​​the surface of the workpiece, an image with an extended depth of field can be generated based on the determined depth value of the object point and the focus image stack. In other words, an image with an extended depth of field is generated based on the depth map and the focus image stack. To this end, for example, for each object point, that image point from the set of image points assigned to the object point, whose depth value is closest to the determined depth value of the object point, can be obtained from the focus image stack. In other words, for each object point, that image point that images the object point most clearly can be obtained from the focus image stack.

[0107] In a further configuration of the first aspect or the second aspect, the method further comprises the following steps:

[0108] - fitting a function in each case along the depth direction to the sharpness values ​​of those image points of the images which are assigned to the same object point,

[0109] The depth value of each object point on the surface of the workpiece in the depth direction is determined based on the maximum value of the corresponding fitting function.

[0110] Determining the depth value of an object point involves adapting a function in or along the depth direction to the sharpness value of the corresponding image point assigned to the object point. This function can also be referred to as a sharpness function. As mentioned above, the sharpness value is maximum when the object point is located in the focal plane of the optical sensor. If the distance relative to the workpiece is shortened or prolonged, the sharpness value decreases. The depth value of the object point can therefore be determined from the maximum value of the function fitted to the sharpness value of the image point corresponding to the object point. Suitable functions are in particular those which are axially symmetric with respect to a maximum value, in particular with respect to a global maximum value.

[0111] In a further configuration of the first aspect or the second aspect, the method further comprises the following steps:

[0112] - fitting a function in each case along the depth direction to the sharpness values ​​of those image points of the images which are assigned to the same object point,

[0113] The depth value of each object point on the surface of the workpiece in the depth direction is determined based on the maximum value of the fitting function and the residual of the fitting function.

[0114] In particular, if the residual of the corresponding fitting function is greater than a defined threshold, the depth value of the object point on the surface of the workpiece in the depth direction is determined based on the maximum value of the corresponding fitting function, and if the residual of the corresponding fitting function is equal to or less than the defined threshold, the depth value of the object point on the surface of the workpiece in the depth direction is determined by interpolating the depth values ​​of at least two adjacent object points.

[0115] The residual is a measure of the extent to which the function deviates from the determined sharpness value. The residual therefore indicates the quality of the fit. For each object point, a function is fitted to the corresponding sharpness value. For the function, a maximum value and a residual are determined. Next, it is determined whether the residual exceeds a threshold value. If the residual does not exceed the threshold value, a depth value for the corresponding object point is determined based on the maximum value of the function. If the residual does not exceed the threshold value, a depth value for the corresponding object point is determined by interpolation. For the purpose of interpolation, at least two, in particular all neighboring object points for which depth values ​​have already been determined, are used. In this way, artifacts in images with an extended depth of field that may be caused, for example, by defocused object points or stray astigmatism are suppressed.

[0116] In particular, for each object point whose residual exceeds a threshold, a depth value may first be determined based on the corresponding maximum value of the fitting function. Then, the depth values ​​of the remaining object points whose residuals do not exceed the threshold and whose depth values ​​have not yet been determined are determined by interpolating the depth values ​​of other object points whose depth values ​​have been determined. Alternatively, the depth values ​​of all object points may first be determined based on the maximum value of the fitting function. The depth values ​​of the object points whose calculated residuals are below the threshold are then discarded again. For the object points whose depth values ​​have been discarded again, the depth values ​​are then determined by interpolation, as described above.

[0117] In a further configuration of the first aspect or the second aspect, the function to be fitted is a Gaussian function, wherein the depth value of each object point corresponds to an expected value (also called a median or center value) of the corresponding Gaussian function.

[0118] The Gaussian function has in principle a global maximum at its expected value. If the Gaussian function is thus adapted to the sharpness value of an image point of an object point, the depth value of the object point can be determined based on the expected value. Furthermore, if the distance relative to the workpiece varies in the depth direction, the intensity distribution curve or the sharpness distribution curve in the depth direction largely follows the Gaussian curve. Therefore, if a Gaussian curve is fitted to each point of the area to be imaged, in particular for each object point, the accuracy and reproducibility of the depth map can therefore be further improved, and thus the accuracy and reproducibility of images with an extended depth of field can also be further improved.

[0119] In a further configuration of the first aspect or the second aspect, a depth value in the depth direction is assigned to each image of the focus image stack.

[0120] Based on the depth values ​​of the image, a function can be fitted to the image points of the object points and the depth value of the corresponding object point can be determined. In this case, the depth value of the object point, in particular the z position, is directly generated by the maximum depth value of the fitted function. In particular, the depth values ​​of the image can be successively connected in discrete steps. For example, the images can be recorded in steps of 50 μm. This means that the distance of the image in the depth direction relative to the workpiece changes from one image to another by 50 μm, in particular becomes larger or smaller.

[0121] In a further configuration of the first aspect or the second aspect, the sharpness value of each image point is determined based on the sharpness of the image point.

[0122] As already explained before, the sharpness value of an image point can be determined, for example, based on a gradient relative to surrounding image points of the corresponding image.

[0123] In a further configuration of the first aspect or the second aspect, the method further comprises the following steps:

[0124] - Correcting one or more imaging aberrations in the generated image with extended depth of field, wherein the imaging aberrations to be corrected include at least one of the following aberrations: distortion aberration and / or astigmatism aberration.

[0125] By correcting one or more imaging aberrations, a corrected image with an extended depth of field is generated. In this case, the one or more imaging aberrations to be corrected are distortion aberrations and / or astigmatism aberrations.

[0126] During the recording of a focus image stack, imaging aberrations may occur which are caused by the optical system used to record the focus image stack. All optical systems have imaging aberrations within the manufacturing tolerance range, which are also called optical aberrations. The aberrations lead to systematic measurement errors in the calculated depth values. Astigmatism constitutes a particular problem because it distorts the depth values. At least the first-order and second-order aberrations in the aberration scheme according to Zernike can be taken into account and corrected. Therefore, the astigmatic aberration is corrected by correcting the calculated depth value for each object point. Then, a corrected image with an extended depth of field can be generated based on the corrected depth values. The proposed correction mechanism makes it possible to perform a digital aberration correction, with the help of which the accuracy is further improved.

[0127] In addition to astigmatism aberrations, distortion aberrations may also occur. Distortion is a geometric imaging aberration in an optical system, which results in a local change of the imaging scale in the lens equation. This results in the imaging of the object to be inspected not conforming to the length or the scale. In other words, the distortion affects the measurability of the dimensions. The distortion may have a distortion center which may be located on the optical axis. The distortion center is the point of symmetry of the distortion. The distortion may be rotationally symmetric about this point of symmetry. In other words, the distortion results in the imaging not conforming to the length and / or the shape. The radial direction and the tangential direction may be defined relative to the distortion center. The radial direction and the tangential direction are perpendicular to each other.

[0128] The distortion aberration of the optical system thus results in a proportional change in the x-direction and the y-direction (i.e., perpendicular to the depth direction). In other words, due to the distortion, each image point has imaging aberrations in the x-direction and the y-direction. This imaging aberration increases as the distance of the image point from the optical axis increases.

[0129] Distortions may typically include radial distortion and / or tangential distortion. Radial distortion and tangential distortion may be described, for example, by the Brown-Conrady model. Radial distortion describes a distortion or a change in scale in the radial direction. In the case of radial distortion, the image points are thus distorted in the radial direction. Tangential distortion describes a distortion or a change in scale in the tangential direction. In the case of tangential distortion, the image points are thus distorted in the tangential direction.

[0130] Therefore, in order to obtain a corrected image with an extended depth of field without any distortion aberrations, the distortion aberrations are corrected in the image with the extended depth of field. To this end, for example, each image point of the image with the extended depth of field can be shifted / undistorted in the x-direction and in the y-direction in order to compensate for the distortion aberrations. In particular, each image point of the image with the extended depth of field can be shifted / undistorted in the radial direction and optionally in the tangential direction relative to the distortion center in order to compensate for the distortion aberrations.

[0131] The correction of imaging aberrations, in particular distortion and astigmatism, results in a corrected image with an extended depth of field in which edges can be better located.

[0132] In a further configuration of the first aspect or the second aspect, in order to correct the distortion aberration, each point of the image with extended depth of field is assigned at least one distortion value, wherein the position of each point of the image with extended depth of field is corrected perpendicular to the depth direction based on the at least one distortion value.

[0133] The distortion value is a correction value of the distortion of the corresponding image point. The at least one distortion value is preferably predetermined. The at least one distortion value determines how the position of a point of the image with extended depth of field changes perpendicularly to the depth direction (i.e. in the x-direction and the y-direction). In other words, the distortion value indicates how the point should be shifted in the x-direction and / or the y-direction for correction purposes. In particular, the at least one distortion value can determine how the point should be shifted in the radial direction and / or the tangential direction relative to the center of distortion in order to correct radial distortion and tangential distortion. By correcting (i.e. not distorting) the position of each point of the image with extended depth of field based on the at least one distortion value, a proportional, measurable measurement record is generated.

[0134] In a further configuration of the first aspect or the second aspect, each point of the image with extended depth of field is assigned a first distortion value and a second distortion value, wherein the position of each point of the image with extended depth of field is corrected in a first direction based on the first distortion value and corrected in a second direction based on the second distortion value.

[0135] In this way, the distortion of a point can be corrected in two different directions. The first direction and the second direction are perpendicular to the depth direction. The first direction and the second direction are preferably not parallel to each other, in particular are perpendicular to each other. For example, the first direction may be the x-direction and the second direction may be the y-direction. In this case, the first distortion value is used to correct the distortion in the x-direction, and the second distortion value is used to correct the distortion in the y-direction. Alternatively, the first direction may also be a radial direction, and the second direction may be a tangential direction relative to the center of distortion. In this case, the first distortion value is used to correct the radial distortion, and the second distortion value is used to correct the tangential distortion.

[0136] In a further configuration of the first aspect or the second aspect, astigmatism aberration is corrected before distortion aberration.

[0137] As already explained in the introduction, the distance measured in the image (i.e. the scale) varies depending on the autofocus in relation to the edge orientation. The greater the telecentricity deviation of the system, the greater this error becomes. In other words, the astigmatism of the optical system causes the scale to vary depending on the edge orientation. This means that due to the influence of the astigmatic image, the determined best (sharpest) image point will no longer be located on the optimal setting plane according to Petzval, but will be averaged between the sagittal optimal setting plane and the tangential optimal setting plane depending on the edge orientation. In order to minimize the measurement influences associated with telecentricity, an astigmatism-compensated (corrected) image with an extended depth of field can therefore be determined. For this purpose, an image with an extended depth of field is calculated on the optimal setting plane according to Petzval, independent of the edge orientation, and a distortion correction is then performed on this image with an extended depth of field.

[0138] In a further configuration of the first aspect or the second aspect, in order to correct the astigmatic aberration, an angle map of the area of ​​the surface of the workpiece is generated, wherein a first correction value and a second correction value are assigned to each point of the image with an extended depth of field, wherein the depth value of each point of the image with an extended depth of field is corrected based on the first correction value, the second correction value and the angle map.

[0139] Astigmatism is the aberration of "oblique" light rays. An obliquely incident light beam is refracted to different degrees in the meridian and sagittal planes. The lens is foreshortened in the direction of the meridian plane, which results in a shorter focal length than in the sagittal plane. In other words, the astigmatism is direction-dependent, in particular dependent on the direction of the edge in the image representation of the image. The astigmatism of each point can be described by means of an angle-dependent function, in particular a model or a fitting function, wherein at least two parameters have a first correction value and a second correction value. In other words, the astigmatism model is an adaptation to the depth value deviation represented by the circular azimuth. In particular, the astigmatism can be modeled as a linear combination of two radially symmetric sine functions. In this case, the first correction value corresponds to a coefficient in the first sine function and the second correction value corresponds to a coefficient in the second sine function. Preferably, the two sine functions are shifted by π / 2. The first correction value and the second correction value thus constitute two correction values ​​in two mutually perpendicular directions. In order to correct the astigmatism, an angle map of a region of the surface of the workpiece is generated. The angle map is determined based on the image gradient. The image gradient can be determined based on all or part of the focus image stack of each point of the image or workpiece area with an extended depth of field. For this purpose, an image gradient is calculated for each point. The image gradient is determined according to the brightness change relative to the surrounding image points. The direction of the image gradient can be represented by an angle. Therefore, each point in the angle diagram is assigned an angle indicating the direction of the image gradient. In other words, the angle diagram represents the corresponding angle of the image gradient of each point of the corrected image with extended depth of field. Based on the angle, the ratio of the first correction value and the second correction value can then be calculated for the purpose of correcting the depth value of the corresponding object point. The ratio of the first correction value can be determined in particular by the product of the first correction value and the sine of the angle of the corresponding point. Therefore, the ratio of the second correction value can also be determined by the product of the second correction value and the cosine of the angle of the corresponding point. The correction of the corresponding depth value can be implemented in particular by subtracting the sum of the ratios of the first correction value and the second correction value from the corresponding depth value. The first correction value and the second correction value can be in particular pre-calculated or predetermined. In this way, astigmatism aberrations in the depth value can be corrected. Based on the corrected depth value of the object point, an image with an extended depth of field can then be corrected, in particular newly generated. By correcting the astigmatism aberration, the accuracy of the image with an extended depth of field is further improved. Calculating the image with extended depth of field based on the corrected depth values ​​corresponds to evaluating the image with extended depth of field on an optimally set plane for astigmatism compensation according to Petzval.

[0140] In a further configuration of the second aspect, the optical sensor and the workpiece are movable relative to each other in the depth direction so that the distance between the workpiece and the optical sensor in the depth direction is variable, wherein the method further comprises the following steps:

[0141] - changing the distance between the workpiece and the optical sensor,

[0142] Wherein, in the capturing step, the plurality of images are captured while the distance between the workpiece and the optical sensor is changed, wherein each of the images images the region of the surface of the workpiece from a different defined distance relative to the workpiece in the depth direction.

[0143] In this way, the focal plane position of the optical sensor is varied in the depth direction relative to the workpiece while images forming a focused image stack are recorded.

[0144] In a further configuration of the second aspect, the measuring device has a workpiece holder, wherein the workpiece is arranged on the workpiece holder for measuring purposes.

[0145] The workpiece holder can in particular be a workbench, a measuring table or a stage. The workpiece holder is configured to hold the workpiece in a defined position during the measuring process. For this purpose, the workpiece holder can have a planar surface on the top side, on which the workpiece can be arranged, for example, during the recording of an image with an extended depth of field.

[0146] In a further configuration of the second aspect, the measuring device has a drive device, wherein the drive device moves the optical sensor relative to the workpiece holder in the depth direction and / or moves the workpiece holder relative to the optical sensor in the depth direction in order to change the distance between the workpiece and the optical sensor.

[0147] In other words, the drive device is configured to move the workpiece holder and the optical sensor relative to each other in order to change the distance between the workpiece and the optical sensor. For this purpose, the drive device can move the workpiece holder in the depth direction or the optical sensor in the depth direction or the workpiece holder and the optical sensor in the depth direction.

[0148] In a further configuration of the second aspect, the distance between the workpiece and the optical sensor is varied in discrete steps.

[0149] In this case, the distance can be increased or decreased stepwise. For example, the distance can be varied in steps of 50 μm.

[0150] In a further configuration of the second aspect, the measuring device has an illumination device, wherein the method further comprises the following steps:

[0151] - illuminating the workpiece by means of the illumination device during the process of capturing images of the focus image stack.

[0152] The illumination device is used to illuminate at least a region of the surface of the workpiece. The reflected light is then used to generate an image in the optical sensor. In this way, the region of the workpiece can be illuminated uniformly and depth values ​​of the surface regions can be determined with substantially the same accuracy. The illumination can be in the form of coaxial illumination, annular illumination, dark field illumination, diffuse illumination or point source illumination, for example. The illumination device can in particular be a monochromatic light source, for example a monochromatic laser. The advantage of a monochromatic light source is that no chromatic aberration occurs.

[0153] In a further configuration of the second aspect, the method further comprises the following steps:

[0154] - Determining at least one distortion value for each image point of the image with extended depth of field, wherein an image with extended depth of field of a calibration object, in particular a point grid, is initially recorded, wherein the at least one distortion value is determined based on a deviation of the image with extended depth of field relative to a known surface contour of the calibration object.

[0155] In this way, the distortion values ​​of the image points of the image with extended depth of field are determined in an initial step. "Initial" means that the step of determining the distortion values ​​occurs before the step of capturing a plurality of images of a region of the surface of the workpiece. In order to determine the distortion values, an image of a calibration object with extended depth of field is first recorded. The calibration object can also be referred to as a calibration mask. The calibration object preferably has a circular structure. In particular, the calibration object can be a dot grid or a perforated mask. The dot grid is a regular arrangement of points. In particular, the dot grid is a geometric structure in which the points are arranged at the same distance from each other in two or three spatial directions. In the case of two spatial directions, the points are perpendicular to each other. In the case of three spatial directions, the points are arranged in pairs at an angle of 60° relative to each other. Each point of the dot grid has a spatial extent and is preferably circular. Each point of the dot grid can be imaged by a plurality of image points of the captured image. Each point has a planar surface. Therefore, the surface contour of the dot grid is known in advance. In particular, the dot grid can be arranged on the workpiece holder so that the points of the dot grid are located in a horizontal plane. The generation of an image of a calibration object, in particular a grid of points, with an extended depth of field is implemented according to a method for generating a corrected image with an extended depth of field, but without correcting distortion aberrations. The recorded image of the calibration object is then analyzed with the aid of a distortion routine in order to determine the distortion, in particular the distortion value. In particular, the distortion value can be determined by comparing the recorded image of the calibration object and / or the associated determined depth value with a known surface contour of the calibration object. Each determined distortion value can be stored in particular in an electronic storage unit. The measuring device can have this storage unit. In particular, the distortion values ​​can be stored in the form of a table ("lookup table"). After the distortion values ​​have been determined, a corrected image of the workpiece with an extended depth of field can be recorded. In this case, the depth values ​​of the object points can be corrected with the aid of the determined distortion values. In this way, the distortion values ​​of the image points can be easily determined and corrected.

[0156] In a further configuration of the second aspect, the method further comprises the following steps:

[0157] - Determining a first correction value and a second correction value for each image point of the image with extended depth of field, wherein an image with extended depth of field of a calibration object, in particular a point grid, is initially recorded, wherein the respective correction value is determined based on deviations of the determined depth values ​​of the image with extended depth of field or of the object points of the calibration object relative to a known surface contour of the calibration object.

[0158] In order to determine the first correction value and the second correction value, each point of the point grid is considered individually. The first correction value and the second correction value can then be determined based on the deviation of the calculated depth profile relative to the actual depth profile of the corresponding point, which profile is a planar surface. In order to determine the correction value, an image of the point grid with an extended depth of field is therefore recorded in advance (i.e. initially recorded). The generation of an image of a calibration object, in particular a point grid, with an extended depth of field is implemented according to a method for generating a correction image with an extended depth of field, but without the step of correcting one or more imaging aberrations. Each correction value determined can be stored in particular in an electronic storage unit. The measuring device can have this storage unit. After the desired correction value has been determined, a correction image of the workpiece with an extended depth of field can be recorded. In this case, the depth value of the object point can be corrected with the aid of the determined correction value. In this way, the correction value can be easily determined and corrected.

[0159] In a further configuration of the second aspect, determining the first correction value and the second correction value comprises the following steps:

[0160] - determining a first correction value and a second correction value for each point of the point grid based on a cost function between the astigmatism model and the depth value of the corresponding point; and

[0161] - interpolating the first correction value and the second correction value based on the first correction value and the second correction value for each point of the point grid.

[0162] As described above, each point of the point grid is imaged by a plurality of image points of the captured image. The depth value of each individual point can be segmented after generating a corrected image with an extended depth of field of the point grid. In this case, the points of the corrected image with an extended depth of field that are respectively assigned to and imaged by the points of the point grid are first determined. As described above, the astigmatism model is an adaptation to the depth value deviation represented by the circular azimuth. The adapted fitting function described by the fitting parameters corresponds to the first correction value and the second correction value of the corresponding point of the point grid. In particular, the astigmatism model can be a linear combination of two radially symmetric sine functions. The cost function is then minimized according to the coefficients of the sine function. The coefficients of the sine function correspond to the first correction value and the second correction value of the corresponding point of the point grid. Starting from the first correction value and the second correction value determined for each point of the point grid, the first correction value and the second correction value of each point of the corrected image with an extended depth of field are determined by interpolation based on the first correction value and the second correction value of each point of the point grid.

[0163] In a further configuration of the second aspect, the method further comprises the following steps:

[0164] - outputting the image with extended depth of field and / or the edge position of an edge in an image region of the image with extended depth of field by means of an output device.

[0165] The output device may have, for example, a display, wherein the corrected image with the extended depth of field may be displayed on the display. Furthermore, the output device may be configured to output the corrected image with the extended depth of field to an electronic storage device, another device, or an external display. The electronic storage device may be, for example, a storage medium, in particular a hard disk, a flash memory, or a cloud. For example, the other device may use the corrected image with the extended depth of field to perform further processing. For example, the external display may be configured to display the corrected image with the extended depth of field.

[0166] In a further configuration of the third aspect, the measuring apparatus further has a drive device, wherein the drive device is configured to move the optical sensor and the workpiece holder relative to each other in the depth direction in order to change a distance between the workpiece and the optical sensor.

[0167] Thus, the drive device can be used to set the focal plane position of the optical sensor in the depth direction relative to the workpiece.

[0168] In a further configuration of the third aspect, the control device is further designed to perform the following steps, in particular before the step of generating the corrected image with extended depth of field:

[0169] - controlling the drive device in such a way as to change the distance between the workpiece and the optical sensor,

[0170] wherein the optical sensor is controlled in such a manner as to capture the plurality of images when the distance between the workpiece and the optical sensor is varied, wherein the images each image the region of the surface of the workpiece from a different defined distance relative to the workpiece in the depth direction.

[0171] In this way, the focal plane position of the optical sensor is varied in the depth direction relative to the workpiece while images forming a focused image stack are recorded.

[0172] It goes without saying that the features mentioned above and the features still to be explained below can be used not only in the respectively indicated combination but also in other combinations or alone, without departing from the scope of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0173] Exemplary embodiments of the present invention are shown in the drawings and are explained in more detail in the following description. In the drawings:

[0174] Figure 1 shows a schematic diagram of the measuring device;

[0175] Figure 2 A schematic diagram showing a method for generating a corrected image with an extended depth of field;

[0176] Figure 3 A schematic diagram showing a method for recording a corrected image with an extended depth of field;

[0177] Figure 4 A schematic diagram showing method steps for determining a correction value;

[0178] Figure 5 A schematic diagram showing the steps of a method for determining a distortion value;

[0179] Fig. 6A An exemplary view of a focus image stack is shown;

[0180] Figure 6B A view showing a graph for illustrating a sharpness value determined along a depth direction is shown;

[0181] Figure 6C shows a diagram for demonstrating a function fitted to a graph of sharpness values ​​determined along a depth direction;

[0182] Fig.6D An exemplary view of an image with an extended depth of field is shown;

[0183] Figure 7 An exemplary view for demonstrating imaging onto a curved image plane under the influence of field curvature is shown;

[0184] Figure 8 An exemplary view for demonstrating the astigmatism of a lens is shown;

[0185] Fig. 9 An exemplary view for demonstrating imaging onto a curved image plane under the influence of astigmatism is shown;

[0186] Fig.10 An exemplary view for demonstrating imaging onto a curved image plane under the influence of field curvature and astigmatism is shown;

[0187] Fig.11 shows exemplary views for illustrating different image planes during recording of an image with extended depth of field under the influence of field curvature;

[0188] Fig.12 shows exemplary views for demonstrating different image planes during recording of an image with extended depth of field under the influence of field curvature and astigmatism;

[0189] Fig.13A A view showing a depth map of an uncorrected astigmatic aberration;

[0190] Fig. 13B A view showing an image with extended depth of field without correction for astigmatism aberration;

[0191] Fig.14A A view showing a depth map corrected for astigmatic aberration;

[0192] Fig. 14B A view showing an image with extended depth of field corrected for astigmatic aberrations;

[0193] Fig.15A A view showing a diagram of a grid of points;

[0194] Fig. 15B Shown is a diagram for showing the Fig.15A A view of a 3D map of the sharpest image points at the edge of a grid of points;

[0195] Fig. 15C Shown is a diagram for showing the Fig. 15B A view of a plot of depth values ​​of sharpest image points versus corresponding edge orientation angles;

[0196] Fig.16A shows a view of a first graph according to a first example, in which depth values ​​of sharpest image points of an edge of a grid of points fitting a fitting function to are presented;

[0197] Fig. 16B shows a view of a second figure according to the first example, in which the spatial distribution of depth values ​​in the image plane (xy plane) is presented;

[0198] Fig. 16C shows a view of a third figure according to the first example, in which the spatial distribution of the corrected depth values ​​in the image plane (xy plane) is presented;

[0199] Fig.17A shows a view of a first graph according to a second example, in which depth values ​​of sharpest image points of an edge of a grid of points fitting a fitting function to are presented;

[0200] Fig. 17B shows a view of a second diagram according to a second example, in which a spatial distribution of depth values ​​in an image plane (xy plane) is presented;

[0201] Fig. 17C shows a view of a third figure according to the second example, in which the spatial distribution of the corrected depth values ​​in the image plane (xy plane) is presented;

[0202] Fig.18 A first exemplary view of an image region of an image with an extended depth of field is shown, wherein straight edges running in the image region, projections of image points of the image region in the normal direction, and an edge distribution based thereon are shown;

[0203] Fig.19a second exemplary view of an image region of an image with an extended depth of field showing a curved edge progressing in the image region;

[0204] Fig. 20A a third exemplary view of an image region of an image with an extended depth of field, wherein a curved edge with a constant curvature progressing in the image region is shown;

[0205] Fig. 20B shows an exemplary view of a graph showing edge distribution in a radial direction of an edge from an image of FIG. 20 ;

[0206] Fig.21 A schematic diagram showing a method for locating edge positions of edges in an image region of an image with an extended depth of field;

[0207] Fig. 22 A schematic diagram showing a method for edge localization in an image with extended depth of field;

[0208] FIG23 shows a diagram of a first example of edge localization in an image with extended depth of field;

[0209] FIG24 shows a diagram of a second example of edge localization in an image with extended depth of field;

[0210] Fig.25A A diagram showing edge measurement in an image by the bevel edge method;

[0211] Fig.25B Shown from Fig.25A Details of the edge areas;

[0212] Fig.26A A diagram showing edge measurement in an image by the method according to the present invention;

[0213] Fig.26B Shown from Fig.26A Details of the edge areas;

[0214] Fig. 27 A diagram showing an image of a workpiece having a plurality of circular structures;

[0215] Fig.28 The correction image with extended depth of field is shown. Fig. 27 Illustration of the roundness measurement of each circular structure in the image;

[0216] Fig.29A The uncorrected image pair in the sagittal plane is shown from Fig. 27 a graphical representation of circularity measurements of various circular structures in an image of FIG.

[0217] Fig.29B The uncorrected image pair in the tangential setting plane is shown from Fig. 27 Illustration of the circularity measurement of individual circular structures in an image. DETAILED DESCRIPTION

[0218] Figure 18 to Figure 2 6 describes an exemplary embodiment of edge localization of edges in an image. Figure 1 to Figure 1 7 describes various exemplary embodiments for generating and recording an image with an extended depth of field, based on which edge localization can then be performed. The described method for edge localization of edges in images can in principle also be applied to single images, ie to images without an extended depth of field.

[0219] Figure 1 A measuring device 10 is shown. The measuring device can be a microscope or a coordinate measuring machine. The measuring device 10 is used to measure a workpiece 12. For this purpose, the measuring device 10 has an optical sensor 14. In addition to the optical sensor 14, other sensors, such as tactile sensors, can of course also be provided, but they are not shown in this schematic diagram.

[0220] The optical sensor 14 may have an optical system 30 and an image sensor. The optical system 30 images a region of the surface of the workpiece 12 onto the image sensor. The optical sensor 14 may capture an image of a region of the surface of the workpiece 12 by means of the image sensor.

[0221] Furthermore, the measuring device 10 can have an illumination device 32 . The illumination device is configured to illuminate at least a region of the surface of the workpiece 12 .

[0222] The workpiece 12 to be measured is arranged on the workpiece holder 16. The workpiece holder 16 can be a measuring table, a workbench or a stage. In the illustrated view, the workpiece holder 16 is oriented in the XY plane of the coordinate system 18. The Z direction 20 extends perpendicular to the workpiece holder 16. The Z direction 20 is a depth direction. The distance between the optical sensor 14 and the workpiece 12 in the depth direction 20 is represented by the reference numeral 22. The distance between the optical sensor 14 and the workpiece holder 16 in the depth direction 20 is represented by the reference numeral 34. The optical sensor 14 and the workpiece holder 16 can be moved relative to each other. The distance 34 can be changed in this way. Because the workpiece 12 is arranged on the workpiece holder 16, the distance 22 changes according to the distance 34. In principle, for this purpose, it can be provided that the workpiece holder 16 can be moved in the depth direction 20 and / or the optical sensor 14 can be moved in the depth direction 20, for example, by means of a suitable mechanism 24.

[0223] The measuring device 10 may also have a drive device 28. The drive device 28 is configured to move the workpiece holder 16 and the optical sensor 14 relative to each other in the depth direction 20. Preferably, the drive device 28 is configured to move the workpiece holder 16 relative to the optical sensor 14 in the depth direction 20. Alternatively, the drive device 28 may also be configured to move the optical sensor 14 relative to the workpiece holder 16 in the depth direction 20. It goes without saying that the drive device 28 may also be configured to move both the optical sensor 14 and the workpiece holder 16 in the depth direction 20.

[0224] The device 10 also has a control device 26. The control device 26 is designed to control the various components of the measuring device and process data. For this purpose, the control device 26 can have different subunits, for example, each of which performs control of the components and / or processing of the data. For example, the control device 26 can include a closed-loop control unit that controls the drive device 28, the optical sensor 14 and / or the lighting device 32. In addition, the control device 26 can have a data processing unit that is designed to perform an evaluation of the captured image of the optical sensor. The data processing unit can, for example, generate an image with an extended depth of field of an area of ​​the surface of the workpiece 12 based on multiple images forming a focus image stack. In addition, the data processing unit can locate or determine, for example, the edge position of an edge in the image area of ​​the generated image with an extended depth of field.

[0225] The control device 26 may be connected to or have a non-volatile data storage device storing a computer program. In some exemplary embodiments, the control device 26 is a multi-purpose computer, for example, A commercially available personal computer running under Linux or MacOS, and a computer program from the memory has a program code designed and configured for implementing an embodiment of the method of the present invention in combination with the optical sensor 14 and the drive device 28. In an alternative exemplary embodiment, the control device 26 is a logic circuit, for example, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a microcontroller or any other suitable programmable circuit. It is possible to implement an embodiment of the method of the present invention with a logic circuit, in particular the control steps and the determination steps, so that the logic circuit is designed and configured for implementing an embodiment of the method of the present invention in combination with the optical sensor 14 and the drive device 28. In order to implement an embodiment of the method of the present invention in a logic circuit, any suitable programming language or hardware description language can be used, such as C, VHDL, etc.

[0226] In addition, the measuring device 10 can have an output device 36. The output device 36 is designed to output an image with an extended depth of field, a generated edge distribution and / or a located edge position. In particular, the output device 36 can be designed to output the located edge position. The output device 36 can include, for example, a display on which an image with an extended depth of field, a generated edge distribution and / or a located edge position can be displayed. Alternatively or in addition, the output device 36 can be configured to output an image with an extended depth of field, a generated edge distribution and / or a located edge position to an electronic storage device, another device or an external display.

[0227] Furthermore, the measuring device 10 may also have an input device, by means of which the user can input, for example, the number of images to be captured and the distance or step length into the coordinate measuring machine 10 , or can manually move the optical sensor 14 .

[0228] Before recording an area of ​​the surface of the workpiece 12, provision may be made for the user to input the number of images to be captured and the step size or distance 22 at which the images are desired to be captured. Alternatively, the number of images to be captured and the step size or distance 22 at which the images are desired to be captured may be predefined or fixedly specified. In order to record an area of ​​the surface of the workpiece 12, the control device 26 then controls the drive device 28 so that the distance 22 between the workpiece 12 and the optical sensor 14 varies according to a preset. At the same time, the control device 26 controls the optical sensor 14 so that a plurality of images of an area of ​​the surface of the workpiece 12 are captured according to a preset when the distance 22 varies. In this case, each image is captured at a different distance 22 from the workpiece 12. The plurality of images then form a focus image stack. The focus image stack is then evaluated by the control device 26 in order to generate an image of the area of ​​the surface of the workpiece 12 with an extended depth of field. In this image with an extended depth of field, the edge position of the edge can then be located in the image area of ​​the image.

[0229] Figure 2 A computer-implemented method 40 is shown for generating an image with extended depth of field, in particular a corrected image, of a region of a surface of a workpiece 12 . The method can be carried out by means of a control device 26 , for example.

[0230] In a first step 42 of the method 40, a focus image stack is received. The focus image stack has a plurality of images of the workpiece 12, wherein the images image a region of the surface of the workpiece 12 at different defined focal plane positions in the depth direction, wherein the focal plane position is assigned to each image of the focus image stack. Each image has an image point. The image points of the image are respectively assigned to corresponding object points on the surface of the workpiece 12.

[0231] Preferably, each of these images images a region of the surface of the workpiece 12 from a different defined distance 22 relative to the workpiece 12 in the depth direction 20. In this case, the distance 22 is assigned to each image of the focus image stack. Since the images are captured at different distances 22 from the workpiece 12 in the depth direction 20, a depth value in the depth direction 20 is assigned to each image of the focus image stack. In particular, the depth values ​​of the images succeed each other in discrete steps.

[0232] Alternatively, the images each image a region of the surface of the workpiece 12 at a different defined focus position (i.e., a different focus image plane). In this case, each focus position or focal length setting of the objective of the optical sensor can be assigned a depth value in the depth direction 20, which corresponds to the distance relative to the focal plane in the respective focus position or setting. In this case, the distance between the optical sensor 14 and the workpiece 12 can remain constant.

[0233] Fig. 6A By way of example, four images of a focus image stack are shown, wherein different depth values ​​(positions in the z-direction) are assigned to the images.

[0234] In a further optional step 44 of the method 40, a sharpness value is determined for each image point of each image of the focus image stack. The sharpness value of the image point is determined based on the sharpness of each image point. For this purpose, for each image point, a gradient of brightness, grayscale value or contrast value relative to the surrounding image points of the corresponding image is determined. In this way, a sharpness value is assigned to each image point of each image from the focus image stack. Since each image is assigned a depth value in the depth direction 20, each image point of the corresponding image is also assigned the same depth value. In other words, a depth value and a sharpness value are assigned to each image point.

[0235] As explained in the introduction, each object point is assigned an image point from each image. Figure 6B The sharpness values ​​f(z) assigned to image points of the same object point are shown.Since the image points come from different images of the focus image stack, different depth values ​​are assigned to the image points (and thus also to their sharpness values). Figure 6B The distribution of these sharpness values ​​along the depth direction (z direction) is shown.

[0236] A further optional step 46 of the method 40 involves fitting a corresponding function to the sharpness values ​​of those image points of the image assigned to the same object point along the depth direction 20. The function describes an assignment in which a corresponding sharpness value is assigned to each depth value in the depth direction. Preferably, the function is a Gaussian function. Alternatively, other functions may also be used, for example a parabolic function for fitting. Preferably, the function is axially symmetric with respect to a maximum value. The maximum value and the residual of the fitted function may be determined.

[0237] exist Figure 6C The fitting of the function along the depth direction 20 to the sharpness values ​​of those image points of the image which are assigned to the same object point is shown in . Figure 6C Especially shown Figure 6B , where, in addition, the function is adapted to the sharpness value along the depth direction. Fig.6D By way of example, it is shown that FIG. 6A to FIG. 6C The resulting image has an extended depth of field.

[0238] A further optional step 48 of the method 40 involves determining a depth value in the depth direction 20 for each object point on the surface of the workpiece 12 based on the determined sharpness value.

[0239] For example, the depth value of each object point may be determined based on the maximum value of the respectively fitted functions. The maximum value has a position in the depth direction, that is, a depth value, wherein the depth value is determined as the depth value of the object point.

[0240] Alternatively, the depth value of each object point can be determined based on the maximum value and the residual of the respectively fitted function. The residual is a measure of the degree to which the function deviates from the determined sharpness value. Therefore, the residual indicates the quality of the fit. For each object point whose residual of the corresponding fitting function is greater than a defined threshold, the depth value is determined based on the maximum value of the corresponding fitting function. For each object point whose residual of the corresponding fitting function is equal to or less than the defined threshold, the depth value is determined by interpolating the depth values ​​of at least two adjacent object points. In particular, for this purpose, the depth values ​​of all object points can first be determined based on the maximum value of the fitting function, wherein, for object points whose residual of the corresponding fitting function is equal to or less than the defined threshold, the depth value is discarded again and the depth value is determined by interpolating the depth values ​​of the adjacent object points.

[0241] The determined depth values ​​of the object points form a depth map of the region of the surface of the workpiece 12 .

[0242] A further step 50 of the method 40 involves generating an image with extended depth of field of an area of ​​the surface of the workpiece 12 based on the determined depth value for each object point and the image of the focus image stack. In other words, an image with extended depth of field is generated based on the depth map and the focus image stack. Fig.6D By way of example, it is shown that FIG. 6A to FIG. 6C The resulting image has an extended depth of field.

[0243] In a further optional step 52 of method 40, one or more imaging aberrations are corrected in the image with extended depth of field. The imaging aberrations to be corrected may include distortion aberrations and astigmatism aberrations. In order to correct the imaging aberrations, the positions of the image points perpendicular to the depth direction and / or the depth values ​​of the object points (i.e., the depth map) may be corrected. After the depth values ​​of the object points are corrected, the image with extended depth of field is corrected or newly generated based on the corrected depth values ​​and the focus image stack. The distortion aberration is preferably corrected after the astigmatism aberration is corrected. In other words, the astigmatism aberration may be corrected before the distortion aberration.

[0244] In order to correct distortion aberration, each point of the image with extended depth of field is assigned at least one distortion value, wherein the position of each point of the image with extended depth of field is corrected perpendicular to the depth direction based on the at least one distortion value. The distortion value indicates how the point of the image with extended depth of field should be shifted / undistorted in the x-direction and / or y-direction or in the radial direction and / or tangential direction in order to correct the distortion of the point. In particular, each point of the image with extended depth of field can be assigned a first distortion value and a second distortion value, wherein the position of each point of the image with extended depth of field is corrected in the first direction based on the first distortion value and in the second direction based on the second distortion value. The first direction and the second direction here can be, for example, the x-direction and the y-direction or the radial direction and the tangential direction.

[0245] The correction of astigmatism aberration depends on the edge direction, or astigmatism aberration depends on the angle. Therefore, firstly an angle map is determined for a region of the surface of the workpiece 12. The angle map assigns an angle θ to each point of the image with extended depth of field. The angle θ is a result of the image gradient relative to the surrounding image points. A first correction value and a second correction value are assigned to each point of the image with extended depth of field, wherein the depth value of each point of the image with extended depth of field is corrected based on the first correction value, the second correction value and the angle map.

[0246] In general, the astigmatism of each corrected image with extended depth of field can be described by a function, in particular a model or fitting function, which depends on the angle θ and has at least two parameters. In the function with two parameters, these parameters correspond to a first correction value and a second correction value. In particular, the astigmatism can be modeled as a linear combination of two radially symmetric sine functions. In this case, the first correction value corresponds to a coefficient in the first sine function and the second correction value corresponds to a coefficient of the second sine function. For example, the astigmatism can be modeled with the formula αsinθ+βcosθ (first order expansion) or αsin 2θ+βcos 2θ (second order expansion).

[0247] Since the angle θ is determined by the angle map of each point of the corrected image with extended depth of field, for each point of the corrected image with extended depth of field, an effective correction value can be calculated by the formula αsinθ+βcosθ or αsin 2θ+βcos 2θ. Then, the correction of the corresponding depth value is performed by subtracting the corresponding effective correction value from the corresponding depth value. Then, a corrected image with extended depth of field can be generated with the help of the corrected depth value (depth map), in which the astigmatic imaging aberration is corrected.

[0248] The correction values ​​and distortion values ​​used to correct the corresponding imaging aberrations can be as follows Figure 4 and Figure 5 Determined in advance as described in.

[0249] Figure 3 A method 60 is shown for recording an image with an extended depth of field, in particular a corrected image, of a region of a surface of a workpiece 12 using an optical sensor 14 of a measuring device 10. For the purpose of measurement, the workpiece 12 is arranged on a workpiece holder 16. The optical sensor 14 can then capture a region of the surface of the workpiece 12. The optical sensor 14 and the workpiece 12 can be moved relative to each other in a depth direction 20, so that a distance 22 between the workpiece 12 and the optical sensor 14 in the depth direction 20 is variable.

[0250] In step 66 of the method 60, the distance 22 between the workpiece and the optical sensor is changed. For this purpose, the drive device can move the optical sensor 14 relative to the workpiece holder 16 in the depth direction 20 and / or move the workpiece holder 16 relative to the optical sensor 14 in the depth direction 20 so as to change the distance 22 between the workpiece 16 and the optical sensor 14. In particular, the distance 22 can be varied in discrete steps (e.g., in steps of 50 μm).

[0251] A further step 68 of method 60 involves capturing a plurality of images of an area of ​​the surface of the workpiece by means of the optical sensor as the distance 22 between the workpiece and the optical sensor varies, wherein the images each image an area of ​​the surface of the workpiece 12 from a different defined distance 22 relative to the workpiece 12 in the depth direction 20, wherein each image point of each image is assigned to a corresponding object point on the surface of the workpiece 12, and wherein the captured images form a focus image stack.

[0252] In a further step 70 of the method 60, by means of Figure 2 The method generates an image, in particular a corrected image, of a region of the surface of the workpiece 12 with an extended depth of field.

[0253] In a further optional step 72 of method 60 , the generated image, in particular the corrected image, with the extended depth of field is output by means of output device 36 .

[0254] In a further optional step 64 of the method 60 , the workpiece 12 is illuminated by means of the illumination device 32 during the process of capturing the image of the focus image stack.

[0255] In a further optional step 62 of the method 60, a first correction value and a second correction value are determined for each object point / image point of the image with extended depth of field. In other words, correction values ​​for correcting astigmatic aberrations are determined in this case. For this purpose, first, i.e., before recording a correction image with extended depth of field of a region of the surface of the workpiece 12, in particular before steps 64 to 72, an image with extended depth of field of a calibration object, in particular a grid of points, is recorded. The image of the calibration object with extended depth of field is generated according to steps 64 to 70 with the calibration object as workpiece, without any correction of imaging aberrations being performed during the process of generating this image. Fig.15A An exemplary illustration of a calibration object in the form of a grid of dots is shown. Since the surface contour of the calibration object is known, the correction value to be determined can be determined based on the deviation of the image of the calibration object with extended depth of field relative to the known surface contour of the calibration object.

[0256] In a further optional step 63 of the method 60, at least one distortion value for each point of the image with extended depth of field is preferably determined after step 62. For this purpose, first, i.e., before recording the correction image with extended depth of field of the area of ​​the surface of the workpiece 12, in particular before steps 64 to 72, an image with extended depth of field of a calibration object, in particular a grid of points, is recorded. The same calibration object can be used in steps 62 and 63. In particular, the image of the calibration object, in particular the grid of points, recorded in step 62 can be used in step 63. Since the surface contour of the calibration object is known, at least one distortion value for each point of the image with extended depth of field can be determined based on the deviation of the image with extended depth of field from the known surface contour of the calibration object. Preferably, for each point of the image with extended depth of field, an offset in the x-direction and / or in the y-direction or in the radial direction and / or in the tangential direction is determined, wherein the correction value indicates the offset in the corresponding direction. In particular, if each point of an image with extended depth of field is in each case assigned a first distortion value and a second distortion value, the first distortion value indicates a shift in a first direction (e.g., the x-direction or radial direction) and the second distortion value indicates a shift in a second direction (e.g., the y-direction or tangential direction).

[0257] Steps 62 and 63 can therefore be understood as calibration steps, in which systematic measurement errors of the optical sensor are determined and corresponding correction values ​​are determined. For calibration purposes, in particular a grid of points can be used.

[0258] Figure 4 An example of method steps that may be used to determine the correction value in step 62 of method 60 is shown.

[0259] In a first step 80 , an image of a point grid with extended depth of field is generated as a calibration object. According to steps 64 to 70 , an image of a point grid with extended depth of field is generated using the point grid as workpiece 12 . Fig.15A An exemplary illustration of a point grid as a calibration object is shown in .

[0260] In a further step 82, those image points of the image of the point grid with extended depth of field that image each individual point of the point grid are segmented. In this way, the image points of the image of the point grid with extended depth of field are determined, which are respectively assigned to the points of the point grid and imaged. For the purpose of segmentation, a circular Hough transform can be used, with the help of which circles can be identified. For example, a circular Hough transform can be applied to the image of the point grid with extended depth of field in order to detect the positions of the individual points of the point grid. In particular, the circular Hough transform can be used to determine, for each point of the point grid, the positions of image points (edge ​​points) arranged on the edge of each point grid circle. These edge points are then image points assigned to the corresponding points of the point grid.

[0261] A further step 84 involves determining a first correction value and a second correction value for each point of the point grid based on a cost function L between the astigmatism model and the corrected depth value of the corresponding point of the point grid. A linear combination of two radially symmetric sine functions can be used as the astigmatism model. The astigmatism model can be defined, for example, by the formula αsin2θ+βcos2θ. In this case, α and β are coefficients of the sine function, and θ is the angle in the XY plane around the center point of the corresponding point of the point grid. The cost function L is defined according to the following equation: L(α,β)=∑|f(r,θ)-(αsin2θ+βcos2θ)| 2

[0262] In this case, in the cost function, the sum of those points assigned to or imaging and / or representing the corresponding points of the point grid is formed, which forms a corrected image with an extended depth of field. The positions of these points in the XY plane can be indicated in polar coordinates r and θ relative to the center point of the corresponding points of the point grid. f(r,θ) indicates the deviation of the depth values ​​of these points of the corrected image with an extended depth of field relative to the average depth value of the points of the point grid. The cost function is then minimized according to the coefficients of the sine function. The first correction value and the second correction value of the points of the point grid can then be determined based on the minimized coefficients α and β. In particular, the first correction value and the second correction value of the points of the point grid correspond to the minimized coefficients.

[0263] In a further step 86, first correction values ​​and second correction values ​​for image points of the image with extended depth of field, in particular first correction values ​​and second correction values ​​for depth values ​​of object points, are interpolated over the entire area based on the first correction values ​​and second correction values ​​for each point of the point grid. In this way, first correction values ​​and second correction values ​​can be assigned to each image point of the image with extended depth of field, in particular each object point.

[0264] Figure 5 The method steps for determining distortion values ​​for points of the image with extended depth of field in step 63 of method 60 are shown.

[0265] In a first step 110, an image of a dot grid with an extended depth of field is generated as a calibration object. The image of the dot grid with an extended depth of field is preferably generated according to steps 64 to 70 using a dot grid as workpiece 12. In particular, the image of the dot grid with an extended depth of field recorded in steps 62 and 80 can be used in step 110.

[0266] In particular, in addition to distortion aberrations, one or more of the imaging aberrations can already be corrected in the recorded images of the point grid with extended depth of field. In particular, astigmatism aberrations can be corrected.

[0267] In a further step 112 , at least one distortion value for each image point of the image with extended depth of field is determined based on the recorded image of the dot grid with extended depth of field and the known form of the dot grid, in particular the known arrangement or position of the points of the dot grid.

[0268] For example, for this purpose, a segmentation of the points of the point grid can first be performed again, as in step 82, in order to determine the image points of the image of the point grid with extended depth of field, which are in each case assigned to and imaged by the points of the point grid. The positions of the points of the point grid can then be determined from the segmented image points. The determined position of each point of the point grid can then be compared with the known position of each point of the point grid. In this way, the distortion, i.e. the offset, between the determined position of the point and the known position can be determined. At least one distortion value, in particular a first distortion value and a second distortion value, can then be determined for the points of the point grid. The distortion values ​​of all image points of the image with extended depth of field can then be determined over the entire area by interpolation.

[0269] refer to Figures 7 to 10 , an explanation will be given below of how the measured effects of field curvature and astigmatism affect the imaging of an object.

[0270] Due to image tilt and image curvature, real optical systems image flat measurement objects onto a curved image plane. In addition, real optical systems have spatially dependent telecentricity errors, i.e. spatially dependent changes in magnification depending on the defocus. This often leads to changes in the image orientation (in other words, edge shifts) or to dimensional measurement errors in the recorded images. The interaction of the field curvature with the telecentricity error can lead to unexpected and complex measurement influences. In particular, the measurement results can differ depending on the selected autofocus position (e.g. on the optical axis or at the edge of the field). This will be explained in more detail below.

[0271] Figure 7The imaging beam path of a flat object focused and imaged on a curved image plane 126 under the influence of the Petzval aberration (field curvature) from the exit pupil 120 to the curved image plane 126 is shown. This plane is also referred to as the optimal setting plane according to Petzval. Reference numeral 122 denotes the outgoing chief ray of an edge point of the observed object to be imaged, and reference numeral 124 denotes the outgoing marginal ray of a center point of the observed object to be imaged. A single autofocus point in the image focuses the image on a single area of ​​the Petzval plane, with the result that not the entire image is focused at the same time. The distance / position measured in the image (e.g., L1, L2) is different depending on the selected autofocus position (B1, B2) (e.g., in the center of the image or in the periphery of the image). For measured features close to each other, a change in the autofocus position will result in a shift ("walk") if the telecentricity error α (the angle of the observed chief ray direction relative to the optical axis or the image field normal of B1 or B2) of the two points is assumed to be the same. For measuring features at a greater distance, a change in the autofocus position will result in a systematic measurement error, assuming that the telecentricity errors at the two points are different.

[0272] In addition to field curvature, real optical systems also have the effect of astigmatism. Figure 8 The astigmatism of a lens is shown by way of example. The lens has a tangential focus 130 and a sagittal focus 132. The two focal points are offset relative to each other in the depth direction (z direction) about δ 134. The tangential focus 130 is closer to the lens than the sagittal focus 132. The result of this is that the optimal setting plane is different depending on the edge orientation. In particular, horizontal edge orientations and vertical edge orientations in the object are most clearly imaged in different optimal setting planes. In this case, the interaction of astigmatism with telecentricity errors also has unexpected and complex measurement effects. In particular, the measurement results will be different depending on whether the autofocus position is at a horizontal edge or a vertical edge. This will be explained in more detail below.

[0273] Similar to Figure 7 , Fig. 9 By way of example, the imaging beam paths of a flat object to be imaged are shown from the exit pupil 120 at two different image planes 140 and 142, the reason for the formation of these two different imaging planes is that due to the astigmatism of the imaging optical unit, the imaging to different optimal setting planes depends on the edge orientation. Fig. 9 Compared to the illustration in FIG. 1 , these sagittal and tangential setting planes do not have a simple progression across the image field. However, to provide a better explanation, the extreme cases of the tangential optimal setting plane 140 and the sagittal optimal setting plane 142 are shown in FIG. Fig. 9, are shown as spherical shells relative to each other. However, depending on the actual edge orientation 144, any desired optimal setting plane in between is also possible. Therefore, depending on the local edge orientation, the autofocus will focus on different setting planes. That is, at the same image position, the optimal autofocus position depends on the edge orientation. Therefore, the distances measured in the image (e.g., L1, L2, D1, D2) are different depending on the autofocus in the image that is related to the edge orientation. In other words, in particular, the measurement results are different depending on whether the autofocus is on a horizontal line or a vertical line. In this case, the larger the telecentricity deviation α of the system, the larger the error.

[0274] Field curvature and astigmatism may occur simultaneously. Fig.10 . A measurement objective with Petzval curvature and astigmatism will image the sharpest image in the best setting plane 126 between the sagittal best setting plane and the tangential best setting plane. The exact position between the image shells depends on the edge orientation in the measurement object. In other words, the measurement effect related to telecentricity is usually affected by both the Petzval effect and the astigmatic autofocus effect.

[0275] The following will refer to Figures 11 to 17C It is explained again how a measurable measurement record of a region of the surface of a workpiece can be recorded, ie a corrected image with an extended depth of field.

[0276] The first case considered assumes that the astigmatism is very small and only the field curvature significantly affects the imaging. For this purpose, the image quality of the entire focus image stack is evaluated and the corresponding measurement record is calculated on the best setting plane with any desired curvature. This measurement record is independent of the autofocus position. However, in addition to the traditional distortion, it has an additional distortion caused by the telecentricity error. This distortion influence must be calibrated and compensated.

[0277] To do this, first record a focus image stack of the calibration object during the calibration process, as described above in Figure 5 Next, a calibration record on the optimal setting plane is calculated. In this case, an image of the calibration object with an extended depth of field is generated as a calibration record. Next, the image distortion in the optimal setting plane is evaluated. Here, at least one distortion value is determined for each point. The distortion values ​​can then be stored in a lookup table.

[0278] Next, during the measurement process, a measurable record of an area of ​​the workpiece's surface can be recorded, i.e. a corrected image with an extended depth of field. First, a stack of focused images of the workpiece is recorded. Then, the measurement record on the optimal setting plane is calculated for any desired curved Petzval. This Fig.11 Here, for example, by means of Figure 2Steps 42 to 50 of the method generate an image with an extended depth of field as a measurement record. Subsequently, a distortion correction of the image in the optimally set plane is performed based on the distortion values ​​determined in the calibration process. In this way, an autofocus-independent measurement record can then be generated which has been corrected with respect to telecentricity errors, i.e. a corrected image with an extended depth of field. For example, as in Figure 2 This distortion can be corrected as described in step 52 of the method.

[0279] The procedure thus described enables compensation of measurement errors associated with autofocus and the generation of measurable records with an extended depth of field.

[0280] The next case considered is one in which both astigmatism and field curvature influence the imaging. Due to these effects, the determined best image point will no longer lie in the optimal setting plane according to Petzval, but will be averaged between the sagittal and tangential optimal setting planes depending on the edge orientation. In order to minimize the measurement influences associated with telecentricity, an astigmatism-compensated (i.e. corrected) image with an extended depth of field should be determined. For this purpose, the image is not evaluated in the sharpest image plane depending on the edge orientation, but in the astigmatism-free optimal setting plane (Petzval shell). This is done in Fig.12 It is shown in an exemplary manner.

[0281] For this purpose, in an initial step the astigmatic influences are evaluated and calibrated with the aid of suitable calibration objects, ie the optimum setting plane and the astigmatic housing position are determined.

[0282] In order to calculate an astigmatism-compensated image with an extended depth of field of a region of the surface of a workpiece, the sharpest image plane is first determined, and in a subsequent correction step, this image position is shifted into the astigmatism-compensated setting plane according to the edge orientation. With the aid of the astigmatism-compensated depth value of the setting plane, an astigmatism-compensated image with an extended depth of field is generated.

[0283] The following explains by way of example how to use a dot grid as a workpiece to correct astigmatism. The dot grid is flat. Fig. 13B An uncorrected image of a grid of dots with extended depth of field is shown by way of example. Fig.13A By way of example, a depth map of the depth values ​​of object points is shown, based on which a Fig. 13B Due to astigmatism, the depth map is not flat.

[0284] Fig. 14B By way of example, an image of a grid of dots with an extended depth of field is shown relative to the image from Fig. 13B The image is compensated for astigmatism. Fig.14ABy way of example, a depth map of astigmatism-corrected depth values ​​of object points is shown, based on which a depth map from Fig. 14B The corrected depth map shows that the point grid is essentially flat.

[0285] Performing image calculations or image analysis in the sharpest image plane according to autofocus criteria (ie based on uncorrected depth values) is difficult because the calculated image with extended depth of field has distortions ("edge walking") depending on the edge orientation due to astigmatism effects.

[0286] This is different for image calculation or image analysis in the astigmatism-compensated optimal setting plane (i.e. based on the astigmatism-compensated image with extended depth of field). This is the result of shifting the determined image position into the optimal setting plane. Here, the astigmatism walk effect is suppressed. The distortion correction in the astigmatism-compensated image with extended depth of field thus generates a measurable record of focus everywhere.

[0287] To calculate the astigmatism compensated setting plane, an astigmatism correction value is determined based on the local edge orientation in the image and subtracted from the depth value of the sharpest setting plane. The local edge orientation is approximated here by numerical approximation of the image gradient, for example by a directional Sobel filter in a single image or as a weighted average of the gradients of multiple images of a focus image stack.

[0288] To find the edge orientation within the image, for example, the gradient vector field is calculated with the aid of discrete differential operators

[0289]

[0290] and its edge orientation angle is determined as

[0291]

[0292] The numerical determination of the gradient in the image is susceptible to noise and any interference. This sensitively affects the calculated angle map and can falsify the astigmatism correction. In the worst case, an incorrectly determined angle can mean a wrong correction step, which increases the astigmatism measurement error.

[0293] A robust approach consists in averaging the gradient vector fields on multiple image planes within a range of 1-10 Rayleigh around the sharpest image point and computing the angle map from the averaged gradient vector field.

[0294] For correction purposes, the astigmatic shift relative to the optimal setting plane is usually determined as follows with the aid of the determined edge orientation angle:

[0295] dz(θ,x,y)=Σa m (x,y)sin(mθ)+b m(x, y)cos(mθ)

[0296] In this case, m is a natural number and indicates the expansion order. The offset dz indicates the effective correction value for each object point (x, y) accordingly. Therefore, if the expansion to the Nth order is considered, N third correction values ​​and N fourth correction values ​​are assigned to each object point. Preferably, only the second-order expansion is considered. Then, the astigmatism offset relative to the optimal setting plane is determined as follows:

[0297] dz(θ,x,y)=a2(x,y)sin(2θ)+b2(x,y)cos(2θ)

[0298] Then, the first correction value corresponds to the coefficient a2, and the second correction value corresponds to the coefficient b2.

[0299] The effective correction value is then subtracted from the determined position with maximum sharpness (i.e. the determined depth value of the object point). The newly determined position (i.e. the astigmatism-corrected depth value of the object point) is thus not compensated in a direction-dependent absolute sharpness point, but rather with respect to the astigmatism-dependent telecentricity influence.

[0300] Then, an astigmatism-compensated image with an extended depth of field can be generated based on the astigmatism-corrected depth values ​​of the object points. In this way, the recording is no longer evaluated in the sharpest image plane, but in the optimally set plane. The effect is that the image sharpness is slightly reduced in the astigmatism-compensated image with an extended depth of field, but it compensates for distortions or measurement errors due to telecentricity errors. In order to obtain a measurable recording, the distortion is then corrected in a final step. For example, as in Figure 2 This distortion can be corrected as described in step 52 of the method.

[0301] FIG. 15A to FIG. 17C Again by way of example, a procedure in a calibration process for determining astigmatism correction values, ie, a first correction value and a second correction value, is described.

[0302] First, an image of the dot grid with extended depth of field is recorded. Fig.15A An exemplary illustration of a point grid is shown. The point grid is flat. However, astigmatism causes the image points imaging the points of the point grid to be shifted in the depth direction in an angle-dependent manner (i.e., in accordance with the orientation of the image point relative to the center point of the points of the point grid) depending on the angle in the tangential focus or sagittal focus direction. This is, for example, Fig. 15B and Fig. 15C Displayed in. Fig. 15B Shown is a diagram for showing the Fig.15A A 3D map of the sharpest image points at the edge of a grid of points. Fig. 15C Shown is a diagram for showing the Fig. 15BA plot of the depth value of the sharpest image point versus the corresponding edge orientation angle. Fig. 15B and Fig. 15C The tangential focus 130 and the sagittal focus 132 are shown shifted in the depth direction 134 .

[0303] Fitting a sine function ∑a to the determined depth value according to the astigmatism model m (x,y)sin(mθ)+b m The sum of (x, y)cos(mθ) (preferably the second-order sine function a2(x, y)sin(2θ)+b2(x, y)cos(2θ)).

[0304] By means of fitting, the expansion coefficient a is determined m and b m . The expansion coefficients describe the optimal setting plane of astigmatism (i.e. tangential and sagittal) depending on the local edge orientation. Therefore, the expansion coefficients correspond to the astigmatism correction values ​​at the positions of the corresponding points of the point grid in the image space. When only the first-order expansion is considered, the expansion coefficients a1 and b1 correspond to the first correction value and the second correction value at the positions of the points of the point grid in the image space. When only the second-order expansion is considered, the expansion coefficients a2 and b2 correspond to the first correction value and the second correction value at the positions of the points of the point grid in the image space. The first correction value and the second correction value of the image points (all image points in the image space) of the image with extended depth of field are then determined by interpolation over the entire area (the entire image space).

[0305] FIG. 16A to FIG. 16C A first example is shown, in which in each case a sum of sine functions (as fitting function) is fitted to the angle-dependent distribution of depth values ​​of the points of the point grid. Fig.16A A diagram is shown in which the fitting function is shown to fit the depth values ​​of the sharpest image points at the edges of the points of the point grid. In other words, Fig.16A The fit of the fitting function to the angle-dependent distribution of depth values ​​is shown. Fig. 16B A diagram is shown in which the spatial distribution of depth values ​​in the image plane (xy plane) is presented. Fig. 16C A diagram is shown in which the spatial distribution of the corrected depth values ​​in the image plane (xy plane) is presented. The corrected depth values ​​are the result of the difference of the depth values ​​relative to the fit.

[0306] 17A to 17C A second example is shown, in which in each case a sum of sine functions (as fitting function) is fitted to the angle-dependent distribution of depth values ​​of the points of the point grid. Fig.17A A diagram is shown in which the fitting function is shown to fit the depth values ​​of the sharpest image points at the edges of the points of the point grid. In other words, Fig.17AThe fit of the fitting function to the angle-dependent distribution of depth values ​​is shown. Fig. 17B A diagram is shown in which the spatial distribution of depth values ​​in the image plane (xy plane) is presented. Fig. 17C A diagram is shown in which the spatial distribution of the corrected depth values ​​in the image plane (xy plane) is presented. The corrected depth values ​​are the result of the difference of the depth values ​​relative to the fit.

[0307] refer to Figure 18 to Figure 19 , an explanation of how to locate edges in an image with extended depth of field is given below.

[0308] In the simplest case, the edge can be approximated, at least locally, as a straight line. This is the approach taken by the "slant edge" method. Fig.18 By way of example, it is shown how in image 160 with extended depth of field the edge position of edge 166 in image region 162 of image 160 can be located using the “bevel edge” method.

[0309] Image 160 has image point 164 in image area 162. Edge 166 runs in image 160. The edge run of edge 166 is straight and therefore does not have any curvature. Edge 166 runs along edge run direction 168. Normal direction 170 runs perpendicular to edge run direction 168.

[0310] The "bevel edge" method is then used to determine the angle of inclination of edge 160, in particular edge progression direction 168, relative to the y direction. Normal direction 170 is accordingly also inclined relative to the x direction by the same angle. This inclination angle can be determined by taking into account the intensity of the image points in the edge region.

[0311] With the aid of this angle, image point 164 in image region 162 can then be projected onto normal direction 170. Fig.18 , the projection is represented by a dashed line extending parallel to the edge progression direction 168. The projection is therefore a projection of the image region 162 along the edge progression direction 168 onto the normal direction 170. With the aid of this projection, a super-resolved edge distribution 172 of the edge 166 can then be generated in the normal direction 170. The super-resolved edge distribution 172 is an intensity distribution I(z) of an image point 164 in the image region 162, wherein z indicates the position in the normal direction. The position z of each image point in the normal direction 170 results from the coordinates (x, y) of the image point and the determined tilt angle.

[0312] The inflection point of super-resolved edge distribution 172 indicates the edge position of edge 166 in normal direction 170. In this way, the edge position of a straight edge can be determined by the "slant edge" method.

[0313] However, usually rounded or arbitrarily curved edges are measured in metrological inspections instead of straight edges. The "bevel edge" method is not suitable for determining the edge position of such curved edges. A description of a method will now be given below which makes it possible to model edges also with arbitrarily curved edge progressions and to accurately determine the edge position of said edges.

[0314] Fig.19 Similar to Fig.18 An image region 162 of an image 160 with an extended depth of field is shown in FIG. An edge 166 develops in the image 160. Fig.18 compared to, Fig.19 The edge 166 in is not straight, but curved. The edge 166 thus has a curved edge progression. At each point 174 of the edge 166, the edge 166 has a tangent and a normal. The tangent runs along an edge progression direction 168. The normal runs along a normal direction 170. The edge progression direction 168 and the normal direction 170 change along the edge progression of the edge 166. The edge progression direction 168 and the normal direction 170 thus span a curvilinear coordinate system.

[0315] It is now proposed to perform a projection of the image points in the image 164 along the curved edge progression, i.e. onto the normal direction 170 of the curvilinear coordinate system. For this purpose, one or more edge parameters that can be used to describe or model the curved edge progression can be determined based on the intensities of the image points, in particular based on the image gradients of these image points. Thus, the position z of each image point in the normal direction 170 results from a coordinate transformation to the curvilinear coordinate system. The determined edge parameters of the modeled curved edge progression are used for the coordinate transformation.

[0316] With the aid of this projection, a super-resolved edge distribution 172 of edge 166 in normal direction 170 is then likewise generated, which can then be used as a basis for determining the edge position in normal direction 170 .

[0317] Fig. 20A and Fig. 20B The special case where edge 166 has a constant curvature is shown.

[0318] Fig. 20A Similar to Fig.19 1 shows an image region 162 of an image 160 with an extended depth of field, in which image region a curved edge 166 develops. Fig. 20A The edge 166 in FIG. 1 has an edge progression with a constant curvature. Thus, the edge 166 extends around a center of curvature 176. Given the constant curvature, the normal direction 170 corresponds to a radial direction relative to the center of curvature 176, and the edge progression direction 168 corresponds to a tangential direction relative to the center of curvature 176. Thus, the curvilinear coordinate system is a two-dimensional polar coordinate system with the center of curvature 176 as the origin.

[0319] A projection which progresses along an edge with constant curvature is therefore a projection along a tangential direction in a radial direction.The centre of curvature can be determined based on the intensities of the image points, in particular based on the image gradients of these image points.

[0320] Thus, the position z of each image point in the normal direction 170 corresponds to the radial distance r in the radial direction relative to the center of curvature 176. The radial distance r of an image point with coordinates (x, y) relative to the center of curvature 176 with coordinates (x0, y0) can be obtained by the formula to be sure.

[0321] Based on the projection in the radial direction, a super-resolved edge distribution 172 of the edge 166 can then be generated in the normal direction 170 (ie, in the radial direction). Fig. 20B The super-resolved edge distribution 172 is the intensity distribution I(r) of an image point 164 in the image region 162. Based on the super-resolved edge distribution 172, the edge position in the radial direction relative to the center of curvature 176 can then be determined.

[0322] Fig.21 A method 200 for locating the edge position of an edge 166 in an image region 162 of an image 160 with an extended depth of field is described, which method applies the above-mentioned new method. The method 200 can be a computer-implemented method. For example, the method 200 can be performed by means of a computer. Alternatively, the method 200 can also be performed by means of a control device 26 of the measuring device 10.

[0323] In optional step 202 of method 200, an image 160 with an extended depth of field is received. For this purpose, for example, the image 160 may be stored in an external device or generated therein. For the purpose of edge localization, the image 160 may then be received from the external device.

[0324] As an alternative, in optional step 204 of method 200, image 160 with an extended depth of field may be generated. For example, Figure 2 The method 40 is used to generate an image 160 with an extended depth of field.

[0325] A further step 206 of the method 200 involves generating an image gradient for each image point in the image region 162. The determined image gradients form an image gradient map.

[0326] In a further optional step 208 of the method 200, the image gradient map is filtered. In this case, image gradients below a defined threshold are discarded.

[0327] A further step 210 of the method 200 involves determining at least one edge parameter of the modeled curved edge progression based on the image gradient map. In this case, the at least one edge parameter may be one or more parameters of an edge progression model for describing the edge progression, wherein the at least one edge parameter is determined based on the edge progression model and the image gradient map. For example, a polynomial function may be used as the edge progression model, in particular wherein the polynomial function is at least a quadratic polynomial.

[0328] The at least one edge parameter can be determined by curve fitting based on the edge progression model and the image gradient map, in particular wherein a least square method is used for curve fitting. Alternatively or additionally, the at least one edge parameter can also be determined by optimization based on the edge progression model and the image gradient map, in particular wherein, for optimization, the edge progression model is minimized with respect to the local edge roughness.

[0329] In particular, the modeled curved edge progression may have a constant curvature. Fig. 20A and Fig. 20B This is explained in detail. The at least one edge parameter then defines a center of curvature 176 of the edge progression with constant curvature. The projection is then the projection of the image point in a radial direction relative to the center of curvature 176.

[0330] A further step 212 of method 200 involves determining an edge distribution 172 of edge 166 based on projections of image points of the image region (162) along the edge using at least one edge parameter.

[0331] A further step 214 of method 200 involves determining an edge position of edge 166 based on edge distribution 172. The edge position may be determined based on an inflection point of edge distribution 172, for example.

[0332] Fig. 22 A method 220 is shown for edge location in an image 160 with an extended depth of field, wherein the image 160 images a region of a surface of a workpiece 12 . The method 200 may be carried out by means of a control device 26 of the measuring device 10 , for example.

[0333] In a first step 222 of the method 220, an image 160 with an extended depth of field is recorded. For example, it may be performed Figure 3 The method 60 is used to record an image 160 with an extended depth of field.

[0334] A further step 224 of method 220 involves using Fig.21 The method 200 is used to generate edge locations of edges 166 in the image region 162 of the image 160 having an extended depth of field.

[0335] The case of constant curvature of the edge will be discussed in detail again below. In this case, the edge geometry is expressed with respect to the common curvature midpoint [x0, y0]. This can be understood as a second-order Taylor approximation. The determination of the common curvature center 176 corresponds to the center challenge, and there are multiple possibilities here. Figures 23 and 24 show two examples of how the curvature center 176 can be determined given a constant curvature of the edge progression and how the super-resolved edge distribution 172 in the radial direction can be determined on its basis.

[0336] Figure 23 shows a first example of edge localization in an image with an extended depth of field. A circular structure is shown in the image (see Figure 23 (A)). Localizing the edge involves selecting an image region in which a portion of the circular edge develops (see Figure 23 (B)).

[0337] In a first step, the local edge orientation is determined. For this purpose, a numerical approximation of the image gradient is determined in the selected image region, for example, with the aid of a directional Sobel filter or a numerical finite difference method.

[0338]

[0339] In order to suppress the effects caused by image noise, it is particularly advantageous to calculate the image gradient as a weighted average of multiple images from the focus image stack. This can be done using the following formula:

[0340]

[0341] Furthermore, it is also advantageous to additionally filter the calculated image gradients. Due to the lack of edge contrast, the calculated image gradients far from the edges are mainly affected by pure image noise and are therefore falsified. Here, it is advantageous to discard all image gradients whose gradient values ​​are below a threshold value to be defined.

[0342] In the next step, with the help of the calculated image gradient map [G x , G y ], calculate the midpoint of the curvature of the edge (see Figure 23 (C)). Assuming that the edge progression within the image region can be approximated as a circle, there is a common curvature center [x0, y0], at which the calculation vector field of the local edge orientation [G x , G y ] have a common origin. One possibility for determining the common origin is to solve the known variables x, y, G included in the selected image region for the unknown variables x0, y0, ρ in the sense of least squares optimization. x , G y Overdetermined system of equations

[0343]

[0344] That is, the best center of curvature averaged over all image gradients of the image gradient map is calculated. With the help of the curvature center [x0, y0] thus calculated, the super-resolved edge distribution can be extracted. For this purpose, each image point of the image area is assigned a relative curvature center The radial distance of the image point is then considered (see Figure 23(D)). This is done by generating a super-resolved edge distribution in the radial direction. to be completed.

[0345] Based on this edge distribution, the edge position in the radial direction can then be determined, ie the distance between the edge and the center of curvature [x0, y0].

[0346] FIG24 shows a second example of edge localization in an image with extended depth of field. In the second example, the center of curvature is calculated by means of an optimization that minimizes the local edge roughness. If the local edge origin is shifted relative to its nominal value, the extracted edge distribution has a higher roughness (a possible roughness measure is, for example, a comparison between a low-pass filtered edge transfer function and an unfiltered edge transfer function).

[0347] This comparison makes it possible to determine the center of curvature by optimizing the position [x0, y0] in a manner that minimizes the determined roughness of the edge distribution. This is schematically shown in Figure 24 (A) to (C). In this case, Figure 24 (A) shows an edge distribution, which is generated by estimating the position of the center of curvature or determining the position by means of some other program (such as the program from Figure 23). Figure 24 (B) shows an enlarged illustration of the intensity value of the edge distribution from Figure 24 (A) in the edge region. Figure 24 (C) shows the intensity value of the optimized edge distribution in the edge region, wherein the position of the center of curvature [x0, y0] is optimized to reduce the roughness of the edge distribution. The edge roughness in Figure 24 (C) is significantly less than the edge roughness in Figure 24 (B).

[0348] FIG. 25A to FIG. 26B A comparison of edge measurement based on the slant edge method for the extracted edge distribution compared to the proposed inventive method is shown.

[0349] The illustration shows a recorded measured image of a Siemens star on a calibration mask with its nominal diameter and the value calculated based on the slant edge method (see Fig.25A and Fig.25B ) and the proposed method (see Fig.26A and Fig.26B) Compared with the proposed method, the edge location results extracted by the bevel edge method have significantly enlarged measurement deviations.

[0350] As a further example, consider a workpiece having multiple circular structures. Fig. 27 An image of the artifact is shown. There are 30 circular structures in the depicted area. From this area, with the help of Figure 3 The method 60 is used to record a corrected image with an extended depth of field in which distortion and astigmatism aberrations have been corrected. Then, for example, by means of Fig.21 The method 200 is used to locate the edge of a circular structure.

[0351] For comparison purposes, in the example considered, edge localization of circular structures is first performed in a correction image with extended depth of field and also in a single image measurement (ie, in a single image of a focus image stack). The circularity of the circular structure can then be determined based on the localized edges.

[0352] Fig.28 , Fig.29A and Fig.29B The circularity measurement of circular structures in various images is demonstrated. Fig.28 Shown is the circularity measurement in a corrected image with extended depth of field. Fig.29A and Fig.29B The circularity measurements are shown in images for which image planes were selected at the point of maximum astigmatism, ie, recordings in the best sagittal image plane and in the best tangential image plane, respectively. Fig.29A Roundness measurements in uncorrected images in the best sagittal plane are shown. Fig.29B The circularity measurement in the uncorrected image in the best tangential plane is shown.

[0353] From Fig.28 The roundness measurement from Fig.29A and Fig.29B A comparison of the roundness measurements of the 200 nm image clarifies the measurement errors that may occur due to the autofocus measurement point on the horizontal or vertical edge. It becomes clear that both the center and the shape within the roundness measurement vary depending on the image selected. The absolute value of this deviation is in the range of 1-1.5 μm and is therefore significantly larger than the deviation of about 200 nm in the correction image with extended depth of field. This clarifies the increase in accuracy achieved by the correction image with extended depth of field.

Claims

1. A computer-implemented method (200) for locating an edge position of an edge (166) in an image region (162) of an image (160), the method comprising the steps of: - determining (206) an image gradient for each image point in the image region (162), wherein The determined image gradients form an image gradient map; - determining (210) at least one edge parameter of a modeled curved edge progression based on the image gradient map; - using the at least one edge parameter to determine (212) an edge distribution (172) of the edge (166) based on projections of image points of the image region (162) along the edge; and - determining (214) the edge position based on the edge distribution (172).

2. The method of claim 1, wherein: The method (200) further comprises the following steps: - filtering (208) the image gradient map, wherein image gradients below a defined threshold are discarded.

3. The method according to claim 1 or 2, wherein: The at least one edge parameter is one or more parameters of an edge progression model for describing the edge progression, wherein the at least one edge parameter is determined based on the edge progression model and the image gradient map.

4. The method of claim 3, wherein: The at least one edge parameter is determined by curve fitting based on the edge progression model and the image gradient map, in particular wherein a least square method is used for curve fitting.

5. The method according to claim 3 or 4, wherein: The at least one edge parameter is determined by optimization based on the edge progression model and the image gradient map, in particular wherein, for the optimization, the edge progression model is minimized with respect to the local edge roughness.

6. The method according to any one of claims 3 to 5, wherein: A polynomial function is used as the edge progression model, in particular wherein the polynomial function is a polynomial of at least quadratic degree.

7. The method according to any one of claims 1 to 6, wherein: The curved edge progression has a constant curvature, and wherein the at least one edge parameter defines a center of curvature (176) of the edge progression with constant curvature, in particular wherein the projection is a projection of the image points in a radial direction relative to the center of curvature (176).

8. The method according to any one of claims 1 to 7, wherein: In the step of determining (214) the edge position, the edge position is determined based on an inflection point of the edge distribution (172).

9. The method according to any one of claims 1 to 7, wherein: In the step of determining (214) the edge location, the edge location is determined based on reaching a defined threshold of the edge distribution (172).

10. The method according to any one of claims 1 to 9, wherein: The method further comprises the following steps: - receiving (202) the image, in particular wherein the image is an image with an extended depth of field.

11. The method according to any one of claims 1 to 9, wherein: The image is an image with an extended depth of field, wherein the image with the extended depth of field images a region of a surface of the workpiece (12), wherein the method (200) further comprises the following steps: - receiving (42) a focus image stack, wherein the focus image stack has a plurality of images of the workpiece (12), wherein the images image the region of the surface of the workpiece (12) at different defined focal plane positions in the depth direction (20), wherein a focal plane position is assigned to each image of the focus image stack; - generating (50) an image with an extended depth of field in the depth direction based on the focus image stack.

12. A method (220) for edge localization in an image with extended depth of field, wherein: The image images an area of ​​a surface of a workpiece (12), the method comprising the steps of: - capturing (68) a plurality of images of the region of the surface of the workpiece (12) by means of the optical sensor (14), wherein each of the images images the region of the surface of the workpiece (12) at a different defined focal plane position in the depth direction (20), and wherein the captured images form a focus image stack; - generating (50) an image having an extended depth of field in the depth direction (20) based on the focus image stack; and - localizing an edge position of an edge (166) in an image region (162) of the image (160) with extended depth of field by means of a method (200) as claimed in any one of claims 1 to 10.

13. The method according to claim 11 or 12, wherein: The method further comprises the following steps: - correcting (52) one or more imaging aberrations in the generated image with extended depth of field, The imaging aberrations to be corrected include at least one of the following aberrations: distortion aberration and / or astigmatism aberration.

14. The method according to claim 12 or 13, wherein: The optical sensor (14) and the workpiece (12) are movable relative to each other in the depth direction (20) so that a distance (22) between the workpiece (12) and the optical sensor (14) in the depth direction (20) is variable, wherein the method further comprises the following steps: - changing (66) the distance between the workpiece (12) and the optical sensor (14), wherein, in the capturing (68) step, the plurality of images are captured when the distance (22) between the workpiece (12) and the optical sensor (14) is changed, wherein each of the images images the region of the surface of the workpiece (12) from a different defined distance (22) relative to the workpiece (12) in the depth direction (20).

15. The method according to any one of claims 12 to 14, wherein: The measuring device (10) has a workpiece holder (16), wherein the workpiece (12) is arranged on the workpiece holder (16) for measuring purposes.

16. The method of claim 15, wherein: The measuring device (10) has a drive device (28), wherein the drive device (28) moves the optical sensor (14) relative to the workpiece holder (16) in the depth direction (20) and / or moves the workpiece holder (16) relative to the optical sensor (14) in the depth direction (20) in order to change the distance (22) between the workpiece (12) and the optical sensor (14).

17. The method according to any one of claims 12 to 16, wherein: The measuring device (10) has an illumination device (32), wherein the method further comprises the following steps: - illuminating (64) the workpiece (12) by means of the illumination device (32) during the process of capturing the images of the focus image stack.

18. A measuring device, in particular a coordinate measuring machine or a microscope, wherein: The measuring device (10) comprises a workpiece holder (16) for a workpiece (12), an optical sensor (14) and a control device (26), wherein the optical sensor (14) is configured to capture an image of a region of a surface of the workpiece (12), wherein the optical sensor (14) and the workpiece (12) are spaced apart from each other in a depth direction (20), and wherein the control device (26) is designed to perform the following steps: - controlling the optical sensor (14) so ​​as to capture a plurality of images of an area of ​​the surface of the workpiece (12) by means of the optical sensor (14), wherein each of the images images the area of ​​the surface of the workpiece (12) at a different defined focal plane position (22) in the depth direction (20), and wherein the captured images form a focus image stack; - generating an image (160) having an extended depth of field in the depth direction (20) based on the focus image stack; and - localizing at least one edge position of an edge (166) in the image region (162) of the image (160) with extended depth of field by means of the method (200) as claimed in any one of claims 1 to 10.

19. The measuring device of claim 18, wherein: The measuring device (10) further comprises a drive device (28), wherein the drive device (28) is configured to move the optical sensor (14) and the workpiece holder (16) relative to each other in the depth direction (20) in order to change the distance (22) between the workpiece (12) and the optical sensor (14).

20. The measuring device of claim 19, wherein: The control device (26) is also designed to perform the following steps, in particular before the step of generating the corrected image with extended depth of field: - controlling the drive device (28) in such a way as to change the distance (22) between the workpiece (12) and the optical sensor (14), The optical sensor (14) is controlled in such a manner as to capture the plurality of images when the distance (22) between the workpiece (12) and the optical sensor (14) is changed, wherein the images each image the region of the surface of the workpiece (12) from a different defined distance (22) relative to the workpiece (12) in the depth direction (20).

21. A computer program product comprising a computer program, the computer program product having program code means for carrying out the method as claimed in claim 1 when the computer program is executed on a measuring device (10).

Citation Information

Patent Citations

  • Ascertainment of defocused reflection maps for the robust determination of "shape from focus" in microscopy images

    EP2598836A1