Hexagonal lattice rotated

Hexagonal lattice rotated
Matching pairs of two regular lattices circled

Wednesday, October 23, 2019

Matching segments

There are a lot of heuristics for segment matching. Most of them can be grouped by how many invariances they support (none , L, O, S, LO, OS, LS). Note that the full invariance (LOS) makes all segments equal! We provide a 'none' version with 3 numerical indicators. It can be tuned to other 6 invariance categories easily. Two segments $s_1=(a,b)$ and $s_2=(c,d)$ with lengths $l_1,l_2$ and the orientation angle are depicted below.

The mutual orientation of two segments comes first.
We use edge vectors $v_1=a-b,\,v_2=c-d$ where the orientation of the edges ($(a,b)$ or $(b,a)$))  does not matter as long as we choose the orientation angle $\phi:=min(\phi,\pi-\phi)$ afterwards.
One can utilize the following differentials: $d\|v\|=v^0\cdot dv$ and: \[
d(v^0)= \|v\|^{-1}\left[I- v^0v^{0T}\right]dv
\]
So, e.g. the orientation $\phi=\cos^{-1}(v_1^0\cdot v_2^0)$ and, by defining $s=v_1^0\cdot v_2^0$ ($s$ for 'scalar product), one gets: \[
   d\phi= -(1-s^2)^{-1/2}\left[
      \|v_1\|^{-1}(1-v_1^0v_1^{0T})dv_1\cdot v_2^0 +
      \|v_2\|^{-1}(1-v_2^0v_2^{0T})dv_2\cdot v_1^0
     \right]
\]
To get a statistical limit $\Phi= ...$, one has to assume e.g. the i.i.d distribution of points, which
leads to: $dv_1=dv_2= \sigma\mathbf{1}$ to be substituted to the above Equation, with a slight abuse of differential analysis conventions.

The relative location of the segments can be addressed by observing the difference $v_3=(a+b)/2 - (c+d)/2$ between segment centers. Then $dv_3= (da+db-dc-dd)/2$, and the statistical limit is: $V=4\sigma$.

The scale difference is addressed by the difference $\Delta l$ of the lengths $\Delta l= l_1 - l_2$.
Now: $d\Delta l=v_1^0\cdot dv_1 - v_2^0\cdot dv_2$ and the statistical limit: \[
L= \sqrt{2}\sigma(v_1^0+ v_2^0)\cdot\mathbf{1}.
\]

Now, all three aspects can be addressed e.g. by: \[
   f= \max(d\phi/\Phi, dv_3/V, d\Delta l/L),
\]
where $\sigma$ is chosen suitably, e.g. to match 1 s.t.d. or 2 s.t.d. Note that the $d\phi$ has
some simplifications and approximations, especially for the term
$\sigma(1-v_1^0v_1^{0T})\mathbf{1}\cdot v_2^0$.

No comments:

Post a Comment