Phase folding optimization method, device, medium and equipment for TOF camera

By setting dual initial modulation frequencies and update modulation frequencies in the TOF camera, an optimization model is constructed to restore the depth image, which solves the problem of poor robustness of the TOF camera distance folding algorithm and improves the quality and noise resistance of the depth image.

CN112487655BActive Publication Date: 2024-10-22SHANGHAI SHUJI INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011445773.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-09
Publication Date
2024-10-22
Estimated Expiration
2040-12-09

AI Technical Summary

Technical Problem

TOF cameras have poor algorithm robustness in distance folding and are greatly affected by noise, resulting in low depth image quality.

Method used

Obtain dual depth maps and dual amplitude maps by setting dual initial modulation frequencies, build an optimization model to determine the ambiguity combination solution and mode loss value, restore the depth image when the mode loss value is less than the preset threshold, otherwise update the modulation frequency and integral continuously. Time until the mode loss value is less than the threshold.

Benefits of technology

Effectively reduce the impact of noise, improve depth image quality, and enhance the robustness and accuracy of the algorithm.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112487655B_ABST
    Figure CN112487655B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention discloses a phase folding optimization method for a TOF camera. By setting a dual initial modulation frequency to obtain a dual depth map and a dual amplitude map; constructing an optimization model based on the dual depth map and the dual amplitude map to determine a fuzzy combination solution and a modulus loss value; when the modulus loss value is less than a preset threshold, restoring a depth image based on the fuzzy combination solution can effectively reduce the influence of noise and improve the quality of the depth image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the technical field of 3D depth cameras, and in particular to a method, device, medium and equipment for optimizing phase folding in a TOF camera. Background Art

[0002] 3D depth camera is a new technology that has emerged in recent years. Compared with traditional cameras, depth cameras have added a depth measurement function, making it easier and more accurate to perceive the surrounding environment and changes.

[0003] 3D depth cameras have a wide range of applications, such as gesture recognition, robotics platforms, and consumer electronics. Currently, common depth cameras include binocular depth cameras, structured light cameras, and time-of-flight (ToF) depth cameras. Among them, ToF depth cameras obtain object distance information by directly measuring the light flight time, with low computational complexity and stable 3D imaging, and stand out among the three depth imaging technologies. However, ToF cameras are still affected by a variety of noises, and there are problems such as motion blur, multipath, and distance folding. In the existing technology, the distance folding of ToF cameras still has the problem of poor algorithm robustness. Summary of the invention

[0004] The embodiments of the present invention provide a method, device, medium and equipment for optimizing phase folding in a TOF camera, which can effectively reduce the influence of noise and improve the quality of depth images.

[0005] In a first aspect, an embodiment of the present invention provides a phase folding optimization method for a TOF camera, the method comprising:

[0006] Setting dual initial modulation frequencies to obtain dual depth images and dual amplitude images;

[0007] Building an optimization model based on the dual depth map and the dual amplitude map to determine the ambiguity combination solution and the modulus loss value;

[0008] When the modulus loss value is less than a preset threshold, the depth image is restored according to the ambiguity combination solution.

[0009] Optionally, also include:

[0010] When the modulus loss value is not less than a preset threshold, the initial depth value is continuously determined according to the currently acquired depth map and amplitude map;

[0011] According to the initial solution depth value, the initial modulation frequency and the integration time are continuously updated to continuously obtain the incremental fuzzy value and the loss update value until the loss update value is less than a preset threshold, and then the depth image is restored according to the fuzzy combined solution and the incremental fuzzy value.

[0012] Optionally, constructing an optimization model according to the dual depth map and the dual amplitude map to determine a fuzzy combination solution and a modulus loss value includes:

[0013] According to the dual depth maps d1, d2, a data constraint term loss(d1, d2; k1, k2) is constructed for each pixel point, where k1, k2 represent a combined ambiguity solution;

[0014] According to the dual depth maps d1, d2 and the dual amplitude maps a1, a2, construct an amplitude constraint term loss(a1, a2, d1, d2; k1, k2) for each pixel point;

[0015] According to the neighborhood continuity principle, a neighborhood constraint loss(i,N i ;k i ), where i represents the target pixel, N i represents the neighborhood set of pixel i;

