d-to-f ranging module, edge mask calibration method thereof, electronic device and medium

By generating a grayscale image of the mask by photographing a standard whiteboard, the edge mask of the dToF ranging module is optimized, solving the problem of invalid edge areas caused by cover plate occlusion and lens vignetting. This achieves adaptive mask calibration and improves the accuracy and flexibility of edge recognition.

CN122815446BActive Publication Date: 2026-11-06上海芯源创新中心 +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611312031.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-08-27
Publication Date
2026-11-06
Estimated Expiration
2046-08-27

AI Technical Summary

Technical Problem

When outputting depth maps and point clouds, dToF ranging modules result in invalid image edges due to cover plate occlusion and lens vignetting. Existing technologies require hardware design modifications and lack flexibility or rely on fixed coordinates, making them unable to adapt to production assembly tolerances and optical differences.

Method used

A grayscale image of the mask is generated by photographing a standard whiteboard. Dark corner areas are determined using intensity thresholding and morphological processing. The boundary curvature is calculated to optimize the mask, and adaptive optimal edge mask calibration parameters are generated and stored in the module memory.

Benefits of technology

It adapts to the cover plate assembly offset and lens distortion of different modules, generates the optimal mask, avoids the influence of depth accuracy and noise, supports dynamic updates, and improves the accuracy of edge area recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122815446B_ABST
    Figure CN122815446B_ABST
Patent Text Reader

Abstract

The application provides a dToF ranging module and an edge mask calibration method thereof, an electronic device and a medium. The method automatically generates an edge mask in a calibration stage only by using an intensity map output by the dToF module itself, is not affected by depth precision and noise, and has a signal-to-noise ratio of the intensity map itself far higher than that of a depth map, avoids misjudgment of a real object at an edge, and is more accurate in identifying relative depth information. The edge mask is calibrated based on an intensity map actually measured by each dToF module, and an optimal mask effect diagram is generated for problems such as assembly offset of a cover plate of different modules, lens distortion difference, and batch process fluctuation. If a hardware or algorithm scheme is changed, the calibrated module does not need to be changed, and even when the light intensity distribution of the cover plate or the lens of the module changes, the module only needs to be recalibrated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of optical sensing technology, and relates to a dToF ranging module and its edge mask calibration method, electronic equipment and medium. Background Technology

[0002] A direct time-of-flight (dToF) ranging module is a 3D depth sensing sensor that calculates distance based on measuring the flight time of light pulses. Its working principle is as follows: a vertical-cavity surface-emitting laser (VCSEL) emits laser pulses towards the target, and a single-photon avalanche diode (SPAD) array receives the echo photons. A time-to-digital converter (TDC) then records the number of photons and accumulates them to create a histogram, thus obtaining the flight time and distance information.

[0003] In actual products, the outermost layer of the dToF ranging module has a glass cover to protect the VCSEL's optical lens, preventing dust, raindrops, dirt, etc., from affecting the ranging. However, these structures can cause the following problems at the edge of the field of view:

[0004] 1) Cover plate blocking: The edge of the cover plate or the silkscreen area directly blocks part of the incident light.

[0005] 2) Lens vignetting: Light attenuation at the edge of the lens causes the intensity of edge pixels to be significantly lower than that in the center area.

[0006] 3) Packaging structure interference: The lens internal bracket, glue, etc. partially block the edge optical path.

[0007] The aforementioned issues result in low signal-to-noise ratio and poor accuracy of depth data in edge regions. If depth maps or point clouds are directly output, a large amount of noise or incorrect depth values ​​will be generated around the image, severely impacting user experience and the performance of subsequent algorithms.

[0008] The solutions employed in existing technologies mainly include:

[0009] 1) Fixed mask position in hardware: During the chip design stage, the enable signal state of a single pixel or the corresponding flag bit needs to be considered. This solution is simple and reliable, but it cannot adapt to production assembly tolerances and is fixed once produced, lacking flexibility.

[0010] 2) Software-fixed cropping position: The coordinate range is preset by the algorithm or a fixed area is cropped directly. This method also relies on fixed coordinates and cannot compensate for optical differences between different modules. Furthermore, if the lens or cover plate is replaced in batches, it needs to be reset.

[0011] 3) Edge detection based on depth map: This method uses depth discontinuity to determine boundaries, which requires high module accuracy, is prone to misclassifying real object edges as invalid regions, and involves a large amount of computation. Summary of the Invention

