AUTO-FOCUS METHOD FOR A COORDINATE-MEASURING APPARATUS
20170248768 · 2017-08-31
Inventors
Cpc classification
H04N23/673
ELECTRICITY
G02B7/38
PHYSICS
International classification
G02B7/38
PHYSICS
Abstract
A method is disclosed for ascertaining a focus image distance of an optical sensor, which is provided with a lens, of a coordinate-measuring apparatus onto a workpiece to be measured, wherein the optical sensor and/or the workpiece are movable in a Z direction such that a distance in the Z direction between the workpiece and the optical sensor is variable. Further, a corresponding coordinate-measuring apparatus and a computer program product are disclosed.
Claims
1. A method for ascertaining a focus image distance of an optical sensor of a coordinate-measuring apparatus with respect to a surface of a workpiece to be measured, the optical sensor being provided with a lens, at least one of the sensor and the workpiece being movable in a Z direction such that a distance in the Z direction between the workpiece and the optical sensor is variable, the method comprising at least one of a determination step and an approximation step; the determination step including: setting a first focal distance and a second focal distance; recording a first image of a surface of the workpiece with the optical sensor; assessing an intensity of the recorded first image of the surface of the workpiece at the first focal distance; recording a second image of the surface of the workpiece with the optical sensor; assessing the intensity of the second image of the surface of the workpiece at the second focal distance to determine therefrom a most probable location of a best focus in relation to the first focal distance and to the second focal distance; and the approximation step including: setting at least three different focal distances in a proximity of the most probable location of the best focus; and, approximately determining a location of the best focus based on the intensities of the recorded images.
2. The method of claim 1, further comprising a contrast evaluation step, the contrast evaluation step including: determining the location of the best focus based on contrast criteria.
3. The method of claim 2, comprising the determination step, the approximation step and the contrast evaluation step.
4. The method of claim 3, wherein the approximation step is performed after the determination step.
5. The method of claim 3, wherein the contrast evaluation step is performed after the approximation step.
6. The method of claim 1, further comprising selecting a first difference distance between the first focal distance and the second focal distance in the determination step in accordance with
DA.sub.a=a*DOF, with DA.sub.a being the difference distance, a being a factor, and DOF being a depth of field of the lens.
7. The method of claim 6, wherein the factor a is in a range of 1<a<5.
8. The method of claim 6, wherein the factor a is in a range of 2<a<4.
9. The method of claim 6, wherein the factor a is 3.
10. The method of claim 1, further comprising selecting a second difference distance between the at least three focal distances in the approximation step in accordance with
DA.sub.b=b*DOF, with DA.sub.b being the largest possible difference distance between the at least three focal distances, b being a factor, and DOF being a depth of field of the lens.
11. The method of claim 10, wherein the factor b is in a range of 0.25<b<2.
12. The method of claim 10, wherein the factor b is in a range of 0.25<b<1.25.
13. The method of claim 10, wherein the factor b is 1.
14. The method of claim 1, wherein: the lens is a zoom lens, and the zoom lens is telecentric on both sides.
15. The method of claim 6, wherein the depth of field of the lens is determined pursuant to
DOF=λ/(NA.Math.V).sup.2 wherein DOF is the depth of field of the lens, V is the magnification of the lens, in particular an axial magnification, NA is the image-side numerical aperture at the magnification, and λ is a reference wavelength.
16. The method of claim 15, wherein the reference wavelength is in a range of 400 nm≦λ≦650 nm.
17. The method of claim 16, wherein the reference wavelength is 550 nm.
18. A coordinate-measuring apparatus comprising: an optical sensor; and a control device configured for focusing the optical sensor, wherein the control device is configured for carrying out the method of claim 1.
19. The coordinate-measuring apparatus of claim 18, further comprising: an illumination system for generating a bright-field incident light illumination; and, wherein at least parts of the lens are configured to be a part of the illumination system for subjecting the surface to be measured to illumination light.
20. The coordinate-measuring apparatus of 19, wherein: the illumination system emits light with wavelengths λ in a range of 400 nm≦λ≦650 nm, and for at least one wavelength λ in said range for the illumination system for generating the bright-field incident light illumination on the surface to be measured, the lens has a same location of the best focus as for the imaging of the surface to be measured on the sensor.
21. A non-transitory computer readable storage medium containing a computer program which has a program code for carrying out the method of claim 1, if the computer program is executed on a coordinate-measuring apparatus.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
[0055] The invention will now be described with reference to the drawings wherein:
[0056]
[0057]
[0058]
[0059]
[0060]
[0061]
[0062]
DESCRIPTION OF EXEMPLARY EMBODIMENTS
[0063]
[0064] The workpiece 12 to be measured is arranged, for example, on a table or a base plate 16. In the illustrated view, the table or the base plate is aligned in an XY plane of a coordinate system 18. A Z direction 20 extends perpendicular to the table 16. A distance between the optical sensor 14 and the workpiece 12 in the Z direction 20 is provided with a reference sign 22. The optical sensor 14 and the table 16 or the workpiece 12 are movable relative to one another. In this way, the distance 22 can be varied. In principle, provision may be made for this purpose for either the table 16 to be movable at least in the Z direction or for the optical sensor 14 to be movable, for example by a suitable mechanism 24, in the Z direction. The mechanism 24 can also be, for example, a portal construction or the like. The coordinate-measuring machine does not necessarily have to have a table setup. Provision may also be made for both the optical sensor 14 and the table 16 to be movable in the Z direction.
[0065] For the sake of simplicity, it is assumed in the following exemplary embodiments that the table 16 or the workpiece 12 remains fixed and that the optical sensor 14 is moved in the Z direction to vary the distance 22 between the optical sensor 14 and the workpiece 12. However, this does not necessarily have to be the case.
[0066] In order to vary the distance 22 such that the optical sensor 14 is focused onto the workpiece 12, the coordinate-measuring machine 10 has a control device 26. The control device 26 is capable of moving the optical sensor 14 at a distance 22 relative to the workpiece 12 such that the images recorded by the optical sensor 14 have maximum sharpness. To this end, an auto-focus function of the coordinate-measuring machine 10 can be triggered. Furthermore, the coordinate-measuring machine 10 has a data processing device 28 which is configured to carry out a request for images of the optical sensor 14 and their evaluation and, based on these results, outputs a position of the optical sensor 14 in which focusing of the optical sensor 14 onto the workpiece 12 is set. This is then adjusted by the control device 26. The control device 26 and the data processing device 28 can also be implemented as a single unit or a single element; the data processing device 28 and the control device 26 are illustrated as separate units merely for the purposes of explanation.
[0067] Moreover, the coordinate-measuring machine 10 can have an input device 30. This can be used by a user to input into the coordinate-measuring machine 10 for example desired search regions or to manually move the optical sensor 14 and thus also to manually adjust a distance 22 between the optical sensor 14 and the workpiece 12.
[0068] At the start of a method, provision may be made for a user to adjust the optical sensor 14 approximately near an assumed focal distance 32. Starting from this assumed focused distance, a first focal distance 34 and a second focal distance 36 are specified which define between them a catchment region 38. In this exemplary embodiment, the first focal distance 34 is at a greater distance 22 from the workpiece 12 than the second focal distance 36. Of course, this can also be selected to be the other way around. Alternatively, provision may furthermore be made, if no user input is intended to be made at the beginning, for the first focal distance 34 to be specified at a maximum possible distance 22 between the optical sensor 14 and the workpiece 12 and for the second focal distance 36 to be specified at a minimum possible distance 22 between the optical sensor 14 and the workpiece 12.
[0069]
[0070]
[0071] In the illustrated exemplary embodiment, provision may be made, for example for a bright-dark transition over an edge 40 that is visible in the image distance of the workpiece 12 to be used as a contrast criterion. Accordingly, what is known as an “area of interest (AOI)” 42 in the image is specified, which has the edge 40 and is subsequently evaluated. In the illustrated example, the edge 40 extends horizontally through the image. Accordingly, for example a grey level gradient in the vertical direction, i.e. perpendicular to the edge 40, within the AOI 42 can be used to form the contrast criterion. The optical sensor 14 during the recording is set at a specific distance 22 from the workpiece 12. Provision may be made, for example, for a surface of the workpiece 12 that faces the optical sensor 14 to be examined. The optical sensor 14 has a lens 44 which must be adapted and arranged for optimum focusing such that a tip 46 of a focus cone is arranged on the surface of the workpiece 12 to be observed. In the exemplary embodiment, the focus cone is located somewhat within the workpiece 12, i.e. the distance 22 is a little too small. A depth of field is designated 47 starting from the tip 46 of the focus cone. The image illustrated in
[0072] However, in contrast to a contrast criterion such as the grey level gradient, the intensity can be evaluated as a function of the distance 22 as a focus criterion even if a sharp image can no longer be generated, as is illustrated in
[0073]
[0074] An intensity Gauss curve 54 that is to be expected is subsequently matched by the data processing unit 28 to the two intensity values for the focal distance 34 and the focal distance 36 by way of interpolation. This intensity Gauss curve 54 that is to be expected is plotted in
[0075] As an alternative to matching an intensity Gauss curve, it may be advisable to determine the most probable location 58 of the best focus merely from the intensity ratio of the two image recordings with respect to the distance 59. With this linear approach, the most probable location 58 of the best focus is determined by the distance 59 being divided according to the intensity ratio of the two image recordings. For example, if the intensity of one image gives the value 2, and the intensity of the other image gives for example the value 5, then the distance 59 is divided into 2+5=7 units. This then gives the centroid and thus the most probable location 58 of the best focus at 2/7th of the distance 59 from the image with the intensity value 5. In the determination step 102, the most probable location 58 of the best focus can thus be determined from an assessment of the intensities of the two recorded image recordings in relation to the first set focal distance 34 and to the second set focal distance 36 by way of matching an intensity Gauss curve and by way of a linear weighting of the intensity values.
[0076] The left part of the illustration in
[0077] In one exemplary embodiment of the method, the exact location of the best focus is then ascertained based on the image recordings for a plurality of different focal distances within the depth of field region 47 in a contrast evaluation step using known contrast criteria, such as for example the criterion of the grey level gradient, which was mentioned initially with respect to
[0078]
[0079] Subsequently, the data processing unit 28 ascertains the extremum 56 of the intensity Gauss curve. The location of the extremum 56 then corresponds to the probable location 58 of the best focus.
[0080] In the approximation step 104, starting from the most probable location 58 of the best focus, at least three different focal distances 34″, 36″ and 58″ are set by the coordinate-measuring machine 10. Here, the focal distance 58″ corresponds to the most probable location 58 of the best focus. In all three set focal distances 34″, 36″ and 58″, image recordings are taken and evaluated by the data processing unit 28 with respect to the overall intensity. In turn, an intensity Gauss curve is adapted to the thus obtained intensity values, and their extremum is ascertained. The location of the best focus is then approximately obtained from the location of the extremum. The difference distance DA.sub.b, or the search interval 66 is obtained in the approximation step as a function of the depth of field DOF in accordance with DA.sub.b=b*DOF, with DA.sub.b, being the largest possible difference distance between the at least three focal distances 34″, 36″ and 58″, and b being a factor in a range of 0.25<b<2, preferably in a range of 0.25<b<1.25, with further preference being 1. This factor b can be given or suggested in advance by the data processing unit 28 or be input by the user.
[0081] In the contrast evaluation step 106, starting from the approximately determined location of the best focus, what are known as focus zones are travelled by the coordinate-measuring machine 10, and the image recordings which are obtained in the process are analysed by the data processing unit 28 with respect to a contrast criterion, for example the grey level gradient mentioned in the beginning. However, unlike the case in the determination step, the largest possible difference distance of the focus zone is limited to the depth of field region 47 or a fraction thereof, since sufficiently sharp images for the application of a contrast criterion can be obtained only within the depth of field region 47. This has already been explained in more detail in connection with
[0082] However, it might be the case that either the selected distances between the individual recordings of the focus zone are not optimal, or that the analysed contrast values exhibit such large variations that a desired sufficient precision in the determination of the location of the best focus is not achieved.
[0083] Consequently, the error level is determined in the determination of the location of the best focus in a check step 107. If this error level falls below a determined threshold value, the determination of the location of the best focus is deemed to be good (Y), and the method is continued in step 108. However, if the error level is exceeded (N), the contrast evaluation step 106 is repeated.
[0084] In step 108, the ascertained exact location of the best focus is set for a subsequent measurement of the surface to be measured, and the user is given the choice between different illumination types and illumination forms of the surface to be measured. Alternatively, the illumination types and illumination forms to be selected in step 108 can also be specified by the data processing unit 28. For example, these illumination types and illumination forms can be stored in an examination plan or a measurement protocol.
[0085] After the illumination is set in step 108, the actual measurement of the surface of the workpiece 12 to be measured is performed in step 110. The geometric shapes registered in the recording by the data processing unit 28 are here made available, after a request by the user at the input device, for example on a screen for further evaluation.
[0086] However, it may also be the case that the user is not satisfied with the quality of the recording. The quality of the measurement recording is therefore checked by the user himself in step 111 and is either deemed to be good (Y), as a result of which the measurement operation is terminated (STOP), or the quality of the measurement recording is deemed to be insufficient (N), and in this case the recording conditions are changed by the user in step 112, and the method returns to step 108.
[0087] If a sufficiently accurate location of the best focus is available even before the start of the method 100, it is also possible—as already mentioned in the beginning—to omit the determination step 102 or the approximation step 104, with the result that only one of the two intensity evaluation steps is used in this method 100 according to an exemplary embodiment of the invention.
[0088] Likewise, an illumination system may be provided on the coordinate-measuring machine 10 that is not illustrated in
[0089] It is understood that the foregoing description is that of the exemplary embodiments of the invention and that various changes and modifications may be made thereto without departing from the spirit and scope of the invention as defined in the appended claims.