[0016]

[0017] According to the above formula, the optimal ambiguity combination solution and the corresponding module loss value loss are determined.

[0018] Optionally, the step of setting dual initial modulation frequencies to obtain dual depth maps and dual amplitude maps includes:

[0019] Set dual initial modulation frequency and initial integration time through sensors;

[0020] Based on the I-ToF imaging principle, the dual depth map and the dual amplitude map are obtained.

[0021] Optionally, the obtaining of the dual depth map and the dual amplitude map based on the I-ToF imaging principle includes:

[0022]

[0023]

[0024] Among them, c represents the speed of light, f represents the amplitude modulation frequency of the light signal, and d represents the distance from the object to the camera. Represents the phase difference between the transmitted and received signals;

[0025] The phase difference between the transmitted and received signals is The calculation formula is:

[0026]

[0027] Among them, {Q1, Q2, Q3, Q4} are the integrated values ​​measured by the TOF device.

[0028] Optionally, restoring the depth image according to the fuzzy combination solution and the added fuzzy value includes:

[0029]

[0030] Among them, d recover To restore the depth value, d j To set the jth modulation frequency f j The corresponding depth value, k j To set the jth modulation frequency f j The corresponding ambiguity combination solution is , j, K are integer values ​​greater than 1.

[0031] In a second aspect, an embodiment of the present invention provides a phase folding optimization device for a TOF camera, the device comprising:

[0032] A dual image acquisition module, used to set dual initial modulation frequencies to acquire dual depth images and dual amplitude images;

[0033] A model solution module, used to construct an optimization model according to the dual depth map and the dual amplitude map, and determine the ambiguity combination solution and the mode loss value;

[0034] The restoration module is used to restore the depth image according to the ambiguity combination solution when the modulus loss value is less than a preset threshold.

[0035] Optionally, the recovery module is also used to:

[0036] When the loss value is not less than a preset threshold, the initial solution depth value is continuously determined based on the currently acquired depth map and amplitude map; based on the initial solution depth value, the initial modulation frequency and the integration time are continuously updated to continuously obtain the incremental fuzzy value and the loss update value, until the loss update value is less than the preset threshold, and then the depth image is restored based on the fuzzy combination solution and the incremental fuzzy value.

[0037] Optionally, the model solution module is specifically used for:

[0038] According to the dual depth maps d1, d2, a data constraint term loss(d1, d2; k1, k2) is constructed for each pixel point, where k1, k2 represent a combined ambiguity solution;

[0039] According to the dual depth maps d1, d2 and the dual amplitude maps a1, a2, construct an amplitude constraint term loss(a1, a2, d1, d2; k1, k2) for each pixel point;

[0040] According to the neighborhood continuity principle, a neighborhood constraint loss(i,N i ;ki ), where i represents the target pixel, N i represents the neighborhood set of pixel i;

[0041]

[0042] According to the above formula, the optimal ambiguity combination solution and the corresponding module loss value loss are determined.

[0043] Optionally, the dual-image acquisition module is specifically used for:

[0044] Set dual initial modulation frequency and initial integration time through sensors;

[0045] Based on the I-ToF imaging principle, the dual depth map and the dual amplitude map are obtained.

[0046] Optionally, the dual image acquisition module is based on the I-ToF imaging principle to acquire the dual depth image and the dual amplitude image, specifically:

[0047]

[0048]

[0049] Among them, c represents the speed of light, f represents the amplitude modulation frequency of the light signal, and d represents the distance from the object to the camera. Represents the phase difference between the transmitted and received signals;

[0050] The phase difference between the transmitted and received signals is The calculation formula is:

[0051]

[0052] Among them, {Q1, Q2, Q3, Q4} are the integrated values ​​measured by the TOF device.

[0053] Optionally, the recovery module is specifically used for:

[0054]

[0055] Among them, d recover To restore the depth value, d j To set the jth modulation frequency f j The corresponding depth value, k j To set the jth modulation frequency f j The corresponding ambiguity combination solution is , j, K are integer values ​​greater than 1.

[0056] In a third aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the phase folding optimization method for a TOF camera as described above.