[0012] This application provides a dToF ranging module and its edge mask calibration method, electronic device and medium, to solve the problem that existing dToF ranging modules, when outputting depth maps and point clouds, usually require hardware design modifications and the development of complex mask algorithms for invalid image edge areas caused by cover plate occlusion, lens vignetting, etc., which consumes a lot of time and manpower.

[0013] In a first aspect, this application provides an edge mask calibration method for a dToF ranging module, comprising: S101: taking a picture of the dToF ranging module facing a standard white board; wherein the standard white board covers the field of view of the dToF ranging module; S103: collecting intensity data of all pixels within the field of view to generate grayscale images, and performing binarization processing on all the grayscale images based on a current intensity threshold to generate a mask grayscale image; wherein the current intensity threshold is selected from a plurality of preset intensity thresholds; S105: initially determining dark corner regions based on the mask template and the mask grayscale image; S107: Determine whether the number of connected regions based on the mask grayscale image does not exceed 4, and determine whether the four corners on the mask grayscale image conform to the spatial geometric characteristics of the dark corner region; S109: If the above determination results are all yes, calculate the boundary curvature of each dark corner region to determine whether the mask grayscale image under the current intensity threshold is optimal; S111: If the determination result is yes, update the current optimal edge mask; S113: Traverse all preset intensity thresholds and repeat the above S103~S111 to update the current optimal edge mask and determine the optimal mask calibration parameters.

[0014] In one implementation of the first aspect, if during the execution of S107, if the determination result is that the number of connected regions exceeds 4 or the four corners on the mask grayscale image do not conform to the spatial geometric characteristics of the dark corner region, then other preset intensity thresholds are selected, and S103~S107 are executed repeatedly until the determination result of S107 is yes.

[0015] In one implementation of the first aspect, after S105 and before S107, S106 is further included: performing morphological processing and Gaussian filtering on the mask grayscale image.

[0016] In one implementation of the first aspect, in S113, updating the current optimal edge mask and determining the optimal mask calibration parameters includes: performing an enhancement process on the optimal edge mask to obtain the optimal mask calibration parameters.

[0017] Secondly, this application also provides a dToF ranging module, comprising: a vertical-cavity surface-emitting laser, a single-photon avalanche diode array, a time-to-count converter, and a memory; wherein, the vertical-cavity surface-emitting laser is used to emit laser pulses toward a target object; the single-photon avalanche diode array is used to receive echo photons; the time-to-count converter is used to record the cumulative number of echo photons to generate a histogram, thereby obtaining the time of flight to acquire the distance information of the target object; the memory is used to store optimal mask calibration parameters; wherein the optimal mask calibration parameters are obtained according to the edge mask calibration method of the above-described dToF ranging module.

[0018] Thirdly, this application also provides an electronic device, including a processor and a memory; wherein the memory stores a program, and when the processor executes the program, it performs the edge mask calibration method of the dToF ranging module described above.

[0019] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by an electronic device, implements the edge mask calibration method of the dToF ranging module described above.

[0020] As described above, the dToF ranging module, its edge mask calibration method, electronic device, and medium described in this application have the following beneficial effects:

[0021] 1) Adaptive to individual differences: Mask calibration is performed based on the intensity map measured for each dToF module. The optimal mask effect map is generated to address issues such as cover plate assembly offset, lens distortion differences, and batch process fluctuations for different modules.

[0022] 2) Not dependent on depth information: It is calibrated by intensity data and is not affected by depth accuracy and noise. Moreover, the signal-to-noise ratio of intensity data itself is much higher than that of depth map (especially edge areas), avoiding misjudgment of real objects at the edge. It is more accurate than depth information recognition.

[0023] 3) More inclusive and supports dynamic updates: If there are changes in hardware or algorithm solutions, there is no need to change the calibrated module. Even if the light intensity distribution of the module's cover plate or lens changes, only recalibration is required. Attached Figure Description

[0024] Figure 1 The diagram shown is a flowchart illustrating an edge mask calibration method for a dToF ranging module as described in an embodiment of this application.

[0025] Figure 2 The image shown is a grayscale mask generated based on several intensity thresholds in the edge mask calibration method of a dToF ranging module described in this application embodiment.

