A confocal distance measuring method and system without displacement sensor
By using a confocal measurement platform and Gaussian function fitting calculations, the problems of high cost and incomplete measurement in non-contact ranging methods are solved, and low-cost three-dimensional distance measurement is realized.
Patent Information
- Application Number
- CN202410537615.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-30
- Publication Date
- 2025-12-19
- Estimated Expiration
- 2044-04-30
AI Technical Summary
Existing non-contact ranging methods suffer from high measurement costs or incomplete measurements, especially in the field of biological tissue ranging, where laser displacement sensors are expensive and provide incomplete measurements.
A sensorless confocal ranging method is adopted. Multifocal images are captured by a confocal measurement platform, and the distance to the target position is calculated by fitting a Gaussian function. An optimization problem is established and solved. The three-dimensional distance is calculated by combining the coordinates of the target position, thus avoiding the use of expensive displacement sensors.
It enables low-cost and comprehensive three-dimensional distance measurement without relying on displacement sensors, solving the technical problems of high measurement cost or incomplete measurement.
Smart Images

Figure CN118242989B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the field of contactless distance measurement, and more particularly relates to a confocal distance measurement method and system without displacement sensor. BACKGROUND
[0002] Distance measurement is needed in many scenarios. Existing distance measurement is generally divided into contact measurement and non-contact measurement. Contact measurement generally includes vernier caliper measurement, resistance displacement sensor, etc. The measurement needs to be in direct or indirect contact with the measured object, and the measurement accuracy is high. However, in some measurement fields, such as biological tissues and other soft structures, the shape will change slightly during contact, which makes the distance measurement lose its original accuracy.
[0003] Non-contact measurement mainly relies on non-contact sensors such as laser displacement sensors and acoustic sensors to complete distance measurement. The measurement does not need to be in contact with the measured object, and the measurement is relatively convenient. It is more suitable for distance measurement of objects with soft texture and shape change during contact. However, most sensors are relatively expensive, and the distance measurement cost is high, which is not economical in some fields. For example, when observing the brain structure of zebrafish using a biological optical microscope, the size of the brain needs to be known. Since the brain is soft in texture and the shape changes slightly, it is more appropriate to use sensors such as laser displacement sensors for non-contact measurement.
[0004] In the patent document with the application number CN202011247624.5, a confocal three-dimensional measurement method is mentioned. The method is to obtain a multi-focus image sequence by confocal shooting, then calculate the focus evaluation function value of the corresponding pixel position points on the sequence, and perform Gaussian function fitting of the focus evaluation function value-image distance to obtain accurate distance. This method has high measurement accuracy, but the laser displacement sensor used is expensive, and the measurement method has low economic value in the field of biological tissue distance measurement. Some researchers have proposed using a micro-camera with a calibrated distance pixel ratio to take pictures for distance measurement, but this method cannot obtain three-dimensional distance, and the measurement is not comprehensive, which cannot meet the measurement needs of actual applications.
[0005] Overall, the existing non-contact distance measurement method has the problems of high measurement cost or incomplete measurement. SUMMARY
[0006] In view of the defects and improvement needs of the prior art, the present application provides a confocal distance measurement method and system without displacement sensor, which aims to solve the technical problems of high measurement cost or incomplete measurement of the existing non-contact distance measurement method.
[0007] To achieve the above objectives, according to one aspect of the present invention, a sensorless confocal ranging method is provided for measuring the distance between two target positions in a target object; the confocal ranging method includes:
[0008] A confocal measurement platform was used to capture multifocal images of the target at M different axial heights. The heights of each multifocal image along the optical axis were denoted as z1, z2, z3, ..., z... M-1 z M ;
[0009] Select n pixel locations, including two target locations, and calculate the actual focus evaluation function value at each pixel location in each multi-focus image according to the preset focus evaluation function. And according to the Gaussian function L i (z j ) = A i * Calculate the fitted focus evaluation function value L at each pixel location in each multifocus image. i (z j ); i∈{1,2…n}, j∈{1,2…M}, A i μ i B i These represent the magnitude, mean, and constant term of the Gaussian fitting function at the i-th pixel position, respectively. The mean of the calibrated Gaussian fitting function; M and n are both positive integers greater than 1;
[0010] The height z of each multifocal image j and A corresponding to each pixel position i μ i B i To optimize parameters, and L i (z j With the objective of minimizing the time-interval error, an optimization problem is established and solved.
[0011] The mean of the Gaussian fitting function corresponding to the two target positions is obtained from the optimized parameters obtained from the solution, and the absolute value of the difference between the two is calculated as the actual axial distance ΔH between the two target positions.
[0012] according to Calculate the distance S between the two target positions; (x1,y1) and (x2,y2) are the coordinates of the two target positions, and I is the distance-to-pixel ratio of the confocal measurement platform.
[0013] Furthermore, the objective function of the optimization problem is:
[0014]
[0015] wherein, is an impact factor, and its calculation formula is:
[0016] Further, the optimization problem further comprises a first constraint condition:
[0017]
[0018] wherein, represents the maximum value of the actual focus evaluation function value at the i-th pixel position in each multi-focus image ; k1 and k2 are proportional coefficients, and k1 < k2.
[0019] Further, the optimization problem further comprises a second constraint condition:
[0020]
[0021] wherein, represents the average value of the actual focus evaluation function value at the i-th pixel position in each multi-focus image ; b1 and b2 are proportional coefficients, and b1 < b2.
[0022] Further, the optimization problem further comprises a third constraint condition:
[0023]
[0024] wherein, mm i represents the multi-focus image number corresponding to the maximum value of the actual focus evaluation function value at the i-th pixel position in each multi-focus image .
[0025] Further, the calibration method of the Gaussian fitting function mean value comprises:
[0026] (S1) setting a displacement sensor on a confocal measurement platform, which can be used to measure the axial height of the photographed multi-focus image;
[0027] (S2) using the confocal measurement platform to photograph a plurality of multi-focus images with axial height information for the measurement block;
[0028] (S3) selecting a plurality of different pixel positions; for each selected pixel position, calculating the focus evaluation function value at the pixel position in each multi-focus image according to a preset focus evaluation function, thereby obtaining a plurality of corresponding focus evaluation function values and axial heights, fitting the curve of the focus evaluation function value changing with the axial height by using a Gaussian function, and obtaining the mean value σ of the Gaussian function at the pixel position;
[0029] (S4) Use the average of the mean values of the Gaussian function corresponding to each pixel position as the mean value of the calibrated Gaussian fitting function.
[0030] According to another aspect of the present invention, a sensorless confocal ranging system is provided, comprising:
[0031] A confocal measurement platform is used to capture multifocal images of the target under test.
[0032] The control module is used to control the confocal measurement platform to capture multifocal images of the target at M different axial heights. The height of each multifocal image along the optical axis is denoted as z1, z2, z3, ..., z... M-1 z M ;
[0033] The focus evaluation module is used to calculate the actual focus evaluation function value at each pixel position in each multi-focus image according to a preset focus evaluation function. And according to the Gaussian function L i (z j ) = A i * Calculate the fitted focus evaluation function value L at each pixel location in each multifocus image. i (z j ); i∈{1,2…n}, j∈{1,2…M}, A i μ i B i These represent the magnitude, mean, and constant term of the Gaussian fitting function at the i-th pixel position, respectively. The mean of the calibrated Gaussian fitting function; M and n are both positive integers greater than 1;
[0034] The optimization solution module is used to obtain the mean of the Gaussian fitting function corresponding to the two target positions from the optimization parameters obtained by the solution, and calculate the absolute value of the difference between the two as the actual axial distance ΔH between the two target positions;
[0035] The ranging module is used to measure distances according to... Calculate the distance S between the two target positions; (x1,y1) and (x2,y2) are the coordinates of the two target positions, and I is the distance-to-pixel ratio of the confocal measurement platform.
[0036] Furthermore, the objective function of the optimization problem is:
[0037]
[0038] in, The impact factor is calculated using the following formula:
[0039] Further, the optimization problem further comprises at least one of the following constraint conditions:
[0040] The first constraint condition is:
[0041]
[0042] wherein, represents the maximum value of the actual focus evaluation function value at the i-th pixel position in each multi-focus image; k1 and k2 are proportional coefficients, and k1 < k2;
[0043] The second constraint condition is:
[0044]
[0045] wherein, represents the average value of the actual focus evaluation function value at the i-th pixel position in each multi-focus image; b1 and b2 are proportional coefficients, and b1 < b2;
[0046] The third constraint condition is:
[0047] z mmi-1 <μ i <z mmi+1
[0048] wherein, mm i represents the multi-focus image serial number corresponding to the maximum value of the actual focus evaluation function value at the i-th pixel position in each multi-focus image.
[0049] Further, the calibration method of the Gaussian fitting function mean value comprises:
[0050] (S1) setting a displacement sensor on a confocal measurement platform, which can be used to measure the axial height of the photographed multi-focus images;
[0051] (S2) using the confocal measurement platform to photograph a plurality of multi-focus images with axial height information for the measurement block;
[0052] (S3) selecting a plurality of different pixel positions; for each selected pixel position, calculating the focus evaluation function value at the pixel position in each multi-focus image according to a pre-set focus evaluation function, thereby obtaining a plurality of corresponding focus evaluation function values and axial heights, fitting the curve of the focus evaluation function value changing with the axial height by using a Gaussian function, and obtaining the mean value σ of the Gaussian function at the pixel position;
[0053] (S4) taking the average value of the Gaussian function mean values corresponding to each pixel position as the calibrated Gaussian fitting function mean value
[0054] Overall, the above technical solutions conceived by the present application can achieve the following beneficial effects:
[0055] (1) The present application finds that the depth of field measured by the camera does not change after the confocal measurement platform is completed without changing the optical structure, that is, the width of the peak of the Gaussian function obtained by fitting the focus evaluation function value-photo distance at a certain pixel position in the multi-focus image sequence obtained by the confocal measurement platform is a constant, that is, the standard deviation of the fitted Gaussian function is constant; Based on this, after the standard deviation of the Gaussian function is calibrated, the present application uses the confocal measurement platform to take multiple multi-focus images of the target to be measured, selects multiple pixel positions containing the target position, and uses the axial height of each image and the fitting parameters of the Gaussian function corresponding to each pixel as optimization parameters, with the error between the actual focus evaluation function value at each pixel position and the focus evaluation function value fitted by the Gaussian as the target, an optimization problem is established and solved, thereby the actual height of each target position can be obtained, combined with the coordinates of the target position, the three-dimensional distance measurement can be completed, and in this measurement process, it does not rely on displacement sensors, and the measurement cost is lower. Therefore, the present application can effectively solve the technical problems of high measurement cost or incomplete measurement of existing non-contact distance measurement methods.
[0056] (2) In the preferred scheme of the present application, the objective function for measuring the error between the actual focus evaluation function value at each pixel position and the focus evaluation function value fitted by the Gaussian is Where the influence factor The fitting degree of the mean μ is the most concerned in the distance measurement process, and the introduction of the influence factor can make the points far from the peak of the Gaussian function have less influence on μ, while the points at the peak have greater influence on μ, thereby reducing the fluctuation of the points far from the peak and the error of the optimization result.
[0057] (3) In the preferred scheme of the present application, a constraint condition is also set for the established optimization problem, which is used to constrain the amplitude, constant term and mean of the Gaussian function within a suitable range, thereby accelerating the fitting and facilitating the improvement of the efficiency of optimization solution. BRIEF DESCRIPTION OF DRAWINGS
[0058] Figure 1 is a schematic diagram of the same pixel position in each multi-focus image in the embodiment of the present application;
[0059] Figure 2 is a Gaussian fitting diagram of the focus evaluation function-photo depth distance at multiple pixel positions in the embodiment of the present application, and the value of σ of the Gaussian fitting function at each pixel position is almost the same;
[0060] Figure 3 A schematic diagram of an existing confocal measurement platform is shown in Figure 1.
[0061] Figure 4 A scatter plot of the actual focus function value at a certain pixel position and the photograph distance in the case where the photograph depth information is unknown in an embodiment of the present application, and a Gaussian fitting function plot obtained by the optimization model.
[0062] Figure 5 A flow chart of the confocal distance measurement method without displacement sensor provided by the embodiment of the present application is shown in Figure 2. In all the drawings, the same reference signs are used to represent the same elements or structures, wherein:
[0063] 1-stand, 2-camera, 3-laser displacement sensor, 4-lens, 5-light source, 6-object table. DETAILED DESCRIPTION
[0064] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application is further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application. In addition, the technical features involved in each embodiment of the present application described below can be combined with each other as long as they do not conflict with each other.
[0065] In the present application, the terms "first", "second", etc. (if any) in the present application and the drawings are used to distinguish similar objects, and do not necessarily describe a specific order or sequence.
[0066] In order to solve the technical problems of high measurement cost or incomplete measurement of the existing non-contact measurement method due to the dependence on expensive sensors, the present application provides a confocal distance measurement method and system without displacement sensor, which is based on the following measurement: after the confocal measurement platform is completed, the depth of field measured by the camera is constant without changing the optical structure. In the mathematical field, the width of the peak of the Gaussian function obtained by fitting the focus evaluation function value at a certain pixel position and the photograph distance of the multi-focus image sequence of the confocal measurement platform is a constant, i.e. the standard deviation σ of the fitted Gaussian function is constant, which is defined as the depth of field standard deviation in the present application. Figure 1 The same pixel position in each multi-focus image is shown in Figure 3, and the focus evaluation function value at the pixel position in each multi-focus image is fitted by using the Gaussian function, so as to obtain the Gaussian curve corresponding to the pixel position. Figure 2 The Gaussian curves obtained by fitting at different pixel positions are shown in Figure 4, and the Gaussian curves obtained by fitting at different pixel positions are shown in Figure 5. Figure 2As shown in the Gaussian function, the standard deviation of each Gaussian curve is the same. After calibrating the standard deviation sigma, a set of multi-focus image sequences of a measurement object without the axial distance of the optical axis is obtained in the absence of a displacement sensor, and then the focus evaluation function value-photo distance (unknown) at a certain pixel position in each multi-focus image is calculated. The distribution also satisfies the Gaussian function distribution with a standard deviation of sigma, that is, the peak width is unchanged, and according to data optimization, the relative distance of the photo and the actual distance of any two points on the photo can be optimized.
[0067] Based on the above finding, the present application is realized by means of a confocal measurement platform, and before ranging, the standard deviation of the depth of field of the confocal measurement platform, that is, the standard deviation of the Gaussian function obtained by fitting the focus evaluation function value-photo distance at a certain pixel position, is fitted.
[0068] In practical applications, the present application can use any kind of confocal measurement platform that can shoot multi-focus images at different heights, Figure 3 One of the optional confocal measurement platforms is shown, which includes a support 1, and a camera 2, a lens 4, a light source 5 and a stage 6 arranged on the support 1; the camera 2 and the lens 4 are combined to form a shooting unit; the stage 6 is used to carry the object to be measured and can move along the optical axis direction, the object to be measured is placed on the stage 6, and the stage 6 is moved up and down, and during the movement, multi-focus images at different axial heights can be shot.
[0069] Without loss of generality, in the following embodiments, a confocal measurement platform is used Figure 3 The confocal measurement platform is shown.
[0070] Optionally, in order to calibrate the depth of field standard deviation of the confocal stage platform, a laser displacement sensor 3 is arranged on the confocal stage platform, which can measure the distance between the stage 6 and the sensor; during the movement of the stage, the camera takes pictures of the object, and at the same time, the corresponding distance can be recorded by using the laser displacement sensor.
[0071] After setting the laser displacement sensor 3, the calibration method of the depth of field standard deviation of the confocal measurement platform is as follows:
[0072] A measurement block is placed on the stage, and the stage 6 is moved up and down, and during this process, shooting is performed and the distance sensed by the laser displacement sensor 3 is recorded. After completing the shooting process, a set of multi-focus image sequences with distance information can be obtained.
[0073] Multi-focus image fusion method needs to use focus evaluation function to determine which photo is the best focus at a certain pixel position. Since there is an edge part in the image, when it is in focus, the image is clear and contains the most high-frequency components of edge information; when it is out of focus, the image is blurred and has fewer high-frequency components. Therefore, whether the image is in focus can be determined by the number of high-frequency components of the edge information of the image. For digital images, there are many ways to evaluate the focus, and the principle is to use evaluation function to measure the blur of out-of-focus image. The traditional image focus evaluation function can be mainly divided into the following categories:
[0074] (1) Gray scale change function: the focused image contains more gray scale changes than the out-of-focus image, so the change of image gray scale value can be used as the basis of the evaluation function;
[0075] (2) Gradient function: in image processing, image gradient can be used for edge extraction. The smaller the defocus amount is, the sharper the image edge is, and it should have a larger image gradient value;
[0076] (3) Image gray entropy function: the information entropy of the focused image is greater than that of the out-of-focus image, so the gray entropy of the image can be used as the evaluation function;
[0077] (4) Frequency domain function: this kind of function is mainly based on Fourier transform. The high-frequency component of Fourier transform corresponds to the image edge, and the focused image always has sharp edges, that is, contains more high-frequency components, so the amount of high-frequency components after image Fourier transform can be used as the evaluation criterion.
[0078] Taking the second-order partial derivative as the focus evaluation function as an example, the mathematical expression is:
[0079]
[0080] Wherein, represents Laplace operator; f(x,y) is the gray scale value of the image at pixel coordinates (x,y).
[0081] In the process of solving numerical differentiation by difference method, the central difference formula with precision of O(h 4 ) can be used to replace the second-order partial derivative of a certain pixel point, that is,
[0082]
[0083] The expression of Laplace operator at pixel point (x,y) is:
[0084] L(x,y) = |f xx | + |f yy |
[0085] The focus evaluation function for pixel (x, y) is the sum of the Laplace operators for all pixels within a region centered on it, i.e.:
[0086]
[0087] Where: x = (i1 + i2) / 2; y = (j1 + j2) / 2; (i1, j1) and (i2, j2) represent the coordinates of the upper left and lower right corners of the region, respectively.
[0088] like Figure 4 As shown, a pixel position is selected in the multi-focus image sequence. At this position, the focus evaluation function value on each photo is calculated using the focus evaluation function mentioned above, and a scatter plot of focus evaluation function value - sensor reading (axial height) is plotted. It is known that the scatter plot is distributed along a Gaussian curve. Therefore, the scatter plot is fitted with a Gaussian curve in the form of the following function to obtain the standard deviation σ1 of the Gaussian function.
[0089]
[0090] Where L represents the value of the focus evaluation function, z represents the corresponding axial height, and A, B, μ and σ represent the magnitude, constant term, mean and standard deviation of the Gaussian function to be fitted, respectively.
[0091] By selecting n0 distinct pixels and performing the same fitting process, n0 standard deviations can be obtained, i.e.: The average of these n0 standard deviations is calculated, and the calculated average value is... This serves as the depth standard deviation for the confocal measurement platform. After calibration, the laser displacement sensor can be removed, and a sequence of multifocal images can be measured without the sensor, utilizing the calibrated standard deviation. The distance ΔH between any two points (x1, y1) and (x2, y2) along the optical axis in the multifocal image can be calculated. By combining the coordinates of the two points (x1, y1) and (x2, y2), the actual three-dimensional distance can be measured.
[0092] For confocal measurement platforms, it is usually necessary to first calibrate their distance-to-pixel ratio, which is the ratio between the pixel distances in the captured multifocal images and the corresponding actual distances. Optionally, in this embodiment, the distance-to-pixel ratio is calibrated in the following manner:
[0093] A distance calibration plate (Zhang Zhengyou calibration plate, with the side length of each small square known) is placed on stage 6. Stage 6 is adjusted to ensure the distance calibration plate appears as the clearest image in the camera. A MATLAB calibration algorithm is used to find the corner points of each small square on the calibration plate. Any two corner points are selected, and their pixel coordinates are obtained. The pixel distance D1 between these two intersection points can then be calculated. The actual distance D2 between these two intersection points is obtained using the Zhang Zhengyou calibration plate, and the distance-to-pixel ratio at that location is calculated. This completes the calibration of the distance-to-pixel ratio.
[0094] It is easy to understand that when using other confocal measurement platforms, the depth standard deviation and distance-to-pixel ratio can still be calibrated in the same way.
[0095] The following is an example.
[0096] Example 1:
[0097] A confocal ranging method without displacement sensors is used to measure the distance between two target positions in a target to be measured.
[0098] like Figure 5 As shown, confocal ranging methods include:
[0099] A confocal measurement platform was used to capture multifocal images of the target at M different axial heights. The heights of each multifocal image along the optical axis were denoted as z1, z2, z3, ..., z... M-1 z M The distances between two adjacent multifocal images are denoted as h1, h2, h3, ..., h... M-1 .
[0100] Select n pixel locations, including two target locations, and calculate the actual focus evaluation function value at each pixel location in each multi-focus image according to the preset focus evaluation function. And according to the Gaussian function L i (z j ) = A i * Calculate the fitted focus evaluation function value L at each pixel location in each multifocus image. i (z j );
[0101] L represents the actual focus evaluation function value at the i-th pixel position in the j-th multifocus image, calculated according to the evaluation function; i (z j) represents the value of the fitting focus evaluation function at the i-th pixel position in the j-th multi-focus image obtained by Gaussian function fitting; i e {1, 2,... n}, j e {1, 2,... M}, A i , μ i , B i respectively represent the amplitude, mean and constant term of the Gaussian fitting function at the i-th pixel position; is the calibrated Gaussian fitting function mean; M and n are both positive integers greater than 1.
[0102] Since there is no displacement sensor, the height of each multi-focus image along the optical axis is unknown, in addition, the amplitude, mean and constant term of the Gaussian function corresponding to each pixel position are also unknown. In order to realize distance measurement, the embodiment takes these parameters as optimization parameters, establishes an optimization problem with the minimum error between F and L i (z j ) as the goal, and solves the optimization problem to obtain the height of each multi-focus image along the optical axis. Specifically, in the optimization problem established by the embodiment, the optimization parameters include:
[0103] The distance of each photo along the optical axis is z1, z2, z3,..., z M-1 , z M ;
[0104] The amplitude of Gaussian fitting of each pixel position is A 1 , A 2 , A 3 ,... A n-1 , A n ;
[0105] The constant term of Gaussian fitting of each pixel position is B 1 , B 2 , B 3 ,... B n-1 , B n ;
[0106] The mean of Gaussian fitting of each pixel position is μ 1 , μ 2 , μ 3 ,... μ n-1 , μ n ;
[0107] To simplify the calculation, optionally, in the embodiment, z1=0 is set, and the number of parameters to be optimized is M+3n-1.
[0108] Let F represent and L i (z jGiven the errors between z1, z2, z3, ..., z2, the optimization problem established in this embodiment is: to find the values of z2, z3, ..., z2. M-1 z M A 1 A 2 A 3 ...A n-1 A n B 1 B 2 B 3 ...B n-1 B n μ 1 μ 2 μ 3 ...μ n-1 μ n This minimizes F.
[0109] This embodiment introduces an impact factor into F; the specific expression for F is:
[0110]
[0111] in The impact factor can be calculated using the following formula:
[0112]
[0113] The degree of fit of the mean μ is the most important aspect of this embodiment. After calculating the influence factor based on the above method and introducing it into the error calculation formula between the actual focus evaluation function value and the fitted focus evaluation function value, it is possible to make the points far from the peak of the Gaussian function have a smaller influence on μ, while the points at the peak have a larger influence on μ, thereby reducing the fluctuation of points far from the peak and the error of the optimization result.
[0114] Furthermore, considering that in the Gaussian function, the amplitude A reflects the height of the peak, which is related to the maximum value of the Gaussian function, therefore amplitude A is near the maximum value of the Gaussian function; B reflects the function value of the Gaussian function at points far from the peak, and since points far from the peak are basically horizontal, B is reflected by the average of all points; μ reflects the x-coordinate of the maximum value of the Gaussian function, which appears at the maximum value of the actual focusing function. On both sides, that is Between. Based on the above considerations, this embodiment also designs some constraints as auxiliary conditions for the optimization problem to accelerate the solution of the optimization problem. These auxiliary conditions are as follows:
[0115] First constraint:
[0116]
[0117] in, the maximum value of the actual focus evaluation function value at the i-th pixel position in each multi-focus image; k1 and k2 are proportional coefficients, and k1 < k2.
[0118] The second constraint condition is:
[0119]
[0120] wherein, the average value of the actual focus evaluation function value at the i-th pixel position in each multi-focus image; b1 and b2 are proportional coefficients, and b1 < b2.
[0121] The third constraint condition is:
[0122]
[0123] wherein, mm i the maximum value of the actual focus evaluation function value at the i-th pixel position in each multi-focus image; b1 and b2 are proportional coefficients, and b1 < b2.
[0124] After solving the optimization problem under the above constraint conditions, the absolute value of the difference between the mean values of the Gaussian fitting functions corresponding to the two target positions is calculated as the actual axial distance ΔH between the two target positions;
[0125] According to the distance S between the two target positions is calculated; (x1, y1) and (x2, y2) are the coordinates of the two target positions, and I is the distance pixel ratio of the confocal measurement platform.
[0126] It should be noted that, Figure 2 the confocal measurement platform shown is only one optional confocal object platform in the embodiment, and other confocal measurement platforms can also be used in some other embodiments of the application.
[0127] In summary, this embodiment, after calibrating and obtaining the standard deviation of the Gaussian function, uses a confocal measurement platform to capture multiple multi-focus images of the target. Multiple pixel locations, including the target location, are selected. The axial height of each image and the fitting parameters of the Gaussian function corresponding to each pixel are used as optimization parameters. The goal is to minimize the error between the actual focus evaluation function value at each pixel location and the Gaussian-fitted focus evaluation function value. An optimization problem is established and solved, thereby obtaining the actual height at each target location. Combined with the target location coordinates, three-dimensional distance measurement can be completed. Furthermore, this measurement process does not rely on displacement sensors, resulting in lower measurement costs. Therefore, this embodiment effectively solves the technical problems of high measurement costs or incomplete measurements in existing non-contact ranging methods.
[0128] Example 2:
[0129] A sensorless confocal ranging system, comprising:
[0130] A confocal measurement platform is used to capture multifocal images of the target under test.
[0131] The control module is used to control the confocal measurement platform to capture multifocal images of the target at M different axial heights. The height of each multifocal image along the optical axis is denoted as z1, z2, z3, ..., z... M-1 z M ;
[0132] The focus evaluation module is used to calculate the actual focus evaluation function value at each pixel position in each multi-focus image according to a preset focus evaluation function. And according to the Gaussian function L i (z j ) = A i * Calculate the fitted focus evaluation function value L at each pixel location in each multifocus image. i (z j ); i∈{1,2…n}, j∈{1,2…M}, A i μ i B i These represent the magnitude, mean, and constant term of the Gaussian fitting function at the i-th pixel position, respectively. The mean of the calibrated Gaussian fitting function; M and n are both positive integers greater than 1;
[0133] The optimization solution module is used to obtain the mean of the Gaussian fitting function corresponding to the two target positions from the optimization parameters obtained by the solution, and calculate the absolute value of the difference between the two as the actual axial distance ΔH between the two target positions;
[0134] The ranging module is used to measure distances according to... Calculate the distance S between the two target positions; (x1, y1) and (x2, y2) are the coordinates of the two target positions, and I is the distance pixel ratio of the confocal measurement platform.
[0135] As a preferred embodiment, in this embodiment, the objective function of the optimization problem is:
[0136]
[0137] wherein, is an influence factor, and the calculation formula is:
[0138] In this embodiment, the optimization problem further includes at least one of the following constraint conditions:
[0139] The first constraint condition is:
[0140]
[0141] wherein, represents the maximum value of the actual focus evaluation function value of the i-th pixel position in each multi-focus image ; k1 and k2 are proportional coefficients, and k1 < k2;
[0142] The second constraint condition is:
[0143]
[0144] wherein, represents the average value of the actual focus evaluation function value of the i-th pixel position in each multi-focus image ; b1 and b2 are proportional coefficients, and b1 < b2;
[0145] The third constraint condition is:
[0146]
[0147] wherein, mm i represents the maximum value of the actual focus evaluation function value of the i-th pixel position in each multi-focus image corresponding to the multi-focus image sequence number.
[0148] In this embodiment, the specific implementation of each module can refer to the description in the above embodiment 1, which will not be repeated here.
[0149] Those skilled in the art can easily understand that the above only describes the preferred embodiments of the present application, and is not intended to limit the present application, and any modifications, equivalent replacements and improvements made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A confocal distance measuring method without displacement sensor, for measuring the distance between two target positions in a target to be measured; characterized in that, The confocal distance measuring method comprises: A confocal measurement platform is used to take multi-focus images of the target to be measured at different axial heights, each multi-focus image being recorded in order along the height of the optical axis M , , , , , ; Selecting two target locations n At each pixel location, the actual focus evaluation function value at each pixel location in each multi-focus image is calculated according to a preset focus evaluation function. and according to the Gaussian function Calculate the fitted focus evaluation function value at each pixel location in each multifocus image. ; , , , , They represent the first i The magnitude, mean, and constant term of the Gaussian fitting function at each pixel location; The mean of the calibrated Gaussian fitting function; M and n All are positive integers greater than 1; the height of each multi-focus image , and the corresponding , , as optimization parameters, and the optimization problem is established and solved with the minimum error between the optimization parameters and the corresponding and . The absolute value of the difference between the two target position corresponding Gaussian fitting function mean values is calculated as the actual axial distance between the two target positions ; According to calculating the distance between two target positions ; and are the coordinates of the two target positions, respectively, I is the distance pixel ratio of the confocal measurement platform. The objective function of the optimization problem is: wherein is an impact factor, the formula for which is: .
2. The displacement sensorless confocal ranging method of claim 1, wherein, The optimization problem further comprises a first constraint condition: wherein, represents the maximum value of the actual focus evaluation function value i at the i-th pixel position in each multi-focus image; k 1 and k 2 are proportional coefficients, k 1 k 2. 3. The displacement sensorless confocal ranging method of claim 1, wherein, The optimization problem further comprises a second constraint condition: wherein denotes the average value of the actual focus evaluation function values i at the pixel positions in each of the plurality of focus images; and is a proportionality factor, .
4. The displacement sensorless confocal ranging method of claim 1, wherein, The optimization problem further comprises a third constraint condition: wherein, represents the maximum value of the actual focus evaluation function value i at the i-th pixel position in each multi-focus image corresponding to the multi-focus image sequence number.
5. A displacement sensorless confocal ranging method according to any one of claims 1 to 4, wherein, Gaussian fit function mean The calibration mode includes: (S1) setting a displacement sensor on the confocal measurement platform, which can be used to measure the axial height of the photographed multi-focus image; (S2) using the confocal measurement platform to photograph multiple multi-focus images with axial height information for a measurement block; (S3) selecting a plurality of different pixel positions; for each selected pixel position, calculating a focus evaluation function value at the pixel position in each of the plurality of focus images according to a preset focus evaluation function, thereby obtaining a plurality of corresponding sets of focus evaluation function values and axial heights; fitting a curve of the focus evaluation function values changing with the axial heights by using a Gaussian function, to obtain a mean value of the Gaussian function at the pixel position ; (S4) taking the average of the means of the Gaussian functions corresponding to the pixel positions as the mean of the calibrated Gaussian fitting function .
6. A confocal ranging system without displacement sensor, characterized in that Comprise: A confocal measurement platform is used to photograph a multi-focus image of a target to be measured; A control module is configured to control the confocal measurement platform to capture a plurality of focus images of the target object at different axial heights, each of the plurality of focus images having a height along the optical axis, and the heights of the plurality of focus images are sequentially recorded as M , , , , , ; a focusing evaluation module, configured to calculate an actual focusing evaluation function value at each pixel position in each multi-focus image according to a preset focusing evaluation function , and calculate a fitting focusing evaluation function value at each pixel position in each multi-focus image according to a Gaussian function ; , , , , respectively represent an amplitude, a mean value and a constant term of the Gaussian fitting function corresponding to the i-th pixel position; i is a calibrated mean value of the Gaussian fitting function; and M are positive integers greater than 1; the height of each multi-focus image n , , and the corresponding , , are optimization parameters, and an optimization problem is established and solved with the objective of minimizing the error between and ; An optimization solving module is configured to obtain the mean values of the Gaussian fitting functions corresponding to the two target positions from the obtained optimization parameters, and calculate the absolute value of the difference between the two mean values as the actual axial distance between the two target positions ; a distance measuring module for calculating the distance between two target positions according to ; ; and are the coordinates of the two target positions, respectively, I is the distance pixel ratio of the confocal measurement platform. The objective function of the optimization problem is: wherein is an impact factor, the formula for which is: .
7. The displacement sensorless confocal ranging system of claim 6, wherein, The optimization problem further comprises at least one of the following constraint conditions: A first constraint condition: wherein represents the maximum value of the actual focus evaluation function value i at the i-th pixel position in each of the plurality of focus images; k 1 and k 2 are proportional coefficients, k 1 k 2; A second constraint condition: wherein denotes the average value of the actual focus evaluation function values i at the pixel positions in each of the plurality of focus images; and is a proportionality factor, ; A third constraint condition: wherein, represents the maximum value of the actual focus evaluation function value i at the i-th pixel position in each multi-focus image corresponding to the multi-focus image sequence number.
8. A displacement sensorless confocal ranging system as claimed in claim 6 or 7, wherein, Gaussian fit function mean The calibration mode includes: (S1) setting a displacement sensor on the confocal measurement platform, which can be used to measure the axial height of the photographed multi-focus image; (S2) using the confocal measurement platform to photograph multiple multi-focus images with axial height information for a measurement block; (S3) selecting a plurality of different pixel positions; for each selected pixel position, calculating a focus evaluation function value at the pixel position in each of the plurality of focus images according to a preset focus evaluation function, thereby obtaining a plurality of corresponding sets of focus evaluation function values and axial heights; fitting a curve of the focus evaluation function values varying with the axial heights by using a Gaussian function, to obtain a mean value of the Gaussian function at the pixel position ; (S4) taking the average of the means of the Gaussian functions corresponding to the pixel positions as the mean of the calibrated Gaussian fitting function .
Citation Information
Patent Citations
Automatic zooming three-dimensional morphology measurement system and method
CN112432607A
Automatic focusing method based on calibration information
CN112019751A
Automatic focusing method for fluorescence imaging equipment
CN117233921A