[0057] In a fourth aspect, an embodiment of the present invention provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the phase folding optimization method for a TOF camera as described above is implemented.

[0058] The embodiment of the present invention sets a dual initial modulation frequency to obtain a dual depth map and a dual amplitude map; constructs an optimization model according to the dual depth map and the dual amplitude map to determine a fuzzy combination solution and a modulus loss value; when the modulus loss value is less than a preset threshold, restores the depth image according to the fuzzy combination solution, which can effectively reduce the influence of noise and improve the quality of the depth image. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] Figure 1A This is a schematic diagram of the internal correlation integration of I-ToF;

[0060] Figure 1B is a flow chart of a phase folding optimization method in a TOF camera provided by Embodiment 1 of the present invention;

[0061] Figure 2 is a flowchart of an exemplary phase folding optimization method in a TOF camera provided in Embodiment 2 of the present invention;

[0062] Figure 3 1 is a schematic diagram of the structure of a phase folding optimization device in a TOF camera provided by Embodiment 3 of the present invention;

[0063] Figure 4 It is a structural schematic diagram of an electronic device provided in Embodiment 5 of the present invention. DETAILED DESCRIPTION

[0064] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.

[0065] It should be mentioned before discussing the exemplary embodiments in more detail that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe the steps as sequential processes, many of the steps therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of the steps can be rearranged. The process can be terminated when its operation is completed, but can also have additional steps not included in the accompanying drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.

[0066] ToF cameras use (near) infrared signals to measure depth. According to the different depth calculation principles, they can be divided into direct time-of-flight depth cameras (direct Time-of-Flight, D-ToF) and indirect time-of-flight cameras (indirect Time-of-Flight, I-ToF). Due to the different imaging principles, the manifestation of distance folding is also different. The algorithm discussed in the embodiment of the present invention is for the I-ToF camera in the ToF depth camera. The I-ToF camera calculates the phase difference between the reflected signal and the incident signal, and then converts it into the flight time difference. The distance folding phenomenon is also commonly called phase folding.

[0067] When the I-ToF camera is working, the sensor first emits modulated infrared light, receives reflected light from the object, and calculates the phase difference between the incident light and the reflected light to obtain the distance of the target object. Figure 1A As shown, Figure 1A It is a schematic diagram of the internal correlation integration of I-ToF.

[0068] Specifically, the I-ToF camera calculates the correlation value between the received modulated signal and the specific reference signal through the circuit inside. Generally, a 4-phase reference signal is used, that is, the reference signal and the received signal with a phase difference of 0°, 90°, 180° and 270° are used for correlation integration: Figure 1A As shown, the four integral values ​​are recorded as {Q1, Q2, Q3, Q4}, and the phase difference can be calculated from them, that is:

[0069]

[0070] In addition, these four related integral values ​​can also be used to calculate the received light amplitude a, that is:

[0071]

[0072] The relationship between the modulation frequency of the optical signal, the phase difference between the transmitted and received signals, and the distance is:

[0073]

[0074] Where c represents the speed of light, f represents the amplitude modulation frequency of the optical signal, represents the phase difference between the transmitted and received signals, and d represents the distance from the object to the camera.

[0075] The phase difference of an I-ToF camera is usually obtained using the inverse tangent function. Due to the periodicity of the inverse tangent function, when the actual phase difference between the incident light and the reflected light exceeds 2π, phase folding will occur, resulting in errors in depth measurement. The number of whole cycles between the actual phase (depth) and the measured phase (depth) is also called ambiguity.

[0076]

[0077]

[0078] Among them, d mea is the depth value output by the sensor, d gt is the actual depth value, is the theoretical phase value, is the measured phase value output by the sensor. k is the ambiguity, c is the speed of light, and f is the modulation frequency of the camera.

[0079] However, most of the existing phase unfolding algorithms are based on single-frequency measurement methods, which use amplitude and depth constraints and neighborhood pixel depth constraints to build optimization models. This method simplifies the amplitude model, and the algorithm has poor robustness for high-ambiguity scenes. Methods based on multi-frequency measurements usually have fixed frequencies, and build optimization models based on the constraint relationship between multi-frequency measurement values ​​to solve the optimal ambiguity combination. However, this type of method ignores the impact of the choice of modulation frequency on the complexity and accuracy of the optimization model solution. For each given set of modulation frequencies, due to the presence of noise, the solution within a certain distance range will fall into a local optimum.

