# Multi-Tag Fusion Localization Method Based on Geometric Constraints
## 3 Construction of Geometric Constraints  
When multiple tags are detected in an image, the positioning data extracted from different tags possess varying degrees of uncertainty. This implies that some observed values may have significant errors, and these outliers can substantially affect the final positioning outcome. As depicted in Figure 4, at the same moment, observed values \(i\), \(j\), and \(k\) are obtained. Under ideal circumstances, observed values \(i\), \(j\), and \(k\) should coincide with the true position. However, due to factors such as location and lighting, deviations occur between the observed values and the actual position. In statistical terms, an outlier is defined as one or several values within a dataset that differ significantly from the rest, constituting abnormal data. This paper constructs geometric constraints to measure the variability among observed values, thereby identifying and eliminating outliers.  
Consider any two observed values, \(i\) and \(j\). The coordinates of observed value \(i\) in the world coordinate system are \([x_{i},y_{i},z_{i}]\), and the angle it makes with the X-axis is \(\angle\)a. The coordinates of observed value \(j\) in the world coordinate system are \([x_{j},y_{j},z_{j}]\), and the angle it makes with the X-axis is \(\angle\)b.  
In the XOY plane, the difference in distance between any two observed values, \(l_{ij}\), can be calculated as  
\[l_{ij}=\sqrt{(x_{i}-x_{j})^{2}+(y_{i}-y_{j})^{2}} \tag{9}\]  
To calculate the angular difference \(d_{ij}\), first determine the angles \(\angle\)a and \(\angle\)b:  
\[\left\{\begin{array}{l}a=\arctan(\frac{y_{i}}{x_{i}})\\ b=\arctan(\frac{y_{j}}{x_{j}})\end{array}\right. \tag{10}\]  
Then, find the difference in angles:  
\[d_{ij}=|a-b| \tag{11}\]  
If there are a total of N observed values, by combining them in pairs to construct geometric constraints and calculating the corresponding distances \(l_{ij}\) and angular differences \(d_{ij}\), \(G(N)\) combinations are needed in total. The number of combinations is given by the binomial coefficient:  
\[G(N)=C_{N}^{2}=\frac{N!}{(N-2)!2} \tag{12}\]  
Each observed value will participate in (N \(-\) 1) geometric constraint constructions, resulting in (N \(-\) 1) different \(l_{ij}\) and \(d_{ij}\). The sum of the distance differences for each observed value with respect to the other observed values is  
\[l_{i}=\sum_{j=1}^{N-1}l_{ij} \tag{13}\]  
The sum of the angular differences for each observed value with respect to the other observed values is  
\[d_{i}=\sum_{j=1}^{N-1}d_{ij} \tag{14}\]  
Figure 4: Schematic representation of the geometric constraints.  
An outlier factor, \(S(i)\), is introduced and defined using a normalization method based on the maximum and minimum values to describe the variability between observed values from both distance and angular differences:  
\[S(i)=k_{1}\frac{l_{i}-\min(l_{i})}{\max(l_{i})-\min(l_{i})}+k_{2}\frac{d_{i}- \min(d_{i})}{\max(d_{i})-\min(d_{i})} \tag{15}\]  
In the equations, the weight coefficient \(k_{1}\), \(k_{2}\) is used, which must satisfy  
\[k_{1}+k_{2}=1 \tag{16}\]  
\[\begin{array}{l}\max(l_{i})=\max[l_{1},\ldots,l_{i},\ldots,l_{N-1}]\\ \min(d_{i})=\min[d_{1},\ldots,d_{i},\ldots,d_{N-1}]\end{array} \tag{17}\]