## 2 Basic Theories and Principles  
### Ranging Principle of ToF Cameras  
The time-of-flight camera is a 3D imaging technology that uses the time difference of light beam reflection from the surface of objects to measure distances. It has advantages over traditional cameras in terms of measuring object distances because it can perform measurements regardless of lighting conditions. The modulation of the light source in time-of-flight cameras can be categorized into pulse modulation and continuous wave (CW) modulation. Pulse modulation is a technique that converts analog signals into digital signals, while continuous wave modulation is a modulation technique that adjusts the amplitude, frequency, phase, and other characteristics of the carrier signal using the frequency of the modulation signal, thereby enabling the process of information transmission. The schematic diagram in Figure 1 illustrates the working principle of CW modulation. When using the continuous wave measurement method, it is necessary to utilize phase demodulation to accurately calculate the flight time of photons in space. Phase demodulation involves the emission of modulated continuous wave signals by the illumination module. These signals reach the object being measured and reflect back to the receiving module. The receiving module utilizes a demodulation signal identical to the modulation signal from the light source to complete the demodulation process, thereby extracting the phase variations of the light signal. We use the most commonly used continuous sinusoidal wave modulation, as shown in Figure 1, to derive the measurement principle of the continuous wave modulation mode. Let us assume that the emitted sinusoidal signal \(s(t)\) can be represented by Equation (1),  
\[s(t)=a\cdot(1+\sin(2\pi ft)), \tag{1}\]  
In Equation (1), where \(a\) represents the amplitude of the transmitted signal and \(f\) is the frequency, after a time period \(\Delta t\), the received signal has an amplitude of \(A\). Taking into account that the majority of received photon signals are superimposed on the image, we need to introduce an offset value \(B\) to obtain the actual measurement value. \(r(t)\) can be represented by Equation (2),  
\[ \begin{array}{rl}r(t)&=A\cdot(1+\sin(2\pi f(t-\Delta t)))+B,\\ &=A\cdot(1+\sin(2\pi ft-\Delta\phi))+B.\end{array}  \tag{2}\]  
In Figure 1, the four sampling time intervals are equal, all denoted as \(\frac{T}{4}\). Let us assume that \(t_{1}=0\), \(t_{2}=\frac{T}{4}\), \(t_{3}=\frac{T}{2}\), \(t_{4}=\frac{3T}{4}\). Based on these four sampling times, we can establish four sets of equations: \(r_{1}\), \(r_{2}\), \(r_{3}\), and \(r_{4}\). By performing calculations on these four  
Figure 1: Flight time measurement in continuous sinusoidal wave modulation mode. sets of equations, we can determine the amplitude \(A\) and phase delay \(\Delta\phi\) of the received sinusoidal signal,  
\[\Delta\phi=\arctan\left(\frac{r_{3}-r_{4}}{r_{1}-r_{2}}\right), \tag{3}\]  
\[A=\frac{1}{2}\sqrt{\left(r_{1}-r_{2}\right)^{2}+\left(r_{3}-r_{4}\right)^{2}}. \tag{4}\]  
Using the four integral time accumulated charges \(S_{1}\), \(S_{2}\), \(S_{3}\) and \(S_{4}\) to denote \(\Delta\phi\) and \(A\),  
\[\Delta\phi=\arctan\left(\frac{S_{3}-S_{4}}{S_{1}-S_{2}}\right), \tag{5}\]  
\[A=\frac{1}{2}\sqrt{\left(S_{1}-S_{2}\right)^{2}+\left(S_{3}-S_{4}\right)^{2}}. \tag{6}\]  
The offset \(B\) can be expressed as  
\[B=\frac{1}{4}(S_{1}+S_{2}+S_{3}+S_{4}), \tag{7}\]  
Based on the calculated phase values \(\Delta\phi\), the distance information can be expressed in Equation (8),  
\[d=\frac{c}{4\pi f}\Delta\phi. \tag{8}\]  
The amplitude A and offset B of the modulated light in a ToF camera measurement system affects the accuracy of the measurement, and the values of \(A\) and \(B\) indirectly reflect the accuracy of the depth measurement, so the accuracy of the measurement can be approximated as Equation (9),  
\[\sigma_{d}=\frac{c}{4\sqrt{2}\pi f}\cdot\frac{\sqrt{A+B}}{c_{d}\cdot A}, \tag{9}\]  
Here, \(c_{d}\) is the modulation contrast.