[0080] Embodiment 1

[0081] Figure 1B This is a flowchart of a phase folding optimization method for a TOF camera provided in Embodiment 1 of the present invention. The method can be performed by a phase folding optimization device for a TOF camera provided in an embodiment of the present invention. The device can be implemented in software and / or hardware. The method specifically includes:

[0082] S110 , setting dual initial modulation frequencies to obtain dual depth maps and dual amplitude maps.

[0083] The modulation frequency is a modulation method that uses the instantaneous frequency change of the carrier to represent information, and different information is expressed by using different frequencies of the carrier. The initial modulation frequency refers to the modulation frequency set at the beginning of the embodiment of the present invention. The depth map and amplitude map refer to the maps of depth and amplitude generated according to the input modulation frequency.

[0084] Specifically, the embodiment of the present invention sets a dual initial modulation frequency, that is, two initial modulation frequencies. The setting value can be input according to the previous experience of the staff. After the dual initial modulation frequencies are input, two depth maps and two amplitude maps corresponding to the dual initial modulation frequencies will be obtained. For example, the initial modulation frequency can be set to f1=80M and f2=100M in this embodiment. In addition, the embodiment of the present invention also sets the integration time to 750 microseconds.

[0085] Optionally, setting a dual initial modulation frequency to obtain a dual depth map and a dual amplitude map includes: setting a dual initial modulation frequency and an initial integration time through a sensor; and obtaining the dual depth map and the dual amplitude map based on the I-ToF imaging principle.

[0086] Optionally, the obtaining of the dual depth map and the dual amplitude map based on the I-ToF imaging principle includes:

[0087]

[0088]

[0089] Among them, c represents the speed of light, f represents the amplitude modulation frequency of the light signal, and d represents the distance from the object to the camera. Represents the phase difference between the transmitted and received signals;

[0090] The phase difference between the transmitted and received signals is The calculation formula is:

[0091]

[0092] Among them, {Q1, Q2, Q3, Q4} are the integrated values ​​measured by the TOF device.

[0093] S120: construct an optimization model according to the dual depth map and the dual amplitude map, and determine a combined ambiguity solution and a modulus loss value.

[0094] Among them, ambiguity refers to the integer number of cycles between the actual phase (depth) and the measured phase (depth), the ambiguity combined solution refers to the solution value of the ambiguity solved by the constructed optimization model, and the model loss value refers to the model loss value, that is, the loss value caused by introducing the model when solving the ambiguity.

[0095] Optionally, constructing an optimization model according to the dual depth map and the dual amplitude map to determine a fuzzy combination solution and a modulus loss value includes:

[0096] According to the dual depth maps d1, d2, a data constraint term loss(d1, d2; k1, k2) is constructed for each pixel point, where k1, k2 represent a combined ambiguity solution;

[0097] According to the dual depth maps d1, d2 and the dual amplitude maps a1, a2, construct an amplitude constraint term loss(a1, a2, d1, d2; k1, k2) for each pixel point;

[0098] According to the neighborhood continuity principle, a neighborhood constraint loss(i,N i ;k i ), where i represents the target pixel, N i Represents the neighborhood set of pixel i; for example, the value of the neighborhood constraint item i can be taken as 8 neighborhoods, that is, 8 pixel points above, below, left, right, upper left, upper right, lower left and lower right of pixel i.

[0099]

[0100] Among them, λ represents the weight coefficient, the proportion of different loss items. The λ1 value can be set to 0.8, and the λ2 value can be set to 0.4.

[0101] According to the above formula, the optimal ambiguity combination solution and the corresponding module loss value loss are determined.

[0102] S130: When the modulus loss value is less than a preset threshold, restore the depth image according to the fuzzy combination solution.

[0103] The preset threshold value may be set to any value, for example, the preset threshold value may be set to 0.05.

