Three-dimensional reconstruction method for absolute depth of surface of measured object under microscopy
By introducing guide map filtering and focus plane search technology into the traditional stacked three-dimensional reconstruction method, the depth information processing is optimized, and the traditional method has been solved in the accuracy and effect, and the high-precision three-dimensional reconstruction effect is achieved.
Patent Information
- Application Number
- CN202510074754.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-17
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2045-01-17
AI Technical Summary
The traditional stacked three-dimensional reconstruction method has large errors in measurement accuracy and effect, especially when the object to be measured is tilted or irregular surface, the fixed parallel window cannot effectively deal with the influence of parallax, resulting in a reduction in reconstruction accuracy.
A three-dimensional reconstruction method of the absolute depth of the surface of the object being measured under microscopy is adopted. By collecting the stacked image sequence, the guide map is used to filter out the noise in the initial depth map, the depth information is optimized, and the accuracy of depth estimation is improved through focus plane search and three-dimensional spatial plane optimization.
It improves the accuracy and completeness of the surface depth measurement of the object to be measured, and can reconstruct microscopes with complex morphology more accurately, improving the anti-interference and universality of the three-dimensional reconstruction method.
Smart Images

Figure CN119941996A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of image processing, and in particular to a high-precision three-dimensional reconstruction method of the absolute depth of the surface of an object being measured under a microscope. Background Art
[0002] With the advancement of computer vision, deep learning and sensor technology, 3D reconstruction has become more efficient and accurate, providing strong support for multidisciplinary cross-cutting and practical applications. 3D reconstruction is a technology that converts 2D data into 3D models for digital expression of the real world. It is widely used in industrial design, medical imaging, virtual reality, cultural relics protection, precision measurement and autonomous driving. Focus-stacked microscopic 3D reconstruction uses a small depth of field imaging system to continuously collect a set of focus degree and surface morphology fluctuations, and a sequence of focused images related to the acquisition distance perpendicular to the surface of the object to be measured, and uses a focus evaluation function to evaluate the focus degree of all object points corresponding to the pixel points. Finally, the focus position is located by the peak search method, and the surface depth information of the object to be measured is restored by combining the displacement information during acquisition. As a non-contact 3D measurement method, focus-stacked microscopic 3D reconstruction has the advantages of small size, low cost, easy installation and high measurement efficiency, and has broad application prospects.
[0003] The traditional stacked focus 3D reconstruction method is to evaluate the focus of the image according to the sequence of stacked focus images using a specific focus evaluation function to obtain discrete focus evaluation values, and then interpolate and fit these values to draw a focus evaluation curve, and estimate the depth of the pixel point by the peak position of the curve, which has a large error. At the same time, in actual measurement, since the object to be measured itself has an inclined or irregular surface, using a fixed parallel window for focus evaluation will ignore the influence of the parallax of the object surface, thereby making inaccurate focus degree judgments, greatly reducing the accuracy and effect of reconstruction. Summary of the invention
[0004] The present invention optimizes and improves the model on the existing stacked focus 3D reconstruction technology, and proposes a 3D reconstruction method for the absolute depth of the surface of an object to be measured under a microscope, in order to improve the measurement accuracy and obtain complete information, and to achieve a high-precision 3D reconstruction effect of the absolute depth of the surface of the object to be measured, thereby better obtaining accurate information on the depth of the object surface.
[0005] To achieve the above object, the present invention adopts the following technical solution:
[0006] The three-dimensional reconstruction method of the absolute depth of the surface of the object to be measured under a microscope is characterized in that it is applied to a scene composed of the object to be measured, a stage, a stepping motor, a CDD camera, a microscope environment and a coaxial light source, and includes the following steps:
[0007] Step 1: Collect a sequence of focused images of the surface of the object being measured , ,…, ,…, ,in, Indicates The surface image of the object being measured, Indicates the number of images;
[0008] Step 2: Based on the stacked image sequence , ,…, ,…, , obtain the initial depth map of the surface of the object under test;
[0009] Step 3: Use the guide map to filter out the noise in the initial depth map and refine the depth information, thereby optimizing the initial depth map to obtain a smoothed 3D reconstructed depth map. .
[0010] The three-dimensional reconstruction method of the absolute depth of the surface of the object under microscope described in the present invention is also characterized in that: the step 1 comprises:
[0011] Step 1.1: The object to be measured is placed on the stage, and the light emitted by the coaxial light source passes through the collimator to become a parallel light beam, and a part of the parallel light beam reflected at the beam splitter passes through the microscope objective lens and irradiates the object to be measured;
[0012] Step 1.2: Determine the upper and lower limits of the stepper motor's movement along the Z axis:
[0013] Gradually reduce the distance between the microscope objective and the object being measured until all pixels on the CDD camera are out of focus and blurred, thus setting the current distance as the lower limit of the Z axis. ;
[0014] Gradually increase the distance between the microscope objective and the object to be measured until all pixels on the CDD camera change from clear to out-of-focus and blurred again, thereby setting the current distance as the upper limit of the Z axis. ;
[0015] Step 1.3: According to the number of images to be collected, the displacement step length of the stepper motor is set so that the CCD camera moves from the lower limit of the Z axis to the upper limit of the Z axis according to the set displacement step length. Start by moving and scanning the surface of the object to be measured until the upper limit of the Z axis is reached. So as to acquire a set of overlapping focus image sequences of the same scene with different focusing degrees.
[0016] Furthermore, the step 2 comprises:
[0017] Step 2.1: Set the maximum number of iterations to , the depth range is , the plane optimization stopping threshold is ;
[0018] Step 2.2: In Depth Range Internal Any pixel Assign a random depth value , get pixel The spatial coordinates of , and pixels Assign a random unit normal vector , thus obtaining pixels Initial focus plane ;
[0019] Constructing the initial focus plane The equation expression is: ,in, , , express 3 plane parameters of;
[0020] Step 2.3: From the initial focus plane A fixed-scale three-dimensional space plane is drawn in the image and used as a focus evaluation window, so that the pixel value in the focus evaluation window is calculated using equation (1). In the focal plane Focus rating on :
[0021] (1)
[0022] In formula (1), express Medium Pixels The image coordinates of Represents pixels In the focal plane The focusing function value on Indicates the focus weight value;
[0023] Step 2.4: Divide it into black and white checkerboards, where pixels are selected Several pixels around it with different chessboard colors, and one of them is recorded as The connected pixels , let the connected pixels The focal plane is ,judge Is it true? If so, set the pixel The focal plane Replace with , and update the pixel The focus evaluation value is , otherwise, remain unchanged, thus traversing all connected pixels and searching for the pixel Final matching focal plane ;
[0024] Step 2.5: Add a small perturbation to the focal plane Perform plane optimization to obtain a new focal plane :
[0025] Step 2.6: Follow the process of steps 2.4 and 2.5 to The pixels with the same color in the chessboard are updated and optimized at the same time, thus completing All with Focus plane optimization for pixels of the same checkerboard color;
[0026] Step 2.7: Follow the process in step 2.6 to The pixels of different checkerboard colors are optimized for plane update at the same time, thus completing Focus plane optimization for pixels of another checkerboard color in ;
[0027] Step 2.8: Continue to optimize according to the process of steps 2.4 to 2.6 until the maximum number of iterations is reached. So far, we get the pixel Final focal plane , and use The three plane parameters With vector After dot multiplication, we get Final depth information , thus , ,…, ,…, The final depth information of all pixels in constitutes the initial depth map of the object being measured.
[0028] Further, the step 2.5 includes:
[0029] Step 2.5.1: Pixel Depth value and the unit normal vector Set the maximum disturbance amount respectively and , will be located at Any random depth perturbation in the interval Assign depth value , thus obtaining Updated depth value And the updated spatial coordinates ;
[0030] Step 2.5.2: Place the Any random normal vector perturbation in the interval Assign unit normal vector , thus obtaining the updated unit normal vector , and by and Get the updated focus plane ,in, Indicates unitization;
[0031] Step 2.5.3: If If established, As a pixel The new focal plane and The initial setting is Half its length will Set to 1; otherwise, remain unchanged;
[0032] Step 2.5.4: If Less than When Plane optimization and get pixels New focal plane , otherwise, return to step 2.5.2 and execute sequentially;
[0033] Furthermore, the step 3 comprises:
[0034] Step 3.1: Use equations (2) and (3) to obtain the pixel in the stacked image sequence: The guide curve and pixels in the stacked image sequence Focus evaluation curve :
[0035] (2)
[0036] (3)
[0037] In formula (2), Indicates that the pixel of the stacked image sequence is a grayscale image The guide curve, Indicates the pixel when the stacked image sequence is a color image The guide curve, Represents pixels In the stacked image sequence The gray value on Represents pixels In the stacked image sequence The color value on
[0038] In formula (3), Represents pixels In the stacked image sequence Focus evaluation value on ;
[0039] Step 3.2: Calculate the pixel using equation (4) The guide curve and focus evaluation curve Manhattan distance :
[0040] (4)
[0041] In formula (4), represents the spatial distance between two vectors;
[0042] Step 3.3: Calculate the pixel using equation (5) The guide curve and focus evaluation curve Pearson correlation coefficient between :
[0043] (5)
[0044] In formula (5), express and The covariance of and Respectively and The standard deviation of and Respectively represent the pixels when the stacked image sequence is a grayscale image and a color image The mean of the bootstrap curve, Represents pixels The mean value of the focusing evaluation curve, ,like indicates a perfect positive correlation, if Indicates a perfect negative correlation;
[0045] Step 3.4: Calculate pixel using equations (6)-(8) The guide curve and focus evaluation curve The correction residual between :
[0046] (6)
[0047] (7)
[0048] (8)
[0049] In formula (6), Represents the guide curve The disturbance value of Represents the focus evaluation curve The disturbance value of
[0050] Step 3.5: Calculate the pixel using equation (9) The guide curve and focus evaluation curve The correlation between , thereby obtaining the correlation of each pixel and forming a guide map ;
[0051] (9)
[0052] Step 3.6: Use formula (10) to correct the initial depth map to obtain the final 3D reconstructed depth map :
[0053] (10)
[0054] In formula (10), and represents two linear correction parameters, and has:
[0055] (11)
[0056] (12)
[0057] In formulas (11) and (12), represents the depth map optimization area, express The total number of pixels in express The pixel position index in , Representation guide map Located in The pixel value at Represents the initial depth map at The pixel value at and Respectively represent the guide map and the initial depth map in The mean value in Representation guide map exist The pixel variance in is the normalization factor.
[0058] An electronic device of the present invention includes a memory and a processor, wherein the memory is used to store a program that supports the processor to execute the three-dimensional reconstruction method, and the processor is configured to execute the program stored in the memory.
[0059] The present invention provides a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and the computer program executes the steps of the three-dimensional reconstruction method when executed by a processor.
[0060] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0061] 1. The present invention proposes to use focus plane search instead of focus peak calculation, and constructs a new stacked focus microscopy 3D reconstruction algorithm framework, which avoids the inherent errors in peak search in traditional stacked focus microscopy 3D reconstruction methods to the greatest extent, improves the accuracy of overall depth estimation, and thus ensures that the reconstructed surface structure of the object under test is more complete.
[0062] 2. The present invention proposes to use a three-dimensional space plane instead of a parallel window to optimize the focus evaluation link, thereby eliminating the parallax effect caused by the parallel window and improving the reconstruction effect of curved or inclined surfaces, thereby achieving high-precision three-dimensional reconstruction of microscopic samples with complex morphology.
[0063] 3. The present invention uses the change of pixel gray value (color value) as the guiding curve, calculates the Manhattan distance and Pearson correlation coefficient between the guiding curve and the focusing evaluation curve, and performs guided filtering on the initial depth map, making the depth map more accurate and smooth, thereby improving the anti-interference and universality of the three-dimensional reconstruction method. It can greatly improve the reconstruction effect and measurement accuracy when applied to microscopy work. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] Figure 1 It is a schematic diagram of the principle of obtaining the surface depth of the object to be measured according to the present invention;
[0065] Figure 2 is a flow chart of collecting a sequence of overlapped focus images according to the present invention;
[0066] Figure 3 This is a sample image of a 1 mm height step stacking image sequence processed by the present invention;
[0067] Figure 4 It is a division diagram of the black and white chessboard of the present invention;
[0068] Figure 5It is the depth map before and after the optimization of the present invention. DETAILED DESCRIPTION
[0069] In this embodiment, a three-dimensional reconstruction method of the absolute depth of the surface of an object under microscope is provided. The principle and process are as follows: Figure 1 As shown in FIG. 1 , it is applied to a scene composed of an object to be measured, a stage, a stepper motor, a CDD camera, a microscope and a coaxial light source. Figure 2 As shown, the following steps are included:
[0070] Step 1: Use a microscopic imaging system to collect a sequence of focused images of the surface of the object being measured , ,…, , …, The number of images is roughly between 40 and 100. These sequence images are characterized by the same field of view, the same resolution, and different degrees of focus. They can be grayscale images or color images. Step-like images, for example Figure 3 As shown:
[0071] Step 1.1: Place the object to be measured on the stage. The light emitted by the coaxial light source becomes a parallel beam after passing through the collimator. A part of the light beam is reflected at the beam splitter and shines on the object to be measured through the microscope objective. Auxiliary light sources can be added to ensure that the objects in the field of view are visible.
[0072] Step 1.2: Determine the upper and lower limits of the high-precision displacement system along the Z axis:
[0073] Gradually reduce the distance between the microscope objective and the object being measured until all pixels on the CDD camera are out of focus and blurred, thus setting the current distance as the lower limit of the Z axis. ;
[0074] Gradually increase the distance between the microscope objective and the object to be measured until all pixels on the CDD camera change from clear to out-of-focus and blurred again, thereby setting the current distance as the upper limit of the Z axis. ;
[0075] During the displacement process, only one of the stage and the microscope objective needs to move while the other remains stationary.
[0076] Step 1.3: According to the number of images to be collected, the displacement step length of the stepper motor is set so that the CCD camera moves from the lower limit of the Z axis to the upper limit of the Z axis according to the set displacement step length. At the beginning, the surface of the object to be measured is continuously moved and scanned, and an image is collected each time a step is moved until the upper limit of the Z axis is reached. So far, a group of overlapping focus image sequences of the same scene with different focusing degrees are collected, and the content in the image changes from defocus to focus and then to defocus in sequence.
[0077] Step 2: Based on the stacked image sequence , ,…, ,…, , get the initial depth map of the surface of the object being measured:
[0078] Step 2.1: Set the maximum number of iterations , Depth Range , Plane optimization stop threshold The maximum number of iterations is used to determine the number of iterations for updating the plane parameters; the depth range is roughly estimated based on the actual height of the object, and the estimated interval length is slightly larger than the accurate interval length; the plane optimization stop threshold is used to constrain the number of focus plane optimizations;
[0079] Step 2.2: In Depth Range Internal Any pixel Assign a random depth value , get pixel The spatial coordinates of , and pixels Assign a random unit normal vector , thus obtaining pixels Initial focus plane .
[0080] Constructing the initial focus plane The equation expression is: ,in, , , express The three plane parameters of the focal plane are calculated using formula (13): , and :
[0081] (13)
[0082] Traverse all pixels and randomly generate an initial focus plane for each pixel, that is, each pixel has a set of corresponding focus plane parameters. The traditional stacked focus 3D reconstruction method is to calculate the focus value of the pixel in the order of the image sequence in a parallel window, and determine the depth by finding the peak position of the focus value. The method of the present invention replaces the focus position calculation with a plane search, and randomly assigns a depth value to each pixel within a set depth range. According to the law of large numbers and image continuity, there will always be some pixels assigned correct depth values within a certain depth range. Subsequent work needs to propagate these correct point-plane mapping relationships to the remaining pixels in an iterative manner until all pixels obtain depth values that match themselves.
[0083] Step 2.3: From the initial focus plane A fixed-scale three-dimensional space plane is drawn in the image and used as the focus evaluation window, so that the pixel is calculated in the focus evaluation window using equation (14). In the focal plane Focus rating on :
[0084] (14)
[0085] In formula (14), express Medium Pixels The image coordinates of Represents pixels In the focal plane The focusing function value on Indicates the focus weight value. The focus evaluation value is a quantitative indicator for judging the pixel clarity and is the basis for judging whether the current focus plane is the best focus plane.
[0086] (15)
[0087] In formula (15), Represents the grayscale focusing evaluation function. The present invention uses the Tenengrad operator, which is applicable to grayscale images. represents the color focus evaluation function. The present invention uses the color space focus evaluation function, which is applicable to RGB images. Represents pixels Neighborhood of express The scale of the focus evaluation window is consistent with the pixel is located in Neighborhood pixels within and Represents pixels and pixels A color vector in RGB color space, , , , , Respectively represent the color values of the three channels of red, green and blue. represents the natural exponential function, is an adjustable parameter; and has:
[0088] (16)
[0089] In formula (16), , and Respectively represent the gradient changes in the horizontal, vertical and diagonal directions, , and Respectively represent the gradient changes of color images on the RGB three channels, and their values are obtained by converting the RGB three-component images into grayscale images separately. Calculate and obtain:
[0090] (17)
[0091] In formula (17), Represents the grayscale value of the image.
[0092] Step 2.4: If Figure 4 As shown, Divide it into black and white checkerboards, where pixels are selected Several pixels around it with different chessboard colors, and one of them is recorded as The connected pixels , let the connected pixels The focal plane is ,judge Is it true? If so, set the pixel The focal plane Replace with , and update the pixel The focus evaluation value is , otherwise, remain unchanged, thus traversing all connected pixels and searching for the pixel Final matching focal plane The purpose of this step is to transfer the individually correct focus plane parameters in each depth distribution area to the remaining pixels in the same depth distribution area.
[0093] Step 2.5: Add a small perturbation to the focal plane Perform plane optimization to obtain a new focal plane :
[0094] Step 2.5.1: Pixel Depth value and the unit normal vector Set the maximum disturbance amount respectively and , will be located at Any random depth perturbation in the interval Assign depth value , thus obtaining Updated depth value And the updated spatial coordinates ;
[0095] Step 2.5.2: Place the Any random normal vector perturbation in the interval Assign unit normal vector , thus obtaining the updated unit normal vector , and by and Get the updated focus plane ,in, Indicates unitization.
[0096] Step 2.5.3: If If established, As a pixel The new focal plane will The initial setting is Half its length will Set to 1; otherwise, remain unchanged;
[0097] Step 2.5.4: If Less than When Plane optimization and get pixels New focal plane , otherwise, return to step 2.5.2 and execute sequentially.
[0098] Step 2.6: Follow the process of steps 2.4 and 2.5 to The same color of the chessboard pixels are optimized at the same time, thus completing All with Focus plane optimization for pixels of the same checkerboard color;
[0099] Step 2.7: Follow the process in step 2.6 to The checkerboard pixels with different colors are optimized at the same time to complete the The focus plane is optimized for pixels of another checkerboard color in .
[0100] Step 2.8: Continue to optimize according to the process of steps 2.4 to 2.6 until the maximum number of iterations is reached. So far, we get the pixel Final focal plane , and use The three plane parameters With vector After dot multiplication, we get Final depth information ; thus , ,…, ,…, The final depth information of all pixels in constitutes the initial depth map of the object being measured.
[0101] Step 3: Use the guide map to filter out the noise in the initial depth map and refine the depth information, thereby optimizing the initial depth map to obtain a smoothed depth map:
[0102] Step 3.1: Use equations (18) and (19) to obtain the pixel in the stacked image sequence: The guide curve and pixels in the stacked image sequence Focus evaluation curve :
[0103] (18)
[0104] (19)
[0105] In formula (18), Indicates that the pixel of the stacked image sequence is a grayscale image The guide curve, Indicates the pixel when the stacked image sequence is a color image The guide curve, Represents pixels In the stacked image sequence The gray value on Represents pixels In the stacked image sequence The color value on; In formula (19), Represents pixels In the stacked image sequence The focus evaluation value on has been obtained through step 2.3 and is:
[0106] (20)
[0107] (twenty one)
[0108] In formula (20), Represents pixels Field, pixels lie in middle, and Represents pixels and In the The color vector on the image, " represents the dot product operation; in formula (21), , , Represents the three-channel color values respectively.
[0109] Step 3.2: Calculate the pixel points using equation (22) The guide curve and focus evaluation curve Manhattan distance :
[0110] (twenty two)
[0111] In formula (22), In the figure, the spatial distance between two vectors is represented. Manhattan distance It represents the similarity between two curves based on spatial distance. The smaller the value, the higher the similarity.
[0112] Step 3.3: Calculate pixels Guide Curve and focus evaluation curve Pearson correlation coefficient :
[0113] (twenty three)
[0114] In formula (23), express and The covariance of and Respectively and The standard deviation of and Respectively represent the pixels when the stacked image sequence is a grayscale image and a color image The mean of the bootstrap curve, Represents pixels The mean value of the focusing evaluation curve, , indicates a completely positive correlation. Indicates a completely negative correlation, Pearson correlation coefficient It represents the similarity between two curves based on correlation. The larger the value, the higher the similarity.
[0115] Step 3.4: Calculate the pixel points using equations (24)-(26) Guide Curve and focus evaluation curve The modified remainder :
[0116] (twenty four)
[0117] (25)
[0118] (26)
[0119] In formula (24), Represents the guide curve The disturbance value of Represents the focus evaluation curve The disturbance value of .
[0120] Step 3.5: Calculate the pixel points using equation (27) Guide Curve and focus evaluation curve Similarity :
[0121] (27)
[0122] In formula (27), the greater the similarity, the closer the guidance value is to the focus evaluation value, and the more accurate the depth information of the pixel is. As the focus degree of the image sequence pixels changes, the grayscale (color value) curve shows a trend of first rising and then falling, which is similar to the change trend of the focus evaluation curve. If the pixel focus evaluation curve is more similar to the corresponding grayscale (color value) curve, the search for the best focus position of the pixel will be more accurate, and the depth estimation of the pixel will be more reliable. The weighted values of Manhattan distance and Pearson correlation coefficient are used to characterize the similarity, but when the noise has a greater impact on the pixel, it will cause the grayscale (color value) curve to oscillate violently. In this case, even if the focus evaluation curve has good unimodality and the depth estimation is correct, the similarity between the two curves will be reduced due to the abnormality of the grayscale curve, thereby reducing the similarity of the pixel, so a correction remainder needs to be added. Traverse all pixels, calculate the similarity of each pixel, and obtain the guidance map .
[0123] Step 3.6: Use formula (28) to correct the initial depth map, as follows: Figure 5 As shown, the final 3D reconstructed depth map is obtained :
[0124] (28)
[0125] In formula (28), and represents two linear correction parameters, and has:
[0126] (29)
[0127] (30)
[0128] In formulas (29) and (30), Indicates the depth map optimization area, which can be expanded to the entire image at most. express The total number of pixels in express The pixel position index in , Representation guide map Located in The pixel value at Represents the initial depth map at The pixel value at and Respectively represent the guide map and the initial depth map in The mean value in Representation guide map exist The pixel variance in is the normalization factor. The guide image contains some structural information that does not exist in the depth image. Guided filtering can transfer this structural information to the initial depth image to help improve the depth information in the initial depth image. Guided filtering is an algorithm that filters and outputs the input image based on the principle of local linear model and refers to the content of the guide image. It can fully utilize the details of the guide image changes while retaining the overall characteristics of the input image, making the structural similarity between the input image and the output image greater.
[0129] In this embodiment, an electronic device includes a memory and a processor, wherein the memory is used to store a program that supports the processor to execute the above method, and the processor is configured to execute the program stored in the memory.
[0130] In this embodiment, a computer-readable storage medium stores a computer program on the computer-readable storage medium, and the computer program executes the steps of the above method when executed by a processor.
Claims
1. A three-dimensional reconstruction method for the absolute depth of the surface of an object under microscope, characterized in that: It is applied to a scene consisting of an object to be measured, a stage, a stepper motor, a CDD camera, a microscope and a coaxial light source, and includes the following steps: Step 1: Collect a sequence of focused images of the surface of the object being measured , ,…, ,…, ,in, Indicates The surface image of the object being measured, Indicates the number of images; Step 2: Based on the stacked image sequence , ,…, ,…, , obtain the initial depth map of the surface of the object under test; Step 3: Use the guide map to filter out the noise in the initial depth map and refine the depth information, thereby optimizing the initial depth map to obtain a smoothed 3D reconstructed depth map. .
2. The three-dimensional reconstruction method of the absolute depth of the surface of an object under microscope according to claim 1, characterized in that: The step 1 comprises: Step 1.1: The object to be measured is placed on the stage, and the light emitted by the coaxial light source passes through the collimator to become a parallel light beam, and a part of the parallel light beam reflected at the beam splitter passes through the microscope objective lens and irradiates the object to be measured; Step 1.2: Determine the upper and lower limits of the stepper motor's movement along the Z axis: Gradually reduce the distance between the microscope objective and the object being measured until all pixels on the CDD camera are out of focus and blurred, thus setting the current distance as the lower limit of the Z axis. ; Gradually increase the distance between the microscope objective and the object to be measured until all pixels on the CDD camera change from clear to out-of-focus and blurred again, thereby setting the current distance as the upper limit of the Z axis. ; Step 1.3: According to the number of images to be collected, the displacement step length of the stepper motor is set so that the CCD camera moves from the lower limit of the Z axis to the upper limit of the Z axis according to the set displacement step length. Start by moving and scanning the surface of the object to be measured until the upper limit of the Z axis is reached. So as to acquire a set of overlapping focus image sequences of the same scene with different focusing degrees.
3. The three-dimensional reconstruction method of the absolute depth of the surface of the object under microscope according to claim 2, characterized in that: The step 2 comprises: Step 2.1: Set the maximum number of iterations to , the depth range is , the plane optimization stopping threshold is ; Step 2.2: In Depth Range Internal Any pixel Assign a random depth value , get pixel The spatial coordinates of , and pixels Assign a random unit normal vector , thus obtaining pixels Initial focus plane ; Constructing the initial focus plane The equation expression is: ,in, , , express 3 plane parameters of; Step 2.3: From the initial focus plane A fixed-scale three-dimensional space plane is drawn in the image and used as a focus evaluation window, so that the pixel value in the focus evaluation window is calculated using equation (1). In the focal plane Focus rating on : (1) In formula (1), express Medium Pixels The image coordinates of Represents pixels In the focal plane The focusing function value on Indicates the focus weight value; Step 2.4: Divide it into black and white checkerboards, where pixels are selected Several pixels around it with different chessboard colors, and one of them is recorded as The connected pixels , let the connected pixels The focal plane is ,judge Is it true? If so, set the pixel The focal plane Replace with , and update the pixel The focus evaluation value is , otherwise, remain unchanged, thus traversing all connected pixels and searching for the pixel Final matching focal plane ; Step 2.5: Add a small perturbation to the focal plane Perform plane optimization to obtain a new focal plane : Step 2.6: Follow the process of steps 2.4 and 2.5 to The pixels with the same color in the chessboard are updated and optimized at the same time, thus completing All with Focus plane optimization for pixels of the same checkerboard color; Step 2.7: Follow the process in step 2.6 to The pixels of different checkerboard colors are optimized for plane update at the same time, thus completing Focus plane optimization for pixels of another checkerboard color in ; Step 2.8: Continue to optimize according to the process of steps 2.4 to 2.6 until the maximum number of iterations is reached. So far, we get the pixel Final focal plane , and use The three plane parameters With vector After dot multiplication, we get Final depth information , thus , ,…, ,…, The final depth information of all pixels in constitutes the initial depth map of the object being measured.
4. The three-dimensional reconstruction method of the absolute depth of the surface of the object under microscope according to claim 3, characterized in that: The step 2.5 comprises: Step 2.5.1: Align pixels Depth value and the unit normal vector Set the maximum disturbance amount respectively and , will be located at Any random depth perturbation in the interval Assign depth value , thus obtaining Updated depth value And the updated spatial coordinates ; Step 2.5.2: Place the Any random normal vector perturbation in the interval Assign unit normal vector , thus obtaining the updated unit normal vector , and by and Get the updated focus plane ,in, Indicates unitization; Step 2.5.3: If If established, As a pixel The new focal plane and The initial setting is Half its length will Set to 1; otherwise, remain unchanged; Step 2.5.4: If Less than When Plane optimization and get pixels New focal plane , otherwise, return to step 2.5.2 and execute sequentially.
5. The three-dimensional reconstruction method of the absolute depth of the surface of the object under microscope according to claim 4, characterized in that: The step 3 comprises: Step 3.1: Use equations (2) and (3) to obtain the pixel in the stacked image sequence: The guide curve and pixels in the stacked image sequence Focus evaluation curve : (2) (3) In formula (2), Indicates that the pixel of the stacked image sequence is a grayscale image The guide curve, Indicates the pixel when the stacked image sequence is a color image The guide curve, Represents pixels In the stacked image sequence The gray value on Represents pixels In the stacked image sequence The color value on In formula (3), Represents pixels In the stacked image sequence Focus evaluation value on ; Step 3.2: Calculate the pixel using equation (4) The guide curve and focus evaluation curve Manhattan distance : (4) In formula (4), represents the spatial distance between two vectors; Step 3.3: Calculate the pixel using equation (5) The guide curve and focus evaluation curve Pearson correlation coefficient between : (5) In formula (5), express and The covariance of and Respectively and The standard deviation of and Respectively represent the pixels when the stacked image sequence is a grayscale image and a color image The mean of the bootstrap curve, Represents pixels The mean value of the focusing evaluation curve, ,like indicates a perfect positive correlation, if Indicates a perfect negative correlation; Step 3.4: Calculate pixel using equations (6)-(8) The guide curve and focus evaluation curve The correction residual between : (6) (7) (8) In formula (6), Represents the guide curve The disturbance value of Represents the focus evaluation curve The disturbance value of Step 3.5: Calculate the pixel using equation (9) The guide curve and focus evaluation curve The correlation between , thereby obtaining the correlation of each pixel and forming a guide map ; (9) Step 3.6: Use formula (10) to correct the initial depth map to obtain the final 3D reconstructed depth map : (10) In formula (10), and represents two linear correction parameters, and has: (11) (12) In formulas (11) and (12), represents the depth map optimization area, express The total number of pixels in express The pixel position index in , Representation guide map Located in The pixel value at Represents the initial depth map at The pixel value at and Respectively represent the guide map and the initial depth map in The mean value in Representation guide map exist The pixel variance in is the normalization factor.
6. An electronic device, comprising a memory and a processor, characterized in that: The memory is used to store a program that supports the processor to execute the three-dimensional reconstruction method according to any one of claims 1 to 5, and the processor is configured to execute the program stored in the memory.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the three-dimensional reconstruction method according to any one of claims 1 to 5 are executed.
Citation Information
Patent Citations
Method and system for acquiring focusing mapping surface of microscopic panoramic image
CN112381842A
Three-dimensional surface roughness calculation method for color reproduction
CN113421245A
Thoracic surgery teaching auxiliary system and method based on three-dimensional reconstruction
CN115565002A
Self-adaptive focusing evaluation method for turbine blade film hole microscopic optical measurement
CN116580395A
Human body identification method using range image camera and human body identification apparatus
US20120062749A1