A method for three-dimensional reconstruction of absolute depth of surface of an object under microscope

By focusing plane search and 3D spatial plane optimization, combined with guided curve filtering, the problem of insufficient accuracy of traditional superimposed focus 3D reconstruction methods on complex surfaces is solved, and high-precision microscopic 3D reconstruction is achieved.

CN119941996BActive Publication Date: 2025-11-11ANHUI UNIVERSITY OF ARCHITECTURE +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510074754.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-17
Publication Date
2025-11-11
Estimated Expiration
2045-01-17

AI Technical Summary

Technical Problem

Traditional superimposed focus 3D reconstruction methods suffer from insufficient accuracy and large errors when measuring complex surfaces, especially on inclined or irregular surfaces, resulting in inaccurate reconstruction results.

Method used

A new algorithm framework for stacked-focus microscopy 3D reconstruction is constructed by replacing peak calculation with focus plane search, using 3D spatial plane optimization for focus evaluation, and combining guide curve and Pearson correlation coefficient filtering to optimize the initial depth map.

Benefits of technology

It improves the accuracy and completeness of measurements, especially achieving high-precision three-dimensional reconstruction on complex morphological microscopic samples, and enhances anti-interference and universality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119941996B_ABST
    Figure CN119941996B_ABST
Patent Text Reader

Abstract

This invention discloses a three-dimensional reconstruction method for the absolute depth of the surface of a measured object under a microscope, comprising: 1. constructing a superimposed image sequence acquisition system and scanning along the optical axis to acquire a sequence of superimposed microscopic images of the object under test; 2. judging the sharpness of the pixels in the image sequence in a three-dimensional focus evaluation window, and using a focus plane search and mapping method to find the optimal focus plane for each pixel, extracting depth values, and obtaining an initial depth map of the surface of the measured object; 3. obtaining a guide curve based on the changes in image pixel values, calculating the Manhattan distance and Pearson correlation coefficient between the guide curve and the focus evaluation curve, and combining them into a correlation coefficient, thereby using the correlation coefficient to construct a guide map to filter the initial depth map, making it more accurate and smooth, and obtaining the final three-dimensional reconstructed depth map. This invention can accurately obtain the absolute depth of the surface of a measured object under a microscope, achieve accurate restoration of complex surface morphology, and has good accuracy, anti-interference, and universality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing, specifically a high-precision three-dimensional reconstruction method for the absolute depth of the surface of a measured object under a microscope. Background Technology

[0002] With advancements in computer vision, deep learning, and sensor technology, 3D reconstruction has become more efficient and accurate, providing strong support for interdisciplinary collaboration and practical applications. 3D reconstruction is a technique that converts 2D data into 3D models for the digital representation of the real world. It is widely used in industrial design, medical imaging, virtual reality, cultural relic preservation, precision measurement, and autonomous driving. Overlay microscopy 3D reconstruction utilizes a small depth-of-field imaging system to continuously acquire a series of overlay images perpendicular to the surface of the object being measured, considering the degree of focus, surface morphology, and acquisition distance. A focus evaluation function is used to assess the focus degree of all corresponding pixels. Finally, a peak search method is used to locate the focus position, and the surface depth information of the object is recovered by combining the displacement information acquired during acquisition. As a non-contact 3D measurement method, overlay microscopy 3D reconstruction has advantages such as small size, low cost, convenient installation, and high measurement efficiency, and has broad application prospects.

[0003] Traditional overlay 3D reconstruction methods follow the sequence of overlay images, using a specific focus evaluation function to evaluate the focus of each image, obtaining discrete focus evaluation values. These values ​​are then interpolated and fitted to create a focus evaluation curve. The depth of a pixel is estimated from the peak position of the curve, which introduces significant errors. Furthermore, in actual measurements, due to the tilt or irregular surface of the object being measured, using a fixed parallel window for focus evaluation ignores the influence of surface parallax, leading to inaccurate judgments of focus degree and greatly reducing the accuracy and effectiveness of the reconstruction. Summary of the Invention