[0104] Optionally, an embodiment of the present invention also includes: when the loss value is not less than a preset threshold, continuously determining an initial solution depth value based on the currently acquired depth map and amplitude map; continuously updating the initial modulation frequency and integration time based on the initial solution depth value to continuously obtain incremental fuzzy values ​​and loss update values ​​until the loss update value is less than a preset threshold, and then restoring the depth image based on the fuzzy combination solution and the incremental fuzzy value.

[0105] The initial solution depth value refers to the ambiguity combination solution solved by building an optimization model after setting the dual initial modulation frequency. For example, the solution formula is:

[0106]

[0107] Among them, d recover1 Refers to the initial solution depth value.

[0108] The additional fuzzy value refers to the fuzzy value calculated by adding a new modulation frequency to construct an optimization model on the basis of setting the double initial modulation frequencies.

[0109] Specifically, in the embodiment of the present invention, when the modulus loss value is less than a preset threshold, the depth image is restored according to the ambiguity combination solution; when the modulus loss value is not less than the preset threshold, the initial solution depth value is continuously determined according to the currently acquired depth map and amplitude map. The staff then adjusts the initial modulation frequency and the integration time according to the initial solution depth value. For example, when the initial solution depth value is small, the integration time is adjusted to a smaller value, and when the initial solution depth value is large, the integration time is adjusted to a larger value. In the embodiment of the present invention, on the basis of the dual initial modulation frequencies, a new modulation frequency is added to construct an optimization model to accurately provide an ambiguity combination solution and an additional ambiguity value.

[0110] Optionally, restoring the depth image according to the fuzzy combination solution and the added fuzzy value includes:

[0111]

[0112] Among them, d recover To restore the depth value, d j To set the jth modulation frequency f j The corresponding depth value, k j To set the jth modulation frequency f j The corresponding ambiguity combination solution is , j, K are integer values ​​greater than 1.

[0113] Specifically, K is related to the number of modulation frequency groups set. For example, if the modulus loss value after setting the double initial modulation frequency is less than the preset threshold, K is 2. The initial depth value d obtained in this embodiment is recover1 It is the final restored depth image.

[0114] The embodiment of the present invention sets a dual initial modulation frequency to obtain a dual depth map and a dual amplitude map; constructs an optimization model according to the dual depth map and the dual amplitude map to determine a fuzzy combination solution and a modulus loss value; when the modulus loss value is less than a preset threshold, restores the depth image according to the fuzzy combination solution, which can effectively reduce the influence of noise and improve the quality of the depth image.

[0115] Embodiment 2

[0116] Figure 2 A flowchart of an exemplary phase folding optimization method in a TOF camera provided in Embodiment 2 of the present invention.

[0117] The present invention sets two initial modulation frequencies, builds an optimization model based on dual-frequency depth data, obtains an initial solution of the true depth, and then determines new modulation frequencies and integration time parameters based on the initial solution and the corresponding loss, solves the true depth and model loss in combination with the new depth measurement value, and continuously iterates until the conditions for the end of the iteration are met, thereby realizing phase folding repair based on multi-frequency measurement and sensor-in-the-loop control. The method comprises the following steps:

[0118] S1, initialize the dual modulation frequency and obtain the corresponding dual frequency depth map and amplitude map.

[0119] S2, based on the dual-frequency measurement data, builds an optimization model to solve the ambiguity k1, k2 and the model loss.

[0120] S3, if loss is found, execute step S6; otherwise, determine new modulation frequency and integration time parameters, and obtain new depth map and amplitude map.

[0121] S4, combines the new depth data and amplitude data, optimizes the solution model, and solves the ambiguity and model loss.

[0122] S5, repeat steps (S3-S4).

[0123] S6, based on multi-frequency measurement data and solution models, generates the highest quality true depth map.

[0124] In the above step S1, the embodiment of the present invention includes the following steps:

[0125] Step S11, setting the initial modulation frequency to f1=80M, f2=100M;

[0126] Step S12, based on the I-ToF imaging principle, obtain the depth maps d1, d2 and amplitude maps a1, a2 corresponding to the two frequencies.

[0127] In the above step S2, the embodiment of the present invention includes the following steps:

[0128] Step S21, constructing a data constraint term loss(d1, d2; k1, k2) for each pixel point according to the dual-frequency depth data;

[0129] Step S22, constructing an amplitude constraint term loss(a1, a2, d1, d2; k1, k2) for each pixel point according to the amplitude and depth data;