[0026] Figure 3 The image shown is a grayscale mask that satisfies the number of connected regions and conforms to the spatial geometric characteristics of vignetting in the edge mask calibration method of a dToF ranging module described in this application embodiment.

[0027] Figure 4 The image shown is a grayscale image of the optimal edge mask after enhancement in an edge mask calibration method for a dToF ranging module provided in this application embodiment.

[0028] Figure 5 The diagram shown is a structural schematic of a dToF ranging module according to an embodiment of this application. Detailed Implementation

[0029] The following specific examples illustrate the implementation of this application. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. This application can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. It should be noted that, unless otherwise specified, the following embodiments and features in the embodiments can be combined with each other.

[0030] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of this application. Therefore, the drawings only show the components related to this application and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.

[0031] The technical solutions in the embodiments of this application will be described in detail below with reference to the accompanying drawings.

[0032] like Figure 1 The diagram shown is a flowchart illustrating an edge mask calibration method for a dToF ranging module provided in this embodiment.

[0033] refer to Figure 1 The edge mask calibration method includes the following steps:

[0034] S101: Position the dToF ranging module facing a standard whiteboard to take a picture; wherein the standard whiteboard covers the field of view of the dToF ranging module.

[0035] S103: Collect intensity data of all pixels within the field of view to generate grayscale images, and perform binarization processing on all grayscale images based on the current intensity threshold to generate a mask grayscale image; wherein, the current intensity threshold is selected from a plurality of preset intensity thresholds.

[0036] S105: Based on the mask template and the mask grayscale image, the dark corner area is initially determined.

[0037] S107: Determine whether the number of connected regions based on the mask grayscale image does not exceed 4, and determine whether the four corners on the mask grayscale image conform to the spatial geometric characteristics of the dark corner region.

[0038] S109: If all the above judgment results are yes, then calculate the boundary curvature of each dark corner region, and apply the current intensity threshold according to the boundary curvature;

[0039] S111: If the judgment result is yes, then update the current best edge mask.

[0040] S113: Iterate through all preset intensity thresholds and repeat the above S103~S111 to update the current best edge mask and determine the best mask calibration parameters.

[0041] This application provides an edge mask calibration method for a dToF ranging module. This method can perform edge mask calibration based on factors such as different cover plate assembly offsets, lens distortion differences, and batch process fluctuations for each dToF ranging module, generating optimal mask calibration parameters and storing them in the memory within the dToF ranging module. Subsequent use of the dToF ranging module only requires calling the stored optimal mask calibration parameters.

[0042] Specifically, in step S101 above, a standard white board with uniform reflectivity and a flat surface is typically used. This is to eliminate reflectivity variations caused by differences in object texture, color, and distance in the measured scene. Furthermore, it is necessary to ensure that the standard white board covers the entire field of view (FOV) of the dToF ranging module, meaning that the echo signals from the standard white board are present in the four corners and the center of the image. This ensures that the subsequently acquired intensity data purely reflects the intensity attenuation caused by the optical system itself (such as lens vignetting, decreased relative illumination, and uneven VCSEL illumination), without interference from the content of the measured scene. Additionally, during shooting, the standard white board should be kept substantially perpendicular to the optical axis of the dToF ranging module and at a suitable distance to avoid misinterpreting grayscale gradients as vignetting due to tilt.

[0043] In S103, the intensity data refers to the number of effectively reflected photons received by the pixels on the SPAD array during the measurement period, or the sum of the signal amplitudes generated therefrom.

[0044] Specifically, in the histogram statistics of the dToF ranging module, each pixel on the SPAD array forms a signal peak at the target distance after multiple laser pulses accumulate. The cumulative number of photons or the equivalent signal amplitude within this signal peak is the intensity value of that pixel. Based on the intensity value, the echo strength of the target object in the corresponding spatial direction can be reflected. Under uniform plane shooting conditions, if the optical system is perfectly ideal, the intensity of all pixels should be consistent. However, actual lenses have factors such as edge light attenuation and darker edges of the VCSEL illumination field, resulting in high intensity at the center of the image and low intensity at the edges, especially the darkest corners. In addition, factors such as the cover plate protecting the VCSEL and the partial obstruction of the edge light path by the lens bracket, glue, etc., may also form dark corner areas.

