Digitized Reflections and Rotations with Geometric Algebra

Stéphane Breuils, Yukiko Kenmochi, Akihiro Sugimoto

Motivation

Digitized rotations not bijective in general

Digitized rotation

Inverse digitized rotation

Motivation

Non-bijective digitized rotations in \(\mathbb{Z}^2 \)

\( \theta = \frac{\pi}{4} \)

Out : double points,

holes !

Input image

Digital Geometry and

Geometric Algebra (GA)

New bijective rotations from bijective digitized reflections

Geometric Algebra?

Vectors

Multivectors \( \mathbf{a},\mathbf{b} \)

Product

Geometric product

\(\mathbf{a}  \mathbf{b} =  \mathbf{a}\cdot \mathbf{b} + \mathbf{a} \wedge \mathbf{b}  \)

\( \mathbf{a}\mathbf{b} = (a_1 \mathbf{e}_1 + a_2\mathbf{e}_2) ( b_1\mathbf{e}_1 + b_2\mathbf{e}_2) =  (a_1b_1 + a_2b_2) + (a_1b_2 - a_2b_1) \color{red}\mathbf{e}_{12}  \)

if \( \mathbf{a},\mathbf{b} \in \mathbb{R}^2 \)

Why geometric algebra?

Reflections

\( {\color{green}\mathbf{y}} = -{\color{blue}\mathbf{m}} {\color{red}\mathbf{x}} {\color{blue}\mathbf{m}^{-1}} \)

Why geometric algebra?

Reflections to rotations 

\( {\color{green}\mathbf{y}} = \mathbf{Q} {\color{red}\mathbf{x}} \mathbf{Q}^{-1} \)

\( \mathbf{Q} = \color{blue}\mathbf{m}\mathbf{n} \)

Why geometric algebra?

Reflections, rotations (and translations)

\( \mathbf{Q} = \color{blue}\mathbf{m}\mathbf{n} =  \cos{\frac{\theta}{2}} + \sin{\frac{\theta}{2}} \mathbf{e}_{12} \) \( (2D)\)

\( \bullet \) defined for any dimension

\( \bullet \) generic and easy to manipulate

 

Knowing \(\mathbf{m} \) normal vector to the line of reflection, reflection of \( \mathbf{x} \) : 

\( \mathbf{y} = -\mathbf{m} \mathbf{x} \mathbf{m}^{-1} \)

Product \(\mathbf{m} \mathbf{n} \), rotation of \( \mathbf{x} \) : 

Bijective digitized reflections ?

Operators

Digitized reflections 

\( \bullet \) Reflections \( \mathcal{U}^{\mathbf{m}} \)

\( \bullet \) Digitized operator \( \mathcal{D} \)

\left| \begin{array}{cccc} \mathcal{D} : & \mathbb{R}^d & \rightarrow & \mathbb{Z}^d \\ & \sum_{i=1,\ldots,d} u_i \mathbf{e}_i & \mapsto & \sum_{i=1,\ldots,d} \lfloor u_i + \frac{1}{2} \rfloor \mathbf{e}_i \end{array} \right.
\left| \begin{array}{cccc} \mathcal{R}^{\mathbf{m}} : & \mathbb{Z}^d & \rightarrow & \mathbb{Z}^d \\ & \mathbf{x} & \mapsto & \mathcal{D} \circ \mathcal{U}^{ \mathbf{m} } (\mathbf{x}) \end{array} \right.

\( \bullet \) Digitized reflection \( \mathcal{R}^{\mathbf{m}}\)

\left| \begin{array}{cccc} \mathcal{U}^{ \mathbf{m} } : & \mathbb{R}^d & \rightarrow & \mathbb{R}^d \\ & \mathbf{x} & \mapsto & -\mathbf{m} \mathbf{x} \mathbf{m}^{-1} = -\frac{1}{\Vert \mathbf{m} \Vert^2}\mathbf{m} \mathbf{x} \mathbf{m}. \end{array} \right.

Digitized cell

\( \bullet \) Equivalent to the Voronoi cell definition

\begin{array}{rll} \mathcal{C}_{\mathcal{T}}(\kappa) := \big\{ \mathbf{x} \in \mathbb{R}^d , \forall i\in [ 1,d ] & & || \mathbf{x}- \kappa || \leq || \mathbf{x}- \kappa + \mathcal{T} \mathbf{e}_i \mathcal{T}^{\dagger} || \\ \text{ and } & & || \mathbf{x}- \kappa || < || \mathbf{x}- \kappa - \mathcal{T} \mathbf{e}_i \mathcal{T}^{\dagger} || \big\}. \end{array}

\( \mathcal{C}_{1}(\mathbf{0})\)

\( \mathcal{C}_{1}(\mathbf{t})\)

\( \mathbf{t} = 3 \mathbf{e}_1 + 2 \mathbf{e}_2\)

Digitized cell

\( \bullet \) Equivalent to the Voronoi cell definition