[0130] Step S23: According to the neighborhood continuity principle, a neighborhood constraint loss(i,N i ;k i ), where i represents the target pixel, N irepresents the neighborhood set of pixel i;

[0131] Step S24, solve the following equation to find the optimal ambiguity combination and corresponding loss;

[0132]

[0133] In the above step S3, the embodiment of the present invention includes the following steps:

[0134] Step S31, judging whether the loss obtained in step S24 meets the requirements, wherein the depth image restoration follows the following expression;

[0135]

[0136] Step S32: if loss satisfies loss <loss th , then jump out of this step and execute step S6; otherwise, execute step S33;

[0137] Step S33, based on the overall depth of the image, determine a new modulation frequency f j and integration time;

[0138] Step S34, obtain new measurement data, depth map d j and amplitude diagram a j ;

[0139] In the above step S4, the embodiment of the present invention includes the following steps:

[0140] Step S41, updating the loss function based on the latest depth map and amplitude map;

[0141] Step S42, based on the solution method of step S24, updating the ambiguity combination and the corresponding loss;

[0142] In the above step S5, the embodiment of the present invention includes the following steps:

[0143] Step S51, repeat steps S3-S4;

[0144] In the above step S6, the embodiment of the present invention includes the following steps:

[0145] Step S61, restoring the depth image based on the blur obtained in step S5;

[0146]

[0147] The present invention provides a method for phase unfolding based on sensor in the loop, which uses multi-frequency depth measurement data to build an optimization model to solve the unfolded phase. According to the optimization results of the model, the modulation frequency and integration time and other parameters of the camera are changed in real time to obtain new depth and amplitude measurement values ​​and add them to the optimization model, thereby reducing the impact of noise and improving the quality of the restored depth image. At the same time, the method based on sensor in the loop control has lower prior dependence on the scene, and compared with the method with fixed modulation frequency, the algorithm has wider applicability.

[0148] Embodiment 3

[0149] Figure 3 : is a schematic diagram of a phase folding optimization device for a TOF camera provided by an embodiment of the present invention, the device specifically includes:

[0150] A dual image acquisition module 310, used to set dual initial modulation frequencies to acquire dual depth images and dual amplitude images;

[0151] A model solution module 320, configured to construct an optimization model according to the dual depth map and the dual amplitude map, and determine an ambiguity combination solution and a modulus loss value;

[0152] The restoration module 330 is configured to restore the depth image according to the fuzzy combination solution when the loss value is less than a preset threshold.

[0153] Optionally, the recovery module 330 is further configured to:

[0154] When the loss value is not less than a preset threshold, the initial solution depth value is continuously determined based on the currently acquired depth map and amplitude map; based on the initial solution depth value, the initial modulation frequency and the integration time are continuously updated to continuously obtain the incremental fuzzy value and the loss update value, until the loss update value is less than the preset threshold, and then the depth image is restored based on the fuzzy combination solution and the incremental fuzzy value.

[0155] Optionally, the model solution module 320 is specifically used for:

[0156] According to the dual depth maps d1, d2, a data constraint term loss(d1, d2; k1, k2) is constructed for each pixel point, where k1, k2 represent a combined ambiguity solution;

[0157] According to the dual depth maps d1, d2 and the dual amplitude maps a1, a2, construct an amplitude constraint term loss(a1, a2, d1, d2; k1, k2) for each pixel point;

[0158] According to the neighborhood continuity principle, a neighborhood constraint loss(i,N i ;k i ), where i represents the target pixel, Ni represents the neighborhood set of pixel i;

[0159]

[0160] According to the above formula, the optimal ambiguity combination solution and the corresponding module loss value loss are determined.

[0161] Optionally, the dual-image acquisition module 310 is specifically used for:

[0162] Set dual initial modulation frequency and initial integration time through sensors;

[0163] Based on the I-ToF imaging principle, the dual depth map and the dual amplitude map are obtained.

[0164] Optionally, the dual image acquisition module 310 acquires the dual depth image and the dual amplitude image based on the I-ToF imaging principle, specifically:

[0165]

[0166]

