# Detection of Household Furniture Storage Space in Depth Images
## 3 Methods
### Empty Storage Volume Detection Algorithm
#### 3.1.4 Bounding Box Fine-Tuning  
After detecting storage volumes in the voxel space, the algorithm transforms them to the mesh space. To transform the voxel space bounding box into the mesh space, it must be scaled by the voxelization factor \(d_{v}\) and translated by the offset that occurs due to the voxelization process. Figure 5 shows the previously considered example of a voxel space bounding box in mesh space. Since the purpose of the proposed automated storage volume detection is to create a large dataset for training neural networks in general, the metric bounding boxes should be adapted for this purpose. Most neural networks require ground truth labels that include some points of the object that should be recognized. On the other hand, we want to detect storage volumes which represent empty space. Nevertheless, storage volumes placed inside furniture are enclosed by the supporting surface, furniture walls, and upper shelves or furniture ceilings. The uppermost storage volumes are limited only by the supporting surface and the height of another object above it. Thus, to make an empty storage volume, an object that can be detected by neural network, the 3D bounding box must be adjusted to contain points on the surfaces enclosing this storage volume. This adjusted storage volume is referred to as _enclosed storage volume_, and the original bounding box from which it is created is referred to as the _detected bounding box_. To obtain the enclosed storage volume, the algorithm must adjust the bounding box to the mesh vertices that belong to the nearest furniture wall and/or storage surface. Due to the transformation from voxel to mesh space, the mesh vertices enclosing a storage volume are located in the neighboring region of \(\pm d_{v}\) around the sides of the detected bounding box. That is, dilating and contracting the detected bounding box by \(d_{v}\) creates a narrow region containing the mesh vertices of the furniture structure, as shown in Figure 6. The dilated mesh space bounding box is depicted in green, and the contracted mesh space bounding box is depicted in blue. The highlighted region represents the space in which the detected storage volume (orange) should be adjusted to the enclosed storage volume. In general, the extent of a storage volume is characterized by its axis  
Figure 5: Selected mesh furniture model with detected storage volume in mesh space. The storage volume is depicted with an orange bounding box. aligned bounding box defined by its minimum and maximum coordinates. Therefore, the minimum \(x\)-coordinate of the enclosed storage volume is \(x^{{}^{\prime}}_{min}\in[x_{min}-d_{v},x_{min}+d_{v}]\) and the maximum point is \(x^{{}^{\prime}}_{max}\in[x_{max}-d_{v},x_{max}+d_{v}]\). The minimum and the maximum bounding box coordinates in y and z directions can be determined analogously. The set of these six intervals containing the minimum and maximum bounding box coordinates for each axis is referred to as _storage volume range_. A storage volume bounding box is adjusted by finding the peaks of the distribution of the mesh vertices in storage volume range. The histograms of the mesh model vertices were computed for each interval in the storage volume range. By extracting mesh vertices located in the storage volume range and creating a histogram of vertex coordinates for each axis, the algorithm retrieves six histograms. This is illustrated in Figure 7.  
The storage volume range intervals define the lower and upper limits of the histogram bins. The number of histogram bins is determined as follows:  
\[n_{bins}=\left\lceil\left\lvert\frac{r_{max}-r_{min}}{w_{bin}}\right\rvert\right\rceil\]  
where \(w_{bin}\) is bin width determined empirically depending on the accuracy one wants to achieve; \(r_{min}\) and \(r_{max}\) are the minimal and maximal values defining the histogram range. In the next step, the algorithm locates the peak value of each histogram. Using these peak values, the new minimum and maximum extents of the bounding box can be determined.