[0045] Furthermore, all intensity data (e.g., intensity values) are linearly mapped to a grayscale range (0-255) to allow the intensity distribution to be visually observed. For example, the central area has a high grayscale value (bright), while the four corners have a low grayscale value (dark). Then, an intensity threshold is set, where pixels with intensity values ​​below the threshold are considered unreliable vignetting areas, while those with intensity values ​​above the threshold are considered valid imaging areas. Those skilled in the art will understand that the choice of intensity threshold is crucial; setting an excessively high threshold will erode the effective field of view, while setting an excessively low threshold will leave residual vignetting noise. Therefore, in this embodiment, several intensity thresholds are set to avoid the limitations of a single intensity threshold.

[0046] Based on the current intensity threshold, all the grayscale images are binarized, that is, the grayscale images are compared pixel by pixel. If the intensity is greater than or equal to the intensity threshold, it is an effective imaging area (appearing white), and if it is less than the intensity threshold, it is a dark corner area (appearing black), so as to generate a mask grayscale image (i.e., a binary image).

[0047] like Figure 2 The image shown is a grayscale mask generated based on several intensity thresholds in an edge mask calibration method for a dToF ranging module according to an embodiment of this application. (Reference) Figure 2 This includes mask grayscale images generated based on nine different intensity thresholds. In each mask grayscale image, sens represents the intensity threshold and Curv represents the minimum curvature of the dark corner region.

[0048] In S105, the prior shape, usually a fan-shaped or triangular region located at the four corners, is pre-defined based on optical design or experience, representing the expected optical occlusion position. Introducing a mask template can eliminate the possibility of the center of the image being misjudged as a vignetting region due to accidental intensity fluctuations (such as dust or slight uneven lighting). By performing a logical AND operation or spatial constraint on the mask grayscale image and the mask template, only black connected regions near the four corners are retained, while isolated noise points in the center are discarded, thus obtaining the initial vignetting region mask.

[0049] After S105 is executed and before S107 is executed, S106 is also included: performing morphological processing and Gaussian filtering on the mask grayscale image.

[0050] Specifically, morphological processing refers to applying grayscale morphological operations to the masked grayscale image. For example, opening (erosion followed by dilation) can remove individual bright noise points or isolated dark points in the central region. Closing (dilation followed by erosion) fills in tiny holes caused by noise in dark corner areas, improving the connectivity of the dark corners. Morphological processing can also be performed directly on the binary image, with the aim of shape correction and noise removal, making the edges of dark corner areas smooth and the interior continuous. Gaussian filtering refers to Gaussian smoothing the intensity grayscale image to suppress local fluctuations caused by photon statistical noise, making the transition between bright and dark more consistent and avoiding jagged or broken edges after binarization.

[0051] In step S107, connected component analysis is performed on the processed mask grayscale image. Ideally, vignetting regions should only appear in the top left, top right, bottom left, and bottom right corners; therefore, the number of connected components should be 4. If the number of connected components is greater than 4, it indicates that an inappropriate intensity threshold has resulted in isolated dark areas in the center or vignetting regions splitting into multiple blocks. If the number of connected components is less than 4, it is possible that some corners have not formed continuous regions (the threshold is too low, eroding the effective imaging area).

[0052] Furthermore, it is also necessary to determine whether the four corners of the mask grayscale image conform to the spatial geometric characteristics of the dark corner region.

[0053] Specifically, for example, check whether each connected region is close to an image corner and whether its shape is a triangle or arc that gradually narrows from the corner to the center. This can be determined using features such as the centroid location of the connected region, the distance between the vertex of the smallest bounding rectangle and the image corner, and the area-to-perimeter ratio.

[0054] like Figure 3 The image shown is a grayscale image of a mask that satisfies the number of connected regions and conforms to the spatial geometric characteristics of a dToF ranging module according to an embodiment of this application.

[0055] As described in S109, if all the above judgment results are yes, then the boundary curvature of each dark corner region is calculated to determine whether the mask grayscale image under the current intensity threshold is optimal.

[0056] Specifically, after meeting the quantity and location requirements, the threshold needs to be further fine-tuned to make the vignetting boundary smooth and natural. The contour curve of the vignetting region is extracted, and the curvature of each contour point is calculated (which can be obtained through a curvature formula or local circle fitting), and the distribution of curvature is statistically analyzed. Ideally, the edge of the vignetting should be a smooth arc, with continuous curvature changes and no drastic fluctuations.

