right now i am working on a computer vision project and will recognize fiducial markers, i created a simulation testbed for benchmarking the precision of different methods. E.g. i do rotate the markers and later try to get the rotation (orientation) of the marker from the captured images.
The marker is always rotated around the z-axis, with following euler-angles:
$r_{gt} = [\alpha_0, \beta_0, \gamma_0]$
let say we have recognized the amrker in the image with following orientation to the world corrdinate (both orienations were measured w.r.t. world coordinate)
$r_{i} = [\alpha_i, \beta_i, \gamma_i]$
$d(r_0, r_i) = ? $
Now my quastion is how can i measure the distance between the two rotations? i already did check out this link Quaternion distance.
Plz if you give an answer also give the referrence link, where i can investigate about this topic!
Euler angles are not good for computing metrics as they have no proper symmetries. I suggest (since the question is tagged under
quaternions) you convert your two orientations to quaternions $p$ and $q$. Then:First, assuming by distance you mean how far apart are two rotations.
Second, knowing that quaternions have a double cover of the rotation manifold, that is, $q$ and $-q$ represent the same rotation.
Third, from second, say that the 'distance' from any quaternion $q=(w,x,y,z)$ to the identity quaternion $(1,0,0,0)$ makes sense if $w>0$. Otherwise, for $w<0$, the distance should be computed to the 'other' identity $(-1,0,0,0)$, which is indeed closer; or equivalently, one would find the distance between $-q$ and the true identity $(1,0,0,0)$.
Fourth, the distance between two quaternions $p$ and $q$ can be found as follows:
Note: having unit quaternions $q=[\cos(\phi/2), u_x \sin(\phi/2), u_y \sin(\phi/2), u_z \sin(\phi/2)]$, the log can be found by inspection, but if only the distance is sought, this distance $\phi$ can be found by just:
Fifth. You can use a shortcut by considering just double the angle between the two quaternions seen as 4'vectors, ie, $$ \cos \theta = p^\top q \rightarrow \phi = 2\theta = 2\arccos (p^\top q) $$ If $\cos\theta<0$, change the sign of one of the quaternions and start over.
All this info can be found here https://arxiv.org/abs/1711.02508