# Dynamic Queries through Augmented Reality for Intelligent Video Systems
## Appendix A  
To be a metric, Equation (6) must satisfy the following four properties:  
1. \(d(x,y)=0\Leftrightarrow x=y\), i.e., the distance from a point to itself is zero;
2. \(d(x,y)\geq 0\) positivity;
3. \(d(x,y)=d(y,x)\) symmetry;
4. \(d(x,z)\leq d(x,y)+d(y,z)\) triangle inequality.  
Demonstration of the properties with the proposed metric.  
1. \(d_{ii}(d,e)=0\). According to Equation (5), the term on the left can be expressed as follows: \(M_{ii}(d,e)-m_{ii}(d,e)=0\). Expanding the terms, we have \[max(I(f_{i},d,e),I(f_{i},d,e))-min(I(f_{i},d,e),I(f_{i},d,e))=0.\] (1) In general terms \(I(f_{i},d,e)=k\), so, by substituting it into Equation (1), it follows that \(max(k,k)=k\) y \(min(k,k)=k\)--in other words \(k-k=0\).
2. \(d_{ij}(d,e)\geq 0\). Si \(d_{ij}(d,e)=0\). If \(d_{ij}(d,e)=0\), then, at that time, \(d_{ii}(d,e)=0\); otherwise, the first term on the left can be expressed as \(M_{ij}(d,e)-m_{ij}(d,e)\geq 0\). Expanding the terms, we have \[max(I(f_{i},d,e),I(f_{j},d,e))-min(I(f_{i},d,e),I(f_{j},d,e))\geq 0.\] (2) Again, generally \(I(f_{i},d,e)=k\) y \(I(f_{j},d,e)=l\). Using Equation (2), we have the following options: * \(k>0\) y \(l<0\). Becomes \(k>l\). * \(k>0\) y \(l>0\). Then \(max(k,l)-min(k,l)>0\). * \(k<0\) y \(l<0\). Becomes \(max(k,l)-min(k,l)>0\), because \(k\) y \(l\) are negatives. * \(k<0\) y \(l>0\). Then \(l>k\).
3. \(d_{ij}(d,e)=d_{ii}(d,e)\). The left-hand term can be expanded to \(d_{ij}(d,e)=M_{ij}(d,e)-m_{ij}(d,e)\); \(d_{ij}(d,e)=M_{ij}(d,e)-m_{ji}(d,e)\). Applying the auxiliary function defined in Equation (5), we can rewrite this as follows: \[\begin{array}{l}d_{ij}(d,e)=max(I(f_{i},d,e),I(f_{j},d,e))-min(I(f_{i},d,e), I(f_{j},d,e))\\ d_{ji}(d,e)=max(I(f_{j},d,e),I(f_{i},d,e))-min(I(f_{j},d,e),I(f_{i},d,e)).\end{array}\] (3)Assuming that \(I(f_{i},d,e)=k\) y \(I(f_{j},d,e)=l\), then Equation (A3) can be represented as:  
\[\begin{array}{c}d_{ij}(d,e)=max(k,l)-min(k,l)\\ d_{ji}(d,e)=max(l,k)-min(l,k),\end{array}\] (A4)  
so that \(d_{ij}(d,e)=d_{ji}(d,e)\) can be expressed by  
\[max(k,l)-min(k,l)=max(l,k)-min(l,k).\] (A5)  
If \(k>l\)  
\[k-l=k-l.\] (A6)  
If \(l>k\)  
\[l-k=l-k.\] (A7)  
If \(k=l\)  
\[\begin{array}{c}k-l=0\\ l-k=0\\ \therefore\\ 0=0.\end{array}\] (A8)  
4. \(d_{ik}(d,e)\leq d_{ij}(d,e)+d_{jk}(d,e)\). The expression on the left can be rewritten as follows: \([max(I(f_{i},d,e),I(f_{k},d,e))-min(I(f_{i},d,e),I(f_{k},d,e))]\leq[max(I(f_{i },d,e),I(f_{j},d,e))-min(I(f_{i},d,e),I(f_{j},d,e))]+[max(I(f_{j},d,e),I(f_{k}, d,e))-min(I(f_{j},d,e),I(f_{k},d,e))]\)  
Assuming that \(I(f_{i},d,e)=A_{i}\), \(I(f_{j},d,e)=A_{j}\), \(I(f_{k},d,e)=A_{k}\), then only one of the following cases is possible: (a) \(A_{i}>A_{j}>A_{k}:A_{i}-A_{k}\leq(A_{i}-A_{j})+(A_{j}-A_{k})\); (b) \(A_{i}>A_{k}>A_{j}:A_{i}-A_{k}\leq(A_{i}-A_{j})+(A_{k}-A_{j})\); (c) \(A_{k}>A_{i}>A_{j}:A_{k}-A_{i}\leq(A_{i}-A_{j})+(A_{k}-A_{j})\); (d) \(A_{k}>A_{j}>A_{i}:A_{k}-A_{i}\leq(A_{j}-A_{i})+(A_{k}-A_{j})\); (e) \(A_{j}>A_{i}>A_{k}:A_{i}-A_{k}\leq(A_{j}-A_{i})+(A_{j}-A_{k})\); (f) \(A_{j}>A_{k}>A_{i}:A_{k}-A_{i}\leq(A_{j}-A_{i})+(A_{j}-A_{k})\). With these verifications, it was concluded that \(d_{ij}(d,e)\) is a metric, which is what we wanted to demonstrate.