## 3 Materials and Methods
### 3D Object Detection and Pose Estimation Module
#### 3.2.2 Method for Initial 3D Object Detection and Pose Estimation  
An initial 3D object detection and pose estimation method was constructed, based on the work of [PERSON] et al. [15]. This method uses the LINEMOD method [41] to detect the 2D location of the 3D object in the image captured by the camera. Using this location, the initial pose of the object is inferred from the associated poses of the most similar templates. Finally, the initial pose is refined using both the depth information from the camera through an ICP algorithm [42], as well as the color information through HSV color space decomposition. In detail, given an RGB-D image, \(\mathbf{I}_{model}\) (obtained after rendering the 3D model from a certain point of view of the virtual camera), whose relative pose is \(G_{cam}\in\mathbb{SE}(3)\), the template associated with this RGB-D image can be defined as \(T=(\{O_{m}\}_{m\in\Lambda},P)\), where \(O\) is a set of template features (orientation of the gradient or orientation of the surface normals) and \(\Lambda\) represents the modalities of the image (RGB image or depth image), while \(P\) is a list of \(r\) locations in \(I_{model}\). Then, through a sliding-window approach, a template is compared with the captured RGB-D image \(I_{cam}\) at location \(c\), based on a similarity measure on its \(L\) neighbors:  
\[\epsilon_{s}(I_{cam},T,c)=\sum_{r\in P}\max_{t\in L(c+r)}f_{m}(O_{m}(r),I_{m}( t)), \tag{5}\]  
where \(f_{m}(O_{m}(r),I_{m}(t))\) measures the similarity between the gradient orientations and the surface normals. A template is found in \(I_{cam}\) if the similarity score, \(\epsilon_{s}\), is greater than a certain threshold (generally \(\geqq 80\)). For more details of this method, see [41]. An important contribution is our optimization of the original LINEMOD method. Although the original work has low computational cost--thanks largely to the use of SSE instructions in the search for the most similar template in the image--in this work, various optimizations were also made, such as those proposed by [PERSON] et al. [35], in such a way that the computational cost of the detection method was almost halved. Specifically, feature extractions were performed in separate threads for each color and depth images and numerous loops were parallelized. One of the main limitations of the pose estimation method of [PERSON] et al. [41] is the precision obtained by the LINEMOD detection method, as it tends to produce both many false positives and false negatives on certain occasions when detecting the 3D object [43] in cluttered backgrounds (see Figure 4). This fact depends mainly on the characteristics of the 3D object to be identified in the RGB-D image. Specifically, 3D objects with simpler geometries are most likely to be affected by this phenomenon, due to two reasons: The first reason is that simple 3D objects generate templates with regular and simple geometric contour shapes, such as rectangles, circles, or ellipses, which match with the projections of many other 3D objects within the scene, causing false positives [43]. The second reason is due to possible ambiguities in relating a template to a pose when two or more virtual views generally have the same template; for example, in the case of symmetrical objects. Another important factor, when obtaining false positives, is the number of templates used to represent the 3D object: As this number increases, it is more likely that a greater number of false positives will be obtained when detecting the object in a cluttered environment [43]. Finally, another critical factor is the similarity score used, as a low value may produce false positives and a too high similarity score would make it such that the object will not be detected in the image. Various methods can be found in the literature which attempt to solve this problem using post-processing techniques, such as the use of color information and the ICP algorithm [15] or template clustering [43].