Computer-implemented method for generating a corrected image with extended depth of field, method, measuring device and computer program product
The method generates a corrected extended depth of field image by analyzing a focal image stack and correcting optical aberrations, addressing measurement inaccuracies in conventional devices to achieve precise and accurate depth measurements.
Patent Information
- Application Number
- DE102022118582
- Authority / Receiving Office
- DE · DE
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2022-07-25
- Publication Date
- 2025-07-31
- Estimated Expiration
- 2042-07-25
AI Technical Summary
Conventional optical measuring devices, such as microscopes and coordinate measuring devices, struggle with accurately determining depth information in the Z-direction due to image blur caused by optical defocusing and are affected by optical aberrations like astigmatism and telecentricity errors, leading to measurement inaccuracies and complex measurement influences.
A method and device that generate a corrected extended depth of field image by analyzing a focal image stack, correcting aberrations through distortion and astigmatism modeling, and generating a depth map to produce a true-to-scale, accurately focused image using a computer-implemented approach.
The method provides a high-accuracy, extended depth of field image that compensates for measurement errors, ensuring precise and measurable recordings by correcting optical aberrations and maintaining image sharpness across the entire field of view.
Smart Images

Figure 00000000_0000_ABST
Abstract
Claims
[1] A computer-implemented method (40) for generating a corrected image with extended depth of field, the image depicting a portion of a surface of a workpiece (12), comprising the following steps: - receiving (42) a focal image stack, wherein the focal image stack comprises a plurality of images of the workpiece (12), wherein the images image the region of the surface of the workpiece (12) with defined focal plane positions (22) that are different in a depth direction (20), wherein each image of the focal image stack is assigned a focal plane position (22), wherein pixels of the images of the focal image stack are each assigned to a corresponding object point on the surface of the workpiece (12); - determining (44) a sharpness value of each pixel of each image of the focal image stack; - fitting (46) a function along the depth direction (20) to the sharpness values of those pixels of the images which are assigned to the same object point; - determining (48) a depth value of each object point on the surface of the workpiece (12) in the depth direction (20) based on a maximum of the fitted function and a residue of the fitted function, wherein the depth value of an object point on the surface of the workpiece (12) in the depth direction (20) is determined based on a maximum of the corresponding fitted function if the residue of the corresponding fitted function is equal to or less than a defined threshold value, and wherein the depth value of an object point on the surface of the workpiece (12) in the depth direction (20) is determined by interpolating the depth values of at least two adjacent object points if the residue of the corresponding fitted function is greater than the defined threshold value; - generating (50) an image with extended depth of field in the depth direction (20) based on the determined depth values and the focal image stack; and - correcting (52) one or more aberrations in the image with extended depth of field, wherein the aberrations to be corrected comprise a distortion error. [2] The method (40) of claim 1, wherein each image of the focal image stack is assigned a depth value in the depth direction. [3] The method (40) of claim 1 or 2, wherein the sharpness value of each pixel is determined based on a sharpness of the pixel. [4] Method (40) according to one of claims 1 to 3, wherein for correcting the distortion error, at least one distortion value is assigned to each point of the image with extended depth of field, wherein a position of each point of the image with extended depth of field perpendicular to the depth direction (20) is corrected based on the at least one distortion value. [5] The method (40) of claim 4, wherein each point of the extended depth of field image is associated with a first distortion value and a second distortion value, wherein the position of each point of the extended depth of field image is corrected in a first direction based on the first distortion value and in a second direction based on the second distortion value. [6] Method (40) according to one of claims 1 to 5, wherein the aberrations to be corrected further comprise an astigmatism error. [7] The method (40) of claim 6, wherein the astigmatism error is corrected before the distortion error. [8] Method (40) according to claim 6 or 7, wherein for correcting the astigmatism error an angle map of the area of the surface of the workpiece is generated, wherein each point of the extended depth of field image is assigned a first correction value and a second correction value, wherein the depth value of each point of the extended depth of field image is corrected based on the first correction value, the second correction value and the angle map. [9] A computer-implemented method (40) for generating a corrected image with extended depth of field, the image depicting a portion of a surface of a workpiece (12), comprising the following steps: - receiving (42) a focal image stack, wherein the focal image stack comprises a plurality of images of the workpiece (12), wherein the images image the region of the surface of the workpiece (12) with defined focal plane positions (22) that are different in a depth direction (20), wherein each image of the focal image stack is assigned a focal plane position (22); - generating (50) an image with extended depth of field in the depth direction (20) based on the focal image stack; and - correcting (52) one or more aberrations in the image with extended depth of field, wherein the aberrations to be corrected comprise a distortion error and an astigmatism error, wherein an angle map of the area of the surface of the workpiece is generated to correct the astigmatism error, wherein each point of the image with extended depth of field is assigned a first correction value and a second correction value, 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, wherein the angle map assigns an angle to each point of the extended depth of field image that indicates the direction of the image gradient, the image gradient being determined based on all or part of the focal image stack for each point, where the angle map is approximated based on a weighted averaging of the image gradients through several images of the focal image stack, where the astigmatism is modeled as a linear combination of two radially symmetric sine functions, where the first correction value corresponds to the coefficient of the first sine function and the second correction value corresponds to the coefficient of the second sine function. [10] A method (60) for recording a corrected image with extended depth of field using an optical sensor (14) of a measuring device (10), the image depicting a region of a surface of a workpiece (12), the optical sensor (14) and the workpiece (12) being spaced apart from one another in a depth direction (20), comprising the following steps: - capturing a plurality of images of the area of the surface of the workpiece (12) by means of the optical sensor (14), wherein the images each depict the area of the surface of the workpiece (12) with defined focal plane positions (22) that differ in the depth direction, and wherein the captured images form a focal image stack; and - generating (70) the corrected image with extended depth of field by means of the method according to one of claims 1 to 9. [11] The method according to claim 10, 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) in the depth direction (20) between the workpiece (12) and the optical sensor (14) is variable, the method further comprising the following step: - Changing (66) the distance between the workpiece (12) and the optical sensor (14), wherein in the step of detecting (68) the plurality of images are detected while the distance (22) between the workpiece (12) and the optical sensor (14) is changed, wherein the images each depict the area of the surface of the workpiece (12) from different, defined distances (22) to the workpiece (12) in the depth direction (20). [12] Method according to claim 10 or 11, wherein the measuring device (10) has a workpiece holder (16), wherein the workpiece (12) is arranged on the workpiece holder (16) for measuring. [13] Method according to claim 12, 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). [14] Method according to one of claims 10 to 13, wherein the measuring device (10) comprises an illumination device (32), the method further comprising the following step: - illuminating (64) the workpiece (12) by means of the illumination device (32) during the acquisition of the images of the focal image stack. [15] A method according to any one of claims 10 to 14, wherein the method further comprises the step of: - Determining (63) the at least one distortion value for each pixel of the image with extended depth of field, wherein initially an image with extended depth of field of a calibration object, in particular a point grid, is recorded, wherein the at least one distortion value is determined based on a deviation of the image with extended depth of field from a known surface profile of the calibration object. [16] A method according to any one of claims 10 to 15, wherein the method further comprises the step of: - Determining (62) the first and second correction value for each pixel, wherein initially an image with extended depth of field of a calibration object, in particular a point grid, is recorded, wherein the respective correction value is determined based on deviations of the image with extended depth of field or the determined depth values of the object points of the calibration object from a known surface profile of the calibration object. [17] Method according to one of claims 10 to 16, wherein determining the first and second correction values comprises the following steps: - determining (100) the first correction value and the second correction value for each point of the point grid based on a cost function between an astigmatism model and the depth values of the respective point; and - interpolating (102) the first and second correction values based on the first and second correction values of each point of the point grid. [18] Measuring device (10), in particular a coordinate measuring device or a microscope, for recording a corrected image with an extended depth of field, wherein the image depicts a region of a surface of a workpiece (12), wherein the measuring device (10) has a workpiece holder (16) for the workpiece (12), an optical sensor (14) and a control device (26), wherein the optical sensor (14) is designed to capture images of a region of the surface of the workpiece (12), wherein the optical sensor (14) and the workpiece (12) are spaced apart from one another in a depth direction (20), wherein the control device (26) is designed to carry out the following steps: - generating the corrected image with extended depth of field by means of the method according to one of claims 1 to 9. [19] Measuring device according to claim 18, wherein the measuring device (10) further comprises a drive device (28), wherein the drive device (28) is designed to move the optical sensor (14) and the workpiece holder (16) relative to each other in the depth direction (20) in order to change a distance (22) between the workpiece (12) and the optical sensor (14). [20] Measuring device according to claim 18 or 19, wherein the control device (26) is further arranged to carry out the following steps, in particular before the step of generating the corrected image with extended depth of field: - Controlling the optical sensor (14) such that a plurality of images of a region of the surface of the workpiece (12) are captured by means of the optical sensor (14), wherein the images each depict the region of the surface of the workpiece (12) with defined focal plane positions (22) that differ in the depth direction, and wherein the captured images form a focal image stack. [21] Measuring device according to claim 20, wherein the control device (26) is further arranged to carry out 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 that a distance (22) between the workpiece (12) and the optical sensor (14) is changed, wherein the optical sensor (14) is controlled in such a way that the plurality of images are captured while the distance (22) between the workpiece (12) and the optical sensor (14) is changed, wherein the images each depict the area of the surface of the workpiece (12) from different, defined distances (22) to the workpiece (12) in the depth direction (20). [22] Computer program product comprising a computer program having program code means for carrying out a method (40) according to one of claims 1 to 9 when the computer program is executed on a measuring device (10).
Citation Information
Patent Citations
Method for determining measurement points on the surface of a tool using an optical sensor
DE102015110289A1
Optical aberration correction for machine vision inspection systems
US8311311B2