\begin{array}{rll} \mathcal{C}_{\mathcal{T}}(\kappa) := \big\{ \mathbf{x} \in \mathbb{R}^d , \forall i\in [ 1,d ] & & || \mathbf{x}- \kappa || \leq || \mathbf{x}- \kappa + \mathcal{T} \mathbf{e}_i \mathcal{T}^{\dagger} || \\ \text{ and } & & || \mathbf{x}- \kappa || < || \mathbf{x}- \kappa - \mathcal{T} \mathbf{e}_i \mathcal{T}^{\dagger} || \big\}. \end{array}

\(\mathcal{C}_{\frac{\mathbf{m}}{||\mathbf{m} || }} (\mathbf{0}) \)

Set of remainder

\left| \begin{array}{cccc} \mathcal{S}^{ \mathbf{m} } : & \mathbb{Z}^2 \times \mathbb{Z}^2 & \rightarrow & \mathbb{R}^2 \\ & (\mathbf{x}, \mathbf{y}) & \mapsto & \mathcal{U}^{ \mathbf{m} }(\mathbf{x}) - \mathbf{y} \end{array} \right.

\( \bullet \) Definition

\( \mathcal{C}_{1}(\mathbf{0}) \)

\( \mathcal{C}_{1}(\mathbf{0}) \)

Bijectivity condition

\( \bullet \) Bijectivity condition