[0004] This invention optimizes and improves existing superimposed focus 3D reconstruction technology, proposing a 3D reconstruction method for the absolute depth of the surface of a measured object under a microscope. The aim is to improve measurement accuracy and obtain complete information, and to achieve a high-precision 3D reconstruction effect for obtaining the absolute depth of the surface of the measured object, thereby obtaining more accurate information about the depth of the object's surface.

[0005] To achieve the above objectives, the present invention adopts the following technical solution:

[0006] The present invention provides a three-dimensional reconstruction method for the absolute depth of the surface of a measured object under a microscope. The method is characterized by its application in a scene consisting of the object under test, a stage, a stepper motor, a CDD camera, a microscope, and a coaxial light source, and includes the following steps:

[0007] Step 1: Acquire a series of superimposed images of the surface of the object being tested. , ,…, ,…, ,in, Indicates the first A surface image of the object being tested. Indicates the number of images;

[0008] Step 2: Based on the superimposed image sequence , ,…, ,…, To obtain the initial depth map of the surface of the object being measured;

[0009] Step 3: Use a guide map to filter out noise in the initial depth map and refine the depth information, thereby optimizing the initial depth map and obtaining a smoothed 3D reconstructed depth map. .

[0010] The three-dimensional reconstruction method for the absolute depth of the surface of an object under a microscope as described in this invention is characterized in that step 1 includes:

[0011] Step 1.1: Place the object to be tested on the stage. The light emitted by the coaxial light source becomes a parallel beam after passing through the collimating lens. A portion of the parallel beam reflected at the beam splitter shines on the object to be tested through the microscope objective.

[0012] Step 1.2: Determine the upper and lower limits of the stepper motor's movement along the Z-axis:

[0013] Gradually decrease the distance between the microscope objective and the object under test 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 under test until all pixels on the CDD camera change from sharp to out-of-focus and blurred again, thus setting the current distance as the upper limit of the Z-axis. ;

[0015] Step 1.3: Based on the number of images to be acquired, set the displacement step size of the stepper motor so that the CCD camera moves from the lower limit of the Z-axis at the set displacement step size. Initially, the surface of the object being measured is continuously scanned until the upper limit of the Z-axis is reached. This allows for the acquisition of a sequence of superimposed images of the same scene with different degrees of focus.

[0016] Furthermore, step 2 includes:

[0017] Step 2.1: Set the maximum number of iterations to [value]. Depth range is The stopping threshold for planar optimization is ;

[0018] Step 2.2: Within the depth range Inside any pixel Assign a random depth value , obtain pixels spatial coordinates and for pixels Assign a random unit normal vector Thus obtaining pixels initial focal plane ;

[0019] Construct the initial focusing plane The equation expression is: ,in, , , express The three plane parameters;

[0020] Step 2.3: From the initial focus plane A fixed-scale three-dimensional spatial plane is drawn out and used as a focus evaluation window, so that the pixels are calculated within the focus evaluation window using equation (1). At the focal plane Focused evaluation value :

[0021] (1)

[0022] In equation (1), express Medium pixel Image coordinates, Represents pixels At the focal plane The focusing function value on, Indicates the focus weight value;

[0023] Step 2.4: Divide the area into alternating black and white checkerboard patterns, where pixels are selected. Several pixels surrounding it that are different in color from the checkerboard squares, and one of these pixels is denoted as . Associated pixels Let contiguous pixels The focal plane is ,judge Is it true? If true, then set the pixel... focal plane Replace with and update pixels The focus evaluation value Otherwise, remain unchanged, thus traversing all associated pixels and searching for the pixel... Final matching focal plane ;

[0024] Step 2.5: For Adding small perturbations to the focal plane Perform planar optimization to obtain a new focusing plane. :

[0025] Step 2.6: Follow the procedures in Steps 2.4 and 2.5 to... Pixels with the same color as the checkerboard pattern are simultaneously updated and optimized in a planar manner, thus completing... All of the above Optimize the focal plane of pixels with the same checkerboard color;

