## 3 High-Quality ToF Camera Data Acquisition Strategies
### Integrated Preprocessing Techniques for Enhancing Depth Data Accuracy  
In order to match shapes between depth data acquired from real environments and data acquired in simulation environments, preprocessing of noise and data loss from time-of-flight (ToF) sensors is essential. Due to the frequent occurrence of noise and missing pixel data in ToF sensors, shape matching and alignment using unprocessed depth data is  
Figure 1: Deeplearning learning process to improve ToF sensor accuracy.  
practically challenging. This paper proposes optimizing the preprocessing of ToF depth camera data using traditional methods and integrated preprocessing algorithms considering industrial field characteristics, as shown in Figure 2. ToF sensors often experience noise and data loss in each pixel due to the object being measured, the influence of light, and environmental changes. This occurs due to various factors such as instability of light sources, slight differences in illumination, and dust.  
To acquire accurate data, this study aims to improve accuracy by calculating average values, not just by accumulating data, to prevent data omission and maximize data performance. It is important to exclude the number of times data has been lost. There are two types of data loss: cases where no distance value can be obtained and cases where the sensor displays the maximum value due to saturation. These two types were pre-filtered during accumulation, and by using a moving average filter as in Equation (1), the conditional average of the accumulated data from ToF sensor pixels was calculated to enhance data omission and accuracy. However, depth data acquired through data accumulation may contain more noise, leading to increased noise issues. To resolve this, a process of data normalization is required to remove outlier data and smooth out the data.  
\[\text{CumulativeData}=\begin{cases}\text{CurrData},&\text{if PrevData}=0\text{ and CurrData}\
eq 0\\ \text{PrevData},&\text{if PrevData}\
eq 0\text{ and CurrData}=0\\ \frac{\text{PrevData}+\text{CurrData}}{2},&\text{if PrevData}\
eq 0\text{ and CurrData}\
eq 0\end{cases} \tag{1}\]  
For this purpose, three main algorithms were used to preprocess the depth data:  
* Interquartile Range (IQR): Represents the middle 50% range of the data, which is useful for identifying the distribution of data and outliers [12]. In this study, the first quartile (Q1) was set to 20% and the third quartile (Q3) to 80%, targeting the data between the lower 20% and upper 20% to eliminate noise.
* Gaussian Distribution: Uses the mean and standard deviation of the data to measure how far the data points are from the mean and to detect outliers [13]. In this research,  
Figure 2: Accumulated data and noise removal process of ToF sensor.  
data points that are more than three times the standard deviation from the mean were defined as outliers and considered as noise.
* Statistical Outliers Removal (SOR) Filter: Calculates the average distance among the K-nearest neighbors around each data point, and data points that are significantly farther from the average distance are considered outliers [14]. In this study, the number of neighbors was set to 20, and data points that are more than twice the standard deviation from the average distance were considered outliers. This filter is effective in smoothing the surface of 3D point clouds.  
By applying these preprocessing techniques, we were able to effectively prevent data loss and remove noise from the ToF sensor data, as shown in Figure 3. Moreover, this preprocessing process allowed us to successfully apply the ICP algorithm without any issues for shape matching with depth data acquired in simulations.