# Retro-Reflective-Marker-Aided Target Pose Estimation in a Safety-Critical Environment
## 2 Methods
### Marker Detection and Identification  
The preliminary step to position estimation is the determination of correspondences between 2D image features and known 3D world points. The developed marker detection and identification approach is shown in Figure 6.  
It relies on the prior knowledge of the characteristics of the markers and their layout with respect to each other. We perform marker detection and identification independently for each camera image to keep the approach flexible and suitable for the monocular case. The workflow of marker detection starts with image capture, linearization, and undistortion. Images are segmented into foreground (markers) and background through adaptive thresholding as follows:  
\[I_{x,y}^{BW}= \begin{cases}1,&\text{if }I_{x,y}>s\ med_{x,y}+T\\ 0,&\text{otherwise}\end{cases} \,. \tag{5}\]  
Here, \(I_{x,y}^{BW}\) represents the value of the resulting binary image at pixel coordinates (x,y), while \(I_{x,y}\) represents the value of the original gray-scale image at the corresponding coordinate points. \(med_{x,y}\) represents the median of the \(w\times h\) surrounding pixels at coordinate (x,y). Adaptive thresholding preserves hard contrast lines while ignoring soft gradient changes. Our approach resembles the methods of [40]. However, it compares each image pixel to the median of the \(w\times h\) surrounding pixels, instead of their average, since this approach effectively removes outliers and better preserves details and edges. The value \(s\) is a scale factor that contributes to the classification of more or fewer pixels as foreground. We have modified the original method by adding a constant value, \(T\), to the threshold matrix, with the intent of exploiting the fact that the intensity difference between the markers and the background is more significant than in the diffuse marker case. Even though the retro-reflective markers are considerably brighter than their surroundings, the large specular reflections of the cassette surface and some degree of inhomogeneity of the lighting conditions deem advantageous the use of a local thresholding method. However, this has a tendency to increase the number of false blobs detected in the background, which will be handled by morphological filtering. In the following processing steps, several techniques are utilized to determine the suitability of marker candidates. If these point to an incorrect segmentation, the software returns to the thresholding step and the operator is asked to intervene by modifying the threshold parameters in small incremental steps. Decreasing \(s\) and/or \(T\) will lead to a higher number of pixels being classified as foreground. While manually refining the parameters, the operator is presented with the thresholded image and the result of the overall marker detection pipeline. After segmentation, each marker is represented by an array of blobs that are merged into a single elliptical shape by applying morphological closing and flood-fill operations [41], consecutively followed by determination of the binary convex hull image. The blobs in the resulting image are identified by connected component labeling [42] and  
Figure 6: Workflow of image processing operations leading to marker detection and identification. non-markers are excluded through the comparison of several properties of the connected compound elements to appropriate thresholds. We consider that markers often differ from the remaining blobs with respect to their size (area) and/or and shape (circularity and eccentricity). Circularity is defined by the following ratio:  
\[Circularity=\frac{4\pi Area}{Perimeter^{2}} \tag{6}\]  
and has a minimum value of 1 for a circular disk, and is greater than 1 for all other geometric features. For an ellipse, it increases with the imaging angle monotonously and has a value of 1.5 at 60 degree angle [43]. Eccentricity describes the ratio of the distance between the foci and major axis length of the ellipse that has the same second-moments as the region.