[0026] Step 2.7: Following the process in Step 2.6, for... The pixels with different colors on the checkerboard pattern are simultaneously updated and optimized in a planar manner to complete the process. Optimize the focal plane of pixels with another checkerboard color;

[0027] Step 2.8: Continuously optimize according to the process of Steps 2.4-2.6 until the maximum number of iterations is reached. Until then, pixels are obtained. Final focal plane and utilize 3 plane parameters with vector After dot product, we get Final depth information Thus by , ,…, ,…, The final depth information of all pixels constitutes the initial depth map of the object being measured.

[0028] Furthermore, step 2.5 includes:

[0029] Step 2.5.1: For pixels depth value and unit normal vector Set the maximum disturbance amount respectively and , will be located Any random depth disturbance within the interval Assign depth value Thus obtain Updated depth value and the updated spatial coordinates ;

[0030] Step 2.5.2: Place the located Perturbation of any random normal vector within the interval Assign a unit normal vector Thus, the updated unit normal vector is obtained. , and by and Obtain the updated focal plane ,in, Indicates normalization;

[0031] Step 2.5.3: If If established, then As pixels The new focal plane, and will Initially set to Half of its length will Set to 1; otherwise, leave unchanged.

[0032] Step 2.5.4: If Less than At that time, stop focusing on the focal plane. Planar optimization and obtaining pixels New focal plane Otherwise, return to step 2.5.2 and execute sequentially;

[0033] Furthermore, step 3 includes:

[0034] Step 3.1: Use equations (2) and (3) to obtain the pixels in the superimposed image sequence. The guiding curve pixels in a superimposed image sequence Focused evaluation curve :

[0035] (2)

[0036] (3)

[0037] In equation (2), This represents the number of pixels when the image sequence is a grayscale image. The leading curve, This indicates the number of pixels when the image sequence is a color image. The leading curve, Represents pixels In a sequence of superimposed images grayscale values ​​on Represents pixels In a sequence of superimposed images The color value on;

[0038] In equation (3), Represents pixels In a sequence of superimposed images Focused evaluation value;

[0039] Step 3.2: Calculate pixels using equation (4) The guiding curve and focus evaluation curve Manhattan distance :

[0040] (4)

[0041] In equation (4), The space between the two vectors is represented by the symbol 'm'.

[0042] Step 3.3: Calculate pixels using equation (5) The guiding curve and focus evaluation curve Pearson correlation coefficient between :

[0043] (5)

[0044] In equation (5), express and covariance, and They represent and standard deviation and These represent the pixels when the overlaid image sequence is a grayscale image and a color image, respectively. The mean of the leading curve, Represents pixels The mean of the focused evaluation curve, ,like Indicates a perfect positive correlation, if This indicates a completely negative correlation;

[0045] Step 3.4: Calculate pixels using equations (6)-(8) The guiding curve and focus evaluation curve The remaining term between the correction terms :

[0046] (6)

[0047] (7)

[0048] (8)

[0049] In equation (6), Indicating the guiding curve The disturbance value, Indicates the focus evaluation curve The disturbance value;

[0050] Step 3.5: Calculate pixels using equation (9) The guiding curve and focus evaluation curve correlation between This allows us to obtain the relevance of each pixel and construct a guide map. ;

[0051] (9)

[0052] Step 3.6: Correct the initial depth map using equation (10) to obtain the final 3D reconstructed depth map. :

[0053] (10)

[0054] In equation (10), and Let represent two linear correction parameters, and we have:

[0055] (11)

[0056] (12)

[0057] In equations (11) and (12), This indicates the region for depth map optimization. express The total number of pixels in express Pixel position index in Indicating a guide diagram In the middle Pixel value at that location, Indicates the location in the initial depth map Pixel value at that location, and These represent the guide map and the initial depth map, respectively. The mean of the middle, Indicating a guide diagram exist Pixel variance in This is the normalization factor.

[0058] The present invention provides an electronic device, including a memory and a processor, wherein the memory is used to store a program that supports the processor in executing the three-dimensional reconstruction method, and the processor is configured to execute the program stored in the memory.