[0167] Among them, c represents the speed of light, f represents the amplitude modulation frequency of the light signal, and d represents the distance from the object to the camera. Represents the phase difference between the transmitted and received signals;

[0168] The phase difference between the transmitted and received signals is The calculation formula is:

[0169]

[0170] Among them, {Q1, Q2, Q3, Q4} are the measured integral values.

[0171] Optionally, the recovery module 330 is specifically used for:

[0172]

[0173] Among them, d recover To restore the depth value, d j To set the jth modulation frequency f j The corresponding depth value, k j To set the jth modulation frequency f j The corresponding ambiguity combination solution is , j, K are integer values ​​greater than 1.

[0174] The embodiment of the present invention sets a dual initial modulation frequency to obtain a dual depth map and a dual amplitude map; constructs an optimization model according to the dual depth map and the dual amplitude map to determine a fuzzy combination solution and a modulus loss value; when the modulus loss value is less than a preset threshold, restores the depth image according to the fuzzy combination solution, which can effectively reduce the influence of noise and improve the quality of the depth image.

[0175] Embodiment 4

[0176] The present application also provides a storage medium containing computer executable instructions, which are used to perform:

[0177] Setting dual initial modulation frequencies to obtain dual depth images and dual amplitude images;

[0178] Building an optimization model based on the dual depth map and the dual amplitude map to determine the ambiguity combination solution and the modulus loss value;

[0179] When the modulus loss value is less than a preset threshold, the depth image is restored according to the ambiguity combination solution.

[0180] Storage medium - any of various types of memory devices or storage devices. The term "storage medium" is intended to include: installation media, such as CD-ROM, floppy disk or tape device; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media (such as hard disk or optical storage); registers or other similar types of memory elements, etc. The storage medium may also include other types of memory or combinations thereof. In addition, the storage medium may be located in the computer system in which the program is executed, or may be located in a different second computer system, which is connected to the computer system via a network (such as the Internet). The second computer system can provide program instructions to the computer for execution. The term "storage medium" may include two or more storage media that may reside in different locations (for example, in different computer systems connected by a network). The storage medium may store program instructions (for example, embodied as a computer program) that can be executed by one or more processors.

[0181] Of course, the storage medium containing computer executable instructions provided in an embodiment of the present application is not limited to the phase folding optimization operation in the TOF camera as described above, and can also execute related operations in the phase folding optimization method in the TOF camera provided in any embodiment of the present application.

[0182] Embodiment 5

[0183] An embodiment of the present application provides an electronic device, in which a synchronization device for phase folding optimization in a TOF camera provided by an embodiment of the present application can be integrated. Figure 4 Schematic diagram of the structure of an electronic device provided in Embodiment 5 of the present application. Figure 4 As shown, this embodiment provides an electronic device 400, which includes: one or more processors 420; a storage device 410, which is used to store one or more programs. When the one or more programs are run by the one or more processors 420, the one or more processors 420 implement:

[0184] Setting dual initial modulation frequencies to obtain dual depth images and dual amplitude images;

[0185] Building an optimization model based on the dual depth map and the dual amplitude map to determine the ambiguity combination solution and the modulus loss value;

[0186] When the modulus loss value is less than a preset threshold, the depth image is restored according to the ambiguity combination solution.

[0187] like Figure 4 As shown, the electronic device 400 includes a processor 420, a storage device 410, an input device 430, and an output device 440; the number of the processor 420 in the electronic device can be one or more. Figure 4 A processor 420 is taken as an example; the processor 420, the storage device 410, the input device 430 and the output device 440 in the electronic device can be connected via a bus or other means. Figure 4 The connection via bus 450 is taken as an example.

[0188] The storage device 410, as a computer-readable storage medium, can be used to store software programs, computer-executable programs and module units, such as program instructions corresponding to the phase folding optimization method in the TOF camera in the embodiment of the present application.

[0189] The storage device 410 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal, etc. In addition, the storage device 410 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the storage device 410 may further include a memory remotely arranged relative to the processor 420, and these remote memories may be connected via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0190] The input device 430 may be used to receive input numbers, character information or voice information, and generate key signal input related to user settings and function control of the electronic device. The output device 440 may include a display screen, a speaker and other devices.