[0057] The process of determining whether the mask grayscale image under the current intensity threshold is optimal includes: selecting the threshold that minimizes the curvature fluctuation of the four corner contours and achieves the smoothest edges. In practice, small-step iterations can be performed around the candidate thresholds to compare the contour smoothness, or the mean square error of curvature can be calculated as a loss function, and the threshold corresponding to the minimum value can be selected.

[0058] Furthermore, if during the execution of S107, if the determination result is that the number of connected regions exceeds 4 or the four corners on the mask grayscale image do not conform to the spatial geometric characteristics of the dark corner region, then other preset intensity thresholds are selected, and S103~S107 are executed repeatedly until the determination result of S107 is yes.

[0059] In S113, all preset intensity thresholds are iterated and the above S103~S111 are repeated to update the current optimal edge mask and determine the optimal mask calibration parameters. Further, updating the current optimal edge mask and determining the optimal mask calibration parameters includes: performing an enhancement process on the optimal edge mask to obtain the optimal mask calibration parameters.

[0060] Specifically, during actual shooting, slight non-perpendicularity between the plane and the optical axis, minor offset of VCSEL illumination, or uneven pixel sensitivity of the sensor itself can all cause the four dark corners to be not perfectly symmetrical. Therefore, this embodiment also needs to refine the optimal edge mask to obtain the final optimal mask calibration parameters, which are then stored in the memory of the dToF ranging module.

[0061] Specifically, to ensure the edge occlusion of the final depth map looks natural and aesthetically pleasing, the corner masks are typically forced to be symmetrical. For example, the four corners can be mirrored, rotated, and then averaged to generate a uniform vignetting curve model; alternatively, the contours of each corner can be fitted with circular / elliptical arcs of the same curvature, and the fitted results can be used to replace the original segmentation boundaries; or a radially gradient weight mask can be generated to smoothly transition the vignetting region from 0 to 1, rather than a harsh binary cut. Figure 4The image shown is a grayscale image after mask enhancement in an edge mask calibration method for a dToF ranging module provided in this application embodiment. The enhanced mask can be a complete weight map (two-dimensional array) or several parameters describing the vignetting model (such as center coordinates and vignetting curve polynomial coefficients). It is written into the module's non-volatile memory (such as EEPROM or Flash) and loaded directly upon power-up. When using the dToF ranging module, it only needs to call the stored optimal mask calibration parameters and multiply them by the depth result to obtain the final optimized imaging effect.

[0062] When the dToF ranging module is working normally, it obtains the original depth data or point cloud data of the captured object. The optimal mask calibration parameters (e.g., mask pixel value of 0, reserved pixel value of 1) are retrieved from the dToF ranging module's memory and multiplied with the original depth data or point cloud data to obtain a new data matrix. The depth map or point cloud is then displayed based on this new matrix. In the final output depth map and point cloud, unreliable data at the four corners are completely removed or suppressed, resulting in a regular rectangular or octagonal field of view for the effective area, which is visually cleaner and eliminates edge noise interference for subsequent 3D reconstruction or obstacle avoidance algorithms.

[0063] The scope of protection of the edge mask calibration method for a dToF ranging module described in this application is not limited to the execution order of the steps listed in this embodiment. Any solution implemented by adding, subtracting, or replacing steps in the prior art based on the principles of this application is included within the scope of protection of this application.

[0064] This application also provides a dToF ranging module. For example... Figure 5 The diagram shown is a structural schematic of a dToF ranging module according to an embodiment of this application.

[0065] refer to Figure 5 The dToF ranging module 2 includes: a vertical-cavity surface-emitting laser 21, a single-photon avalanche diode array 22, a time-to-count converter 23, and a memory 24; wherein, the vertical-cavity surface-emitting laser is used to emit laser pulses towards the target object; the single-photon avalanche diode array is used to receive echo photons; the time-to-count converter is used to record the cumulative number of echo photons to generate a histogram, thereby obtaining the flight time to acquire the distance information of the target object; the memory 24 is used to store optimal mask calibration parameters; wherein the optimal mask calibration parameters are obtained according to the edge mask calibration method of the dToF ranging module described above.

[0066] This application also provides an electronic device, including a processor and a memory; wherein the memory stores a program, and when the processor executes the program, it executes the edge mask calibration method of the dToF ranging module described above.

