# Retro-Reflective-Marker-Aided Target Pose Estimation in a Safety-Critical Environment
## 2 Methods
### Marker Detection and Identification
It is closer to 0 for a circle-like object, and closer to 1 for a line-like object. If after the elimination step, the number of identified markers is less than expected, the procedure returns to the segmentation step and prompts the operator to adjust the segmentation parameters. If after the elimination step, the number of candidate markers is higher than expected, markers are grouped into clusters according to their features, creating an agglomerative hierarchical cluster tree. Selected features are: area, perimeter, circularity, solidity, convex area, equivalent diameter, extent, minimum Feret diameter and maximum, and minimum intensity of the grayscale blob. Solidity describes the extent to which a shape is convex or concave. It corresponds to the ratio between the area and the convex area (area enclosed by a convex hull). The equivalent diameter corresponds to the diameter of a circle with the same area as the region. Extent refers to the ratio of pixels in the region to pixels in the total bounding box. The minimum Feret diameter expresses the minimum distance between any two boundary points on the antipodal vertices of the convex hull that encloses the object. Data values are normalized before computing similarity and the Euclidean distance is used as a distance metric. The hierarchical tree is pruned at the lowest branch, where a class of eight elements can be found. A single feature point is found within each marker by calculating the centroid coordinates \((x_{0},y_{0})\):  
\[x_{0}=\frac{\sum_{i=1}^{w}\sum_{j=1}^{h}x_{i}\cdot I_{ij}^{BW}}{\sum_{i=1}^{w} \sum_{j=1}^{h}I_{ij}^{BW}},\quad y_{0}=\frac{\sum_{i=1}^{w}\sum_{j=1}^{h}y_{i} \cdot I_{ij}^{BW}}{\sum_{i=1}^{w}\sum_{j=1}^{h}I_{ij}^{BW}}\, \tag{7}\]  
where \(w,h\) represent the size of the window in which the centroid is being computed and \(I_{ij}^{BW}\) represents the value of the binary image at coordinate \((i,j)\). By making the approximation that the centroid of the detected markers corresponds to the center of the original circles, we disregard the perspective bias [44] introduced by perspective projection. We assume that the camera and target have been roughly aligned and, consequently, that the value of the perspective bias is rather small. In order to establish a one-to-one correspondence between the known relative marker positions in the world coordinate frame and the detected image coordinates, the detected markers must be correctly ordered. The proposed marker ordering approach is shown in Figure 7 and finds the line passing through four of the proposed markers. This is achieved by computing all possible combinations of the markers in groups of two (28 groups), fitting a line to each marker pair and finding the six groups of parameters corresponding to the same line using agglomerative hierarchical clustering. The hierarchical cluster tree is pruned at the lowest point, where there is a class composed of five elements. After the line has been determined, the remaining four points can be projected onto the line, and markers can be discriminated from their distance along the line to the origin marker. Pose estimation refers to the calculation of the rigid body transformation between the camera and the target (\(T_{C1_{i}}^{K}\)) based on a set of detected 2D image points and 3D known world point correspondences. Pose estimation has been extensively studied in the literature, and many iterative and non-iterative methods have been proposed to solve the problem under different conditions, depending on the number of available point correspondences, presence of outliers, how noisy their coordinates are, whether the problem has to be solved online or offline, and if the camera parameters are known or estimated simultaneously [45; 46; 47]. In our application, control points are known to be co-planar and are detected with a relatively high degree of accuracy.