[0191] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A phase folding optimization method for a TOF camera, characterized in that: include: Setting dual initial modulation frequencies to obtain dual depth images and dual amplitude images; Building an optimization model based on the dual depth map and the dual amplitude map to determine the ambiguity combination solution and the modulus loss value; According to the dual depth maps d1, d2, a data constraint term loss(d1, d2; k1, k2) is constructed for each pixel point, where k1, k2 represent a combined ambiguity solution; According to the dual depth maps d1, d2 and the dual amplitude maps a1, a2, construct an amplitude constraint term loss(a1, a2, d1, d2; k1, k2) for each pixel point; According to the neighborhood continuity principle, a neighborhood constraint loss(i,N i ;k i ), where i represents the target pixel, N i represents the neighborhood set of pixel i; According to the above formula, the optimal ambiguity combination solution and the corresponding loss value loss(d,a;k) are determined; where λ1 and λ2 represent weight coefficients, k represents ambiguity, a represents light amplitude, and d represents the distance from the object to the camera; When the modulus loss value is not less than a preset threshold, the initial depth value is continuously determined according to the currently acquired depth map and amplitude map; According to the initial solution depth value, the initial modulation frequency and the integration time are continuously updated to continuously obtain the incremental fuzzy value and the modulus loss update value until the modulus loss update value is less than a preset threshold, and then the depth image is restored according to the fuzzy combination solution and the incremental fuzzy value, including: Among them, d recover To restore the depth value, d j To set the jth modulation frequency f j The corresponding depth value, k j To set the jth modulation frequency f j The corresponding ambiguity combined solution is , K is an integer greater than 1, and c represents the speed of light.

2. The method according to claim 1, characterized in that The step of setting the dual initial modulation frequencies to obtain the dual depth map and the dual amplitude map includes: Set dual initial modulation frequency and initial integration time through sensors; Based on the I-ToF imaging principle, the dual depth map and the dual amplitude map are obtained.

3. The method according to claim 2, characterized in that The method of obtaining the dual depth map and the dual amplitude map based on the I-ToF imaging principle includes: Where f represents the amplitude modulation frequency of the optical signal, Represents the phase difference between the transmitted and received signals; The phase difference between the transmitted and received signals is The calculation formula is: Among them, {Q1, Q2, Q3, Q4} are the integrated values ​​measured by the TOF device.

4. A phase folding optimization device for a TOF camera, characterized in that: include: A dual image acquisition module, used to set dual initial modulation frequencies to acquire dual depth images and dual amplitude images; A solution model module is used to construct an optimization model according to the dual depth map and the dual amplitude map, determine the ambiguity combination solution and the model loss value; according to the dual depth map d1, d2, construct a data constraint term loss(d1, d2; k1, k2) for each pixel point, where k1, k2 represent the ambiguity combination solution; according to the dual depth map d1, d2 and the dual amplitude map a1, a2, construct an amplitude constraint term loss(a1, a2, d1, d2; k1, k2) for each pixel point; according to the neighborhood continuity principle, construct a neighborhood constraint term loss(i, N i ;k i ), where i represents the target pixel, N i represents the neighborhood set of pixel i; According to the above formula, the optimal ambiguity combination solution and the corresponding loss value loss(d,a;k) are determined; where λ1 and λ2 represent weight coefficients, k represents ambiguity, a represents light amplitude, and d represents the distance from the object to the camera; A recovery module is used to continuously determine the initial solution depth value according to the currently acquired depth map and amplitude map when the loss value is not less than the preset threshold; continuously update the initial modulation frequency and integration time according to the initial solution depth value to continuously obtain the incremental fuzzy value and the loss update value until the loss update value is less than the preset threshold, and then restore the depth image according to the fuzzy combination solution and the incremental fuzzy value, including: Among them, d recover To restore the depth value, d j To set the jth modulation frequency f j The corresponding depth value, k j To set the jth modulation frequency f j The corresponding ambiguity combined solution is , K is an integer greater than 1, and c represents the speed of light.

5. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the phase folding optimization method in a TOF camera as described in any one of claims 1 to 3 is implemented.

6. An electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the phase folding optimization method in the TOF camera is implemented as described in any one of claims 1 to 3.