\left\{ \begin{array}{l} \forall \mathbf{y} \in \mathbb{Z}^2, \exists \mathbf{x} \in \mathbb{Z}^2, \mathcal{S}^{\mathbf{m}}(\mathbf{x},\mathbf{y}) \in \mathcal{C}_{1}(\mathbf{0}) \\ \forall \mathbf{x} \in \mathbb{Z}^2, \exists \mathbf{y} \in \mathbb{Z}^2, \mathcal{S}^{\mathbf{m}}(\mathbf{x},\mathbf{y}) \in \mathcal{C}_{\frac{\mathbf{m}}{||\mathbf{m} || }}(\mathbf{0}) \\ \end{array} \right.

\( \mathcal{C}_{\frac{\mathbf{m}}{||\mathbf{m} ||}}(\mathbf{0}) \)

\( \mathcal{C}_{1}(\mathbf{0}) \)

Bijective?

\( \mathcal{C}_{\frac{\mathbf{m}}{||\mathbf{m} ||}}(\mathbf{0}) \)

\( \mathcal{C}_{1}(\mathbf{0}) \)

\( \mathcal{C}_{1}(\mathbf{0}) \)

\( \mathcal{C}_{1}(\mathbf{0}) \)

Bijective reflection

Non-bijective reflection

Find bijective digitized reflections 

\( \bullet \) Idea: use bijectivity condition of digitized rotations

    (Jacob, Andres, Nouvel, Roussillon, Coeurjolly)

\begin{array}{cl} \{\cos(\theta),\sin(\theta)\} = \Big\{ \frac{2k+1}{2k^2 + 2k+1}, \frac{2k(k+1)}{2k^2 + 2k+1} \Big\}, k\in \mathbb{N} \end{array}

\( \bullet \) Geometric algebra, rotation of angle \(\theta\) of an object \(\mathbf{x}\):

\mathbf{x}'= \mathbf{Q} \mathbf{x} \mathbf{Q}^{-1}
\mathbf{Q} = \cos{\frac{\theta}{2}} + \sin{\frac{\theta}{2}} \mathbf{e}_{12}
\mathbf{Q} = (k+1) + k \mathbf{e}_{12}, \quad k \in \mathbb{N}.

Find bijective digitized reflections

\( \bullet \) Idea

     \( m_b \) : digitized bijective reflection 

\(\Leftrightarrow \) \(-\mathbf{e}_1 m_b \mathbf{e}_1^{-1}\) is also a bijective digitized reflection

\(\Leftrightarrow \) \(-\mathbf{e}_1 (a \mathbf{e}_1 + b \mathbf{e}_1) \mathbf{e}_1^{-1}  \) is also a bijective  digitized reflection

 

 

\( \bullet \) Insert in the definition of digitized reflection 

\(\Leftrightarrow \mathbf{e}_1 \mathbf{m}_b \mathbf{e}_1^{-1} \mathbf{x} \mathbf{e}_1 \mathbf{m}_b^{-1} \mathbf{e}_1^{-1} \)

\(\Leftrightarrow (\mathbf{e}_1 \mathbf{m}_b) (\mathbf{e}_1^{-1} \mathbf{x} \mathbf{e}_1) (\mathbf{e}_1 \mathbf{m}_b) ^{-1} \)

reflection of \(  \mathbf{x} \) w.r.t.  \( \mathbf{e}_2\) axis 

Bijective digitized reflections

\(\Leftrightarrow (\mathbf{e}_1 \mathbf{m}_b) (\mathbf{e}_1^{-1} \mathbf{x} \mathbf{e}_1) (\mathbf{e}_1 \mathbf{m}_b) ^{-1} \)

\( \bullet \) \( \mathbf{e}_1 \mathbf{m}_b \)?

\( \mathbf{e}_1 (a \mathbf{e}_1 + b \mathbf{e}_2) = a  + b \mathbf{e}_{12}\)

 

\( \rightarrow \)homogeneous to the operator performing a rotation in geometric algebra 

\( \bullet \) \( a,b \) ?

\mathbf{Q} = \cos{\frac{\theta}{2}} + \sin{\frac{\theta}{2}} \mathbf{e}_{12} = (k+1) + k\mathbf{e}_{12}, \quad k \in \mathbb{N}.

\( \mathbf{m}_b = (k+1) \mathbf{e}_1 + k \mathbf{e}_2, k\in \mathbb{N} \)

Angular distribution of digitized reflections 

Distribution of bijective digitized reflections 

bijective digitized reflections

bijective digitized rotations

Bijective approximation of rotations from bijective digitized reflections 

Approximations for reflections

Input: any digitized reflection 

Problem: find the "nearest" bijective digitized reflection  

Approximation

Approximations and bijectivity

k= \displaystyle \argmin_{\widetilde{k} \in \{ \lfloor \frac{y}{x - y} \rfloor , \lceil \frac{y}{x - y} \rceil \}} \bigg\vert \frac{ \widetilde{k}x - (\widetilde{k}+1)y }{(\widetilde{k} +1)x+\widetilde{k} y} \bigg\vert

digitized reflection \( \mathbf{m} \)

bijective approximation \( \widetilde{\mathbf{m}} \)

\displaystyle \argmin_{\mathcal{U}^{\widetilde{\mathbf{m}}} \in \mathbf{B}_{k_{\max}}} \Big\vert \widetilde{\theta} - \theta \Big\vert

Digitized rotations and approximation

Bijective digitized rotations from reflections

  • Composition of a digitized reflection (axis \( \mathbf{e}_{1} \)) and a bijective digitized reflection \(  \rightarrow   \) bijective digitized rotation 

Composition of two bijective digitized reflections

\( \rightarrow \) bijective approximation of a digitized rotation

Idea:

\( \hookrightarrow \) Approximate a Euclidean rotation of angle \( \theta\) from 2 bijective reflections 

How to choose the 2 digitized reflections?

Bijective digitized rotations from reflections

\( \hookrightarrow \) Constraint: angle between the 2 normal vectors is \( \frac{\theta}{2} \)

        where \( \theta\) is the rotation angle 

Method

\( \bullet \) Given \( k_{\max} \) and \(\mathbf{B}_{k_{\max}} \) (bijective reflections)

 

\( \bullet \) loop over all bijective reflections \( \mathbf{m}_{1} \in \mathbf{B}_{k_{\max}} \)

 

\( \bullet \) Look for \( \mathbf{m}_{2} \) such that the relative angle between \(\mathbf{m}_{1} \) and \(\mathbf{m}_{2} \) is half the angle of rotation

 

\( \bullet \) Return the couple \( \mathbf{m}_{1},\mathbf{m}_{2} \) whose relative angle is the closest to \( \frac{\theta}{2} \)

Bijective digitized rotations from reflections

Resulting distribution

bijective digitized reflections

bijective digitized rotations

approximation

With image in DGtal

\( \hookrightarrow \) No double points

\( \hookrightarrow \) No holes

Original

Bijective Approximation of a digitized rotation

Inverse transformation

Limits

\( \bullet \) Guarantee bijectivity but  

    \( \hookrightarrow \) Convexity, topology not preserved compared to backward transformation!

Contributions and perspectives

New bijective digitized rotations from digitized reflections

\( \hookrightarrow \) more bijective digitized rotations 

\( \hookrightarrow \) simple method

\( \hookrightarrow \) can be extended...

 

Perspectives

\( \hookrightarrow \) For subset of \( \mathbb{Z}^2 \) : preservation of the topology, convexity... ?

\( \hookrightarrow \) Bijectivity of digitized reflections in the space

\( \hookrightarrow \) comparison with the main methods to perform bijective rotations like

    quasi-shears, FFT, rotations from reflections with digital lines (Andres), ...

Thank you for your attention!

 

Questions?

Appendix

Subset of \( \mathbb{Z}^2 \)

Bijective digitized reflections

\( \mathbb{Z}^2 \)

\( 20 \times 20 \) points of \(\mathbb{Z}^2\)

\( 10 \times 10 \) points of \(\mathbb{Z}^2\)

New bijective digitized reflections 

Subset of \( \mathbb{Z}^2 \)

Among those bijective digitized reflections

\( \hookrightarrow \) Preservation of topology (simple points by Couprie, Ngo)?

\( \hookrightarrow \) Preservation of the convexity (IsFullyConvex by Lachaud)?

\( \hookrightarrow \) Preservation of the area?