[0059] The present invention discloses a computer-readable storage medium on which a computer program is stored, wherein the computer program is executed by a processor to perform the steps of the three-dimensional reconstruction method.

[0060] Compared with the prior art, the beneficial effects of the present invention are reflected in:

[0061] 1. This invention proposes to replace the calculation of the focal peak with a focal plane search, and constructs a new algorithm framework for superimposed focal microscopy 3D reconstruction. This avoids the inherent error of the peak search in the traditional superimposed focal microscopy 3D reconstruction method to the greatest extent, improves the accuracy of the overall depth estimation, and thus ensures that the reconstructed surface structure of the measured object is more complete.

[0062] 2. This invention proposes to use a three-dimensional spatial plane to replace the parallel window to optimize the focusing evaluation process, thereby eliminating the parallax effect caused by the parallel window and improving the reconstruction effect of curved or tilted surfaces, thus realizing high-precision three-dimensional reconstruction of microscopic samples with complex morphology.

[0063] 3. This invention uses the change of pixel grayscale value (color value) as a guide curve, calculates the Manhattan distance and Pearson correlation coefficient between the guide curve and the focus evaluation curve, and performs guide 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. When applied to microscopy, it can greatly improve the reconstruction effect and measurement accuracy. Attached Figure Description

[0064] Figure 1 This is a schematic diagram illustrating the principle of obtaining the surface depth of the object being measured according to the present invention.

[0065] Figure 2 This is a flowchart of the process for acquiring a sequence of superimposed images according to the present invention;

[0066] Figure 3 This is a sample image of a 1 mm high stepped superimposed image sequence processed by the present invention;

[0067] Figure 4 This is a diagram showing the division of the black and white checkerboard grid in this invention;

[0068] Figure 5These are depth maps before and after optimization according to the present invention. Detailed Implementation

[0069] In this embodiment, a three-dimensional reconstruction method for the absolute depth of the surface of an object under a microscope is described in the following principle and process: Figure 1 As shown, it is applied to a scene consisting of the object under test, a stage, a stepper motor, a CDD camera, a microscope, and a coaxial light source, as shown in the image. Figure 2 As shown, it includes the following steps:

[0070] Step 1: Acquire a sequence of superimposed images of the surface of the object under test using a microscopic imaging system. , ,…, , ..., The number of images is roughly between 40 and 100. These image sequences are characterized by the same field of view, the same resolution, but different levels of focus. They can be grayscale images or color images, and step-like images are examples. 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 collimating lens. A portion of the beam is reflected at the beam splitter and passes through the microscope objective to illuminate the object to be measured. An auxiliary light source can be added to ensure that the object in the field of view is visible.

[0072] Step 1.2: Determine the upper and lower limits of the high-precision displacement system's movement along the Z-axis:

[0073] Gradually decrease the distance between the microscope objective and the object under test 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 under test until all pixels on the CDD camera change from sharp to out-of-focus and blurred again, thus setting the current distance as the upper limit of the Z-axis. ;

[0075] During the displacement process, as long as one of the stage and the microscope objective moves, the other remains stationary.

[0076] Step 1.3: Based on the number of images to be acquired, set the displacement step size of the stepper motor so that the CCD camera moves from the lower limit of the Z-axis at the set displacement step size. Initially, the surface of the object under test is continuously scanned by moving the scanner. An image is acquired for each step of movement, until the upper limit of the Z-axis is reached. Thus, a series of superimposed images of the same scene with different degrees of focus were acquired. The content in the images, in sequence, is a process of defocusing to focusing and then defocusing again.

[0077] Step 2: Based on the superimposed image sequence , ,…, ,…, Obtain the initial depth map of the surface of the object being measured:

[0078] Step 2.1: Set the maximum number of iterations Depth range Planar optimization stopping threshold The maximum number of iterations determines the number of iterations for updating the plane parameters; the depth range is roughly estimated based on the actual height of the object, and its estimated interval length is slightly larger than the accurate interval length; the plane optimization stopping threshold is used to constrain the number of optimization iterations for the focusing plane;