[0067] In the embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, or methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of modules / units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or units may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection of apparatuses or modules or units may be electrical, mechanical, or other forms.

[0068] The modules / units described as separate components may or may not be physically separate. The components shown as modules / units may or may not be physical modules; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules / units can be selected to achieve the objectives of the embodiments of this application, depending on actual needs. For example, the functional modules / units in the various embodiments of this application may be integrated into one processing module, or each module / unit may exist physically separately, or two or more modules / units may be integrated into one module / unit.

[0069] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0070] This application also provides a computer-readable storage medium storing a computer program that, when executed by an electronic device, implements the edge mask calibration method for the dToF ranging module described above. Those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing a processor. The program can be stored in a computer-readable storage medium, which is a non-transitory medium, such as random access memory, read-only memory, flash memory, hard disk, solid-state drive, magnetic tape, floppy disk, optical disc, and any combination thereof. The storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., digital video disc (DVD)), or a semiconductor medium (e.g., solid-state disk (SSD)).

[0071] The descriptions of the processes or structures corresponding to the above figures each have their own emphasis. For parts of a process or structure that are not described in detail, please refer to the relevant descriptions of other processes or structures.

[0072] The above embodiments are merely illustrative of the principles and effects of this application and are not intended to limit this application. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of this application. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in this application should still be covered by the claims of this application.

Claims

1. A method for calibrating the edge mask of a dToF ranging module, characterized in that, Includes the following steps: S101: Position the dToF ranging module facing a standard white board to take a picture; wherein the standard white board covers the field of view of the dToF ranging module; S103: Collect intensity data of all pixels within the field of view to generate grayscale images, and perform binarization processing on all grayscale images based on the current intensity threshold to generate a mask grayscale image; wherein, the current intensity threshold is selected from a plurality of preset intensity thresholds; S105: Based on the mask template and the grayscale image of the mask, the dark corner area is initially determined; S107: Determine whether the number of connected regions based on the mask grayscale image does not exceed 4, and determine whether the four corners on the mask grayscale image conform to the spatial geometric characteristics of the dark corner region; S109: If the above judgment results are all yes, then calculate the boundary curvature of each dark corner region to determine whether the mask grayscale image under the current intensity threshold is optimal. S111: If the judgment result is yes, then update the current best edge mask; S113: Iterate through all preset intensity thresholds and repeat the above S103~S111 to update the current best edge mask and determine the best mask calibration parameters.

2. The edge mask calibration method for the dToF ranging module according to claim 1, characterized in that, If, during the execution of S107, the determination result is that the number of connected regions exceeds 4 or the four corners on the mask grayscale image do not conform to the spatial geometric characteristics of the dark corner region, then other preset intensity thresholds are selected, and S103~S107 are executed repeatedly until the determination result of S107 is yes.

3. The edge mask calibration method for the dToF ranging module according to claim 1, characterized in that, After S105 is executed and before S107 is executed, S106 is also included: performing morphological processing and Gaussian filtering on the mask grayscale image.

4. The edge mask calibration method for the dToF ranging module according to claim 1, characterized in that, In S113, updating the current best edge mask and determining the best mask calibration parameters includes: performing beautification processing on the best edge mask to obtain the best mask calibration parameters.

5. A dToF ranging module, characterized in that, include: Vertical-cavity surface-emitting laser, single-photon avalanche diode array, time-to-number converter, and memory; among which... The vertical cavity surface-emitting laser is used to emit laser pulses toward the target object; The single-photon avalanche diode array is used to receive echo photons; The time-to-number converter is used to record the cumulative number of echo photons and generate a histogram to obtain the flight time and thus acquire the distance information of the target object. The memory is used to store the optimal mask calibration parameters; wherein the optimal mask calibration parameters are obtained by the edge mask calibration method of the dToF ranging module according to any one of claims 1 to 4.

6. An electronic device, characterized in that, It includes a processor and a memory; wherein the memory stores a program that, when executed by the processor, performs the edge mask calibration method of the dToF ranging module as described in any one of claims 1 to 4.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by an electronic device, the program implements the edge mask calibration method for the dToF ranging module as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Monocular human body distance measurement method and system based on AI depth and segmentation model

    CN120339296A

  • Multi-scene self-adaptive visual acquisition system and method

    CN120434509A