[0079] Step 2.2: Within the depth range Inside any pixel Assign a random depth value , obtain pixels spatial coordinates and for pixels Assign a random unit normal vector Thus obtaining pixels initial focal plane .

[0080] Construct the initial focusing plane The equation expression is: ,in, , , express The focusing plane parameters are calculated using equation (13) based on the three plane parameters. , and :

[0081] (13)

[0082] The algorithm iterates through all pixels and randomly generates an initial focus plane for each pixel, meaning each pixel has a corresponding set of focus plane parameters. Traditional stacked-focus 3D reconstruction methods calculate pixel focus values ​​sequentially within a parallel window, determining depth by finding the peak position of the focus value. This invention replaces focus position calculation with plane search. Within a set depth range, each pixel is randomly assigned a depth value. Based on the law of large numbers and image continuity, some pixels within a certain depth range will always be assigned the correct depth value. Subsequent work involves iteratively propagating the mapping relationship between these correct points and the plane to the remaining pixels until all pixels obtain a depth value matching their own.

[0083] Step 2.3: From the initial focus plane A fixed-scale three-dimensional spatial plane is drawn out and used as a focus evaluation window, so that the pixels are calculated within the focus evaluation window using equation (14). At the focal plane Focused evaluation value :

[0084] (14)

[0085] In equation (14), express Medium pixel Image coordinates, Represents pixels At the focal plane The focusing function value on, This represents the focus weight value. The focus evaluation value is a quantitative indicator for judging the sharpness of pixels and is the basis for judging whether the current focus plane is the optimal focus plane.

[0086] (15)

[0087] In equation (15), This invention uses the Tenengrad operator to represent the grayscale focus evaluation function, which is suitable for grayscale images. This invention uses a color space focus evaluation function, suitable for RGB images, to represent the color focus evaluation function. Represents pixels The neighborhood, express The scale, its size and focus evaluation window are consistent, pixels It is located in Neighboring pixels within, and Representing pixels and pixels Color vectors in the RGB color space , , , , These represent the color values ​​of the red, green, and blue channels, respectively. This represents the natural exponential function. It is an adjustable parameter; and has:

[0088] (16)

[0089] In equation (16), , and These represent the gradient changes in the horizontal, vertical, and diagonal directions, respectively. , and These represent the gradient changes of the color image in the RGB channels, respectively. Their values ​​are obtained by converting the RGB three-component image into grayscale images separately. Calculated and obtained; and have:

[0090] (17)

[0091] In equation (17), This represents the grayscale value of the image.

[0092] Step 2.4: As Figure 4 As shown, Divide the area into alternating black and white checkerboard patterns, where pixels are selected. Several pixels surrounding it that are different in color from the checkerboard squares, and one of these pixels is denoted as . Associated pixels Let contiguous pixels The focal plane is ,judge Is it true? If true, then set the pixel... focal plane Replace with and update pixels The focus evaluation value Otherwise, remain unchanged, thus traversing all associated pixels and searching for the pixel... Final matching focal plane The purpose of this step is to transfer the individual correct focus plane parameters from each depth distribution region to the remaining pixels in the same depth distribution region.

[0093] Step 2.5: For Adding small perturbations to the focal plane Perform planar optimization to obtain a new focusing plane. :

[0094] Step 2.5.1: For pixels depth value and unit normal vector Set the maximum disturbance amount respectively and , will be located Any random depth disturbance within the interval Assign depth value Thus obtain Updated depth value and the updated spatial coordinates ;

[0095] Step 2.5.2: Place the located Perturbation of any random normal vector within the interval Assign a unit normal vector Thus, the updated unit normal vector is obtained. , and by and Obtain the updated focal plane ,in, This indicates unitization.

[0096] Step 2.5.3: If If established, then As pixels The new focal plane will Initially set to Half of its length will Set to 1; otherwise, leave unchanged.

[0097] Step 2.5.4: If Less than At that time, stop focusing on the focal plane. Planar optimization and obtaining pixels New focal plane Otherwise, return to step 2.5.2 and execute sequentially.

[0098] Step 2.6: Follow the procedures in Steps 2.4 and 2.5 to... Pixels of the same color in the checkerboard pattern are simultaneously optimized for planar representation, thus completing... All of the above Optimize the focal plane of pixels with the same checkerboard color;

[0099] Step 2.7: Following the process in Step 2.6, for... The pixels of different colors on the checkerboard pattern are simultaneously optimized for planar representation, thus completing... Optimize the focal plane of pixels with another checkerboard color.

[0100] Step 2.8: Continuously optimize according to the process of Steps 2.4-2.6 until the maximum number of iterations is reached. Until then, pixels are obtained. Final focal plane and utilize 3 plane parameters with vector After dot product, we get Final depth information ; and thus by , ,…, ,…, The final depth information of all pixels constitutes the initial depth map of the object being measured.

[0101] Step 3: Use a guide map to filter out noise in the initial depth map and refine the depth information, thereby optimizing the initial depth map and obtaining a smoothed depth map:

[0102] Step 3.1: Use equations (18) and (19) to obtain the pixels in the superimposed image sequence. The guiding curve pixels in a superimposed image sequence Focused evaluation curve :

[0103] (18)

[0104] (19)

[0105] In equation (18), This represents the number of pixels when the image sequence is a grayscale image. The leading curve, This indicates the number of pixels when the image sequence is a color image. The leading curve, Represents pixels In a sequence of superimposed images grayscale values ​​on Represents pixels In a sequence of superimposed images The color value on; in formula (19), Represents pixels In a sequence of superimposed images The focus evaluation value, obtained through step 2.3, is as follows:

[0106] (20)

[0107] (twenty one)

[0108] In equation (20), Represents pixels In the field, pixels lie in middle, and Representing pixels and In the The color vector on the image, "In the formula, dot product operation is represented; in formula (21)," , , These represent the three color channel values, respectively.

[0109] Step 3.2: Calculate the pixel points using equation (22) The guiding curve and focus evaluation curve Manhattan distance :

[0110] (twenty two)

[0111] In equation (22), The symbol represents the spatial distance between two vectors. Manhattan distance. It is based on spatial distance to characterize the similarity between two curves; 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 equation (23), express and covariance, and They represent and standard deviation and These represent the pixels when the overlaid image sequence is a grayscale image and a color image, respectively. The mean of the leading curve, Represents pixels The mean of the focused evaluation curve, , Indicates a perfect positive correlation. Indicates a perfect negative correlation; Pearson correlation coefficient It is based on the correlation to characterize the similarity between two curves; 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 Correction remainder :

[0116] (twenty four)

[0117] (25)

[0118] (26)

[0119] In equation (24), Indicating the guiding curve The disturbance value, Indicates the focus evaluation curve The disturbance value.

[0120] Step 3.5: Calculate the pixel points using equation (27) Guide curve and focus evaluation curve similarity :

[0121] (27)

[0122] In equation (27), the greater the similarity, the closer the guiding value is to the focus evaluation value, and the more accurate the depth information of the pixel. As the focus of the pixels in the image sequence changes, the grayscale (color value) curve shows a trend of first rising and then falling, which is somewhat similar to the 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 value of Manhattan distance and Pearson correlation coefficient is used to characterize the similarity, but when noise has a large 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 decrease due to the abnormality of the grayscale curve, thus reducing the similarity of the pixel. Therefore, a correction term needs to be added. Traverse all pixels, calculate the similarity of each pixel, and obtain the guiding image. .

[0123] Step 3.6: Correct the initial depth map using equation (28), such as... Figure 5 As shown, the final 3D reconstructed depth map is obtained. :

[0124] (28)

[0125] In equation (28), and Let represent two linear correction parameters, and we have:

[0126] (29)

[0127] (30)

[0128] In equations (29) and (30), This indicates the depth map optimization area, which can be expanded to the entire map. express The total number of pixels in express Pixel position index in Indicating a guide diagram In the middle Pixel value at that location, Indicates the location in the initial depth map Pixel value at that location, and These represent the guide map and the initial depth map, respectively. The mean of the middle, Indicating a guide diagram exist Pixel variance in This is the normalization factor. The guiding image contains structural information not found in the initial depth image. Guided filtering can transfer this structural information to the initial depth image, helping to improve the depth information in the initial depth image. Guided filtering is an algorithm that filters the input image based on the principle of local linear models, referencing the content of the guiding image. It can fully utilize the details of changes in the guiding image while preserving the overall features of the input image, making the structural similarity between the input and output images greater.

[0129] In this embodiment, an electronic device includes a memory and a processor. The memory stores a program that supports the processor in executing the above-described 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, which is executed by a processor to perform the steps of the above method.

Claims

1. A three-dimensional reconstruction method for the absolute depth of the surface of an object under a microscope, characterized in that, It is applied to a scene consisting of the object under test, a stage, a stepper motor, a CCD camera, a microscope objective, and a coaxial light source, and includes the following steps: Step 1: Acquire a series of superimposed images of the surface of the object being tested. , ,…, ,…, ,in, Indicates the first A surface image of the object being tested. Indicates the number of images; Step 2: Based on the superimposed image sequence , ,…, ,…, To obtain the initial depth map of the surface of the object being measured; Step 2.1: Set the maximum number of iterations to [value]. Depth range is The stopping threshold for planar optimization is ; Step 2.2: Within the depth range Inside any pixel Assign a random depth value , obtain pixels spatial coordinates and for pixels Assign a random unit normal vector Thus obtaining pixels initial focal plane ; Construct the initial focusing plane The equation expression is: ,in, , , express The three plane parameters; Step 2.3: From the initial focus plane A fixed-scale three-dimensional spatial plane is drawn out and used as a focus evaluation window, so that the pixels are calculated within the focus evaluation window using equation (1). At the focal plane Focused evaluation value : (1) In equation (1), express medium pixel Image coordinates, Represents pixels At the focal plane The focusing function value on, Indicates the focus weight value; Step 2.4: Divide the area into alternating black and white checkerboard patterns, where pixels are selected. Several pixels surrounding it that are different in color from the checkerboard squares, and one of these pixels is denoted as . Associated pixels Let contiguous pixels The focal plane is ,judge Is it true? If true, then set the pixel... focal plane Replace with and update pixels The focus evaluation value Otherwise, remain unchanged, thus traversing all associated pixels and searching for the pixel... Final matching focal plane ; Step 2.5: For Adding small perturbations to the focal plane Perform planar optimization to obtain a new focusing plane. : Step 2.6: Follow the procedures in Steps 2.4 and 2.5 to... Pixels with the same color as the checkerboard pattern are simultaneously updated and optimized in a planar manner, thus completing the process. All of the above Optimize the focal plane of pixels with the same checkerboard color; Step 2.7: Following the process in Step 2.6, for... The pixels with different colors on the checkerboard pattern are simultaneously updated and optimized in a planar manner to complete the process. Optimize the focal plane of pixels with another checkerboard color; Step 2.8: Continuously optimize according to the process of Steps 2.4-2.6 until the maximum number of iterations is reached. Until then, pixels are obtained. Final focal plane and utilize 3 plane parameters with vector After dot product, we get Final depth information Thus by , ,…, ,…, The final depth information of all pixels constitutes the initial depth map of the object being measured. Step 3: Use a guide map to filter out noise in the initial depth map and refine the depth information, thereby optimizing the initial depth map and obtaining a smoothed 3D reconstructed depth map. .

2. The three-dimensional reconstruction method for the absolute depth of the surface of a measured object under a microscope according to claim 1, characterized in that: Step 1 includes: Step 1.1: Place the object to be tested on the stage. The light emitted by the coaxial light source becomes a parallel beam after passing through the collimating lens. A portion of the parallel beam reflected at the beam splitter shines on the object to be tested through the microscope objective. Step 1.2: Determine the upper and lower limits of the stepper motor's movement along the Z-axis: Gradually decrease the distance between the microscope objective and the object being measured until all pixels on the CCD 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 being measured until all pixels on the CCD camera change from sharp to out-of-focus and blurred again, thus setting the current distance as the upper limit of the Z-axis. ; Step 1.3: Based on the number of images to be acquired, set the displacement step size of the stepper motor so that the CCD camera moves from the lower limit of the Z-axis at the set displacement step size. Initially, the surface of the object being measured is continuously scanned until the upper limit of the Z-axis is reached. This allows for the acquisition of a sequence of superimposed images of the same scene with different degrees of focus.

3. The three-dimensional reconstruction method for the absolute depth of the surface of a measured object under a microscope according to claim 2, characterized in that: Step 2.5 includes: Step 2.5.1: For pixels depth value and unit normal vector Set the maximum disturbance amount respectively and , will be located Any random depth disturbance within the interval Assign depth value Thus obtain Updated depth value and the updated spatial coordinates ; Step 2.5.2: Place the located Perturbation of any random normal vector within the interval Assign a unit normal vector Thus, the updated unit normal vector is obtained. , and by and Obtain the updated focal plane ,in, Indicates normalization; Step 2.5.3: If If established, then As pixels The new focal plane, and will Initially set to Half of its length will Set to 1; otherwise, leave unchanged. Step 2.5.4: If Less than At that time, stop focusing on the focal plane. Planar optimization and obtaining pixels New focal plane Otherwise, return to step 2.5.2 and execute sequentially.

4. The three-dimensional reconstruction method for the absolute depth of the surface of a measured object under a microscope according to claim 3, characterized in that: Step 3 includes: Step 3.1: Use equations (2) and (3) to obtain the pixels in the superimposed image sequence. The guiding curve pixels in a superimposed image sequence Focused evaluation curve : (2) (3) In equation (2), Represents the pixels when the overlaid image sequence is a grayscale image. The leading curve, This indicates the number of pixels when the image sequence is a color image. The leading curve, Represents pixels In a sequence of superimposed images grayscale values ​​on Represents pixels In a sequence of superimposed images The color value on; In equation (3), Represents pixels In a sequence of superimposed images Focused evaluation value; Step 3.2: Calculate pixels using equation (4) The guiding curve and focus evaluation curve Manhattan distance : (4) In equation (4), The space between the two vectors is represented by the symbol 'm'. Step 3.3: Calculate pixels using equation (5) The guiding curve and focus evaluation curve Pearson correlation coefficient between : (5) In equation (5), express and covariance, and They represent and standard deviation and These represent the pixels when the overlaid image sequence is a grayscale image and a color image, respectively. The mean of the leading curve, Represents pixels The mean of the focused evaluation curve, ,like Indicates a perfect positive correlation, if This indicates a completely negative correlation; Step 3.4: Calculate pixels using equations (6)-(8) The guiding curve and focus evaluation curve The remaining term between the correction terms : (6) (7) (8) In equation (6), Indicating the guiding curve The disturbance value, Indicates the focus evaluation curve The disturbance value; Step 3.5: Calculate pixels using equation (9) The guiding curve and focus evaluation curve correlation between This allows us to obtain the relevance of each pixel and construct a guide map. ; (9) Step 3.6: Correct the initial depth map using equation (10) to obtain the final 3D reconstructed depth map. : (10) In equation (10), and Let represent two linear correction parameters, and we have: (11) (12) In equations (11) and (12), This indicates the region for depth map optimization. express The total number of pixels in express Pixel position index in Represents a guide diagram In Pixel value at that location, Indicates the location in the initial depth map Pixel value at that location, and These represent the guiding map and the initial depth map, respectively. The mean of the middle, Represents a guide diagram exist Pixel variance in This is the normalization factor.

5. An electronic device, comprising a memory and a processor, characterized in that, The memory is used to store programs that support the processor in executing any of the three-dimensional reconstruction methods of claims 1-4, and the processor is configured to execute the programs stored in the memory.

6. A computer-readable storage medium storing a computer program thereon, characterized in that, The computer program, when run by a processor, performs the steps of any of the three-dimensional reconstruction methods described in claims 1-4.