Skip to main content

Homotopic Affine Transformations in the 2D Cartesian Grid

Abstract

Topology preservation is a property of affine transformations in \({{{\mathbb {R}}}^2}\), but not in \({{\mathbb {Z}}}^2\). In this article, given a binary object \({\mathsf {X}} \subset {{\mathbb {Z}}}^2\) and an affine transformation \({{\mathcal {A}}}\), we propose a method for building a binary object \(\widehat{{\mathsf {X}}} \subset {{\mathbb {Z}}}^2\) resulting from the application of \({{\mathcal {A}}}\) on \({\mathsf {X}}\). Our purpose is, in particular, to preserve the homotopy type between \({\mathsf {X}}\) and \(\widehat{{\mathsf {X}}}\). To this end, we formulate the construction of \(\widehat{{\mathsf {X}}}\) from \({{\mathsf {X}}}\) as an optimization problem in the space of cellular complexes, and we solve this problem under topological constraints. More precisely, we define a cellular space \({{\mathbb {H}}}\) by superimposition of two cellular spaces \({{\mathbb {F}}}\) and \({{\mathbb {G}}}\) corresponding to the canonical Cartesian grid of \({{\mathbb {Z}}}^2\) where \({{\mathsf {X}}}\) is defined, and a regular grid induced by the affine transformation \({{{\mathcal {A}}}}\), respectively. The object \(\widehat{{\mathsf {X}}}\) is then computed by building a homotopic transformation within the space \({{\mathbb {H}}}\), starting from the complex in \({{\mathbb {G}}}\) resulting from the transformation of \({\mathsf {X}}\) with respect to \({{\mathcal {A}}}\) and ending at a complex fitting \(\widehat{{\mathsf {X}}}\) in \({{\mathbb {F}}}\) that can be embedded back into \({{\mathbb {Z}}}^2\).

This is a preview of subscription content, access via your institution.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5

Notes

  1. These quasi-affine transformations are close to the class of affine transformations that we consider in this article. They mainly differ regarding the digitization policy: quasi-affine transformations rely on the floor function, whereas we will consider the rounding function.

  2. If there exist \(V_1 = \{\mathbf{v_1}\} \in {\mathcal {V}}(P_1)\) and \(E_2 = \ ]\mathbf{v^1_2},\mathbf{v^2_2}[ \ \in {\mathcal {E}}(P_2)\) such that \(V_1 \subset E_2 \) then, without loss of correctness, we can “modify” the polygon \(P_2\) by adding \(V_1\) into \({\mathcal {V}}(P_2)\) and by substituting \(]\mathbf{v^1_2},\mathbf{v_1}[\) and \(]\mathbf{v_1},\mathbf{v^2_2}[\) to \(]\mathbf{v^1_2},\mathbf{v^2_2}[\) in \({\mathcal {E}}(P_2)\).

  3. In theory, this notation will also hold when considering \(\mathbb R^2\) instead of \(\varOmega \). In practice, we will always use a bounded subset \(\varOmega \) of \(\mathbb R^2\).

  4. This is equivalent to say that the intersection of the border of \(C(\mathfrak {f}_2)\) (i.e. \(C(\mathfrak {f}_2) \setminus \{\mathfrak {f}_2\}\)) and (see Eq. 8) has a Euler characteristics of 1 (and is then also non-empty and connected), which is a necessary and sufficient condition for simpleness in dimension 2.

  5. The choice of Gauss digitization is relevant with respect to Step (1) since we have

  6. There exists one such \(\langle \mathbf{h}_1,\ldots ,\mathbf{h}_i,\ldots \mathbf{h}_t \rangle \) which is not a 2-face, and that corresponds to the boundary of \({\mathbb {H}}(Q)\). It is characterized by the fact that it contains the four points \(\mathbf{q}^{0,0}\), \(\mathbf{q}^{w,0}\), \(\mathbf{q}^{0,w}\) and \(\mathbf{q}^{w,w}\).

  7. In practice, considering any 3 points \(\mathbf{h}_i\) would be enough for our purpose.

References

  1. Amir, A., Butman, A., Lewenstein, M., Porat, E.: Real two dimensional scaled matching. Algorithmica 53, 314–336 (2009)

    Article  MathSciNet  Google Scholar 

  2. Amir, A., Kapah, O., Tsur, D.: Faster two-dimensional pattern matching with rotations. Theor. Comput. Sci. 368, 196–204 (2006)

    Article  MathSciNet  Google Scholar 

  3. Amir, A., Landau, G.M., Vishkin, U.: Efficient pattern matching with scaling. J. Algoritm. 13, 2–32 (1992)

    Article  Google Scholar 

  4. Andres, É.: The quasi-shear rotation. In: DGCI. pp. 307–314 (1996)

  5. Andres, É., Dutt, M., Biswas, A., Largeteau-Skapin, G., Zrour, R.: Digital two-dimensional bijective reflection and associated rotation. In: DGCI. pp. 3–14 (2019)

  6. Anglin, W.S.: Using Pythagorean triangles to approximate angles. Am. Math. Mon. 95, 540–541 (1988)

    Article  MathSciNet  Google Scholar 

  7. Baudrier, É., Mazo, L.: Combinatorics of the Gauss digitization under translation in 2D. J. Math. Imag. V. 61, 224–236 (2019)

    Article  MathSciNet  Google Scholar 

  8. Berthé, V., Nouvel, B.: Discrete rotations and symbolic dynamics. Theor. Comput. Sci. 380, 276–285 (2007)

    Article  MathSciNet  Google Scholar 

  9. Bertrand, G., Malandain, G.: A new characterization of three-dimensional simple points. Pat. Recogn. Lett. 15, 169–175 (1994)

    Article  Google Scholar 

  10. Bloch, I., Pescatore, J., Garnero, L.: A new characterization of simple elements in a tetrahedral mesh. Graph. Models 67, 260–284 (2005)

    Article  Google Scholar 

  11. Blot, V., Coeurjolly, D.: Quasi-affine transformation in higher dimension. In: DGCI. pp. 493–504 (2009)

  12. Breuils, S., Kenmochi, Y., Sugimoto, A.: Visiting bijective digitized reflections and rotations using geometric algebra. In: DGMM. pp. 242–254 (2021)

  13. Coeurjolly, D., Blot, V., Jacob-Da Col, M.A.: Quasi-affine transformation in 3-D: theory and algorithms. In: IWCIA. pp. 68–81 (2009)

  14. Couprie, M., Bertrand, G.: New characterizations of simple points in 2D, 3D, and 4D discrete spaces. IEEE Trans. Pat. Anal. Mach. Intell. 31, 637–648 (2009)

    Article  Google Scholar 

  15. Couprie, M., Nivando Bezerra, F., Bertrand, G.: Topological operators for grayscale image processing. J. Electron. Imag. 10, 1003–1015 (2001)

    Article  Google Scholar 

  16. Damiand, G., Dupas, A., Lachaud, J.O.: Fully deformable 3D digital partition model with topological control. Pat. Recogn. Lett. 32, 1374–1383 (2011)

    Article  Google Scholar 

  17. Faisan, S., Passat, N., Noblet, V., Chabrier, R., Meyer, C.: Topology preserving warping of 3-D binary images according to continuous one-to-one mappings. IEEE Trans. Image Process. 20, 2135–2145 (2011)

    Article  MathSciNet  Google Scholar 

  18. Guihéneuf, P.: Discretizations of isometries. In: DGCI. pp. 71–92 (2016)

  19. Han, X., Xu, C., Prince, J.L.: A topology preserving level set method for geometric deformable models. IEEE Trans. Pat. Anal. Mach. Intell. 25, 755–768 (2003)

    Article  Google Scholar 

  20. Heijmans, H.J.A.M., Ronse, C.: The algebraic basis of mathematical morphology. I Dilations and erosions. Comput. V. Graph. Image Process. 50, 245–295 (1990)

    Article  Google Scholar 

  21. Hundt, C.: Affine image matching is uniform TC\(^{0}\)-complete. In: CPM. pp. 13–25 (2010)

  22. Hundt, C., Liśkiewicz, M., Ragnar, N.: A combinatorial geometrical approach to two-dimensional robust pattern matching with scaling and rotation. Theor. Comput. Sci. 410, 5317–5333 (2009)

    Article  MathSciNet  Google Scholar 

  23. Hundt, C., Liskiewicz, M.: On the complexity of affine image matching. In: STACS. pp. 284–295 (2007)

  24. Jacob, M.A.: Transformation of digital images by discrete affine applications. Comput. Graph. 19, 373–389 (1995)

    Article  Google Scholar 

  25. Jacob, M.A., Andres, É.: On discrete rotations. In: DGCI. pp. 161–174 (1995)

  26. Jacob-Da Col, M.A.: Applications quasi-affines et pavages du plan discret. Theor. Comput. Sci. 259, 245–269 (2001)

    Article  MathSciNet  Google Scholar 

  27. Jacob-Da Col, M.A., Tellier, P.: Quasi-linear transformations and discrete tilings. Theor. Comput. Sci. 410, 2126–2134 (2009)

    Article  MathSciNet  Google Scholar 

  28. Jacob-Da Col, M.A., Tellier, P.: Quasi-linear transformations, numeration systems and fractals. In: DGCI. pp. 187–198 (2011)

  29. Jacob-Da Col, M., Mazo, L.: nD quasi-affine transformations. In: DGCI. pp. 337–348 (2016)

  30. Klette, R., Rosenfeld, A.: Digital Geometry: Geometric Methods for Digital Picture Analysis. Elsevier, Amsterdam, Boston (2004)

    MATH  Google Scholar 

  31. Kovalevsky, V.A.: Finite topology as applied to image analysis. Comput. V. Graph. Image Process. 46, 141–161 (1989)

    Article  Google Scholar 

  32. Latecki, L.J., Eckhardt, U., Rosenfeld, A.: Well-composed sets. Comput. V. Image Underst. 61, 70–83 (1995)

    Article  Google Scholar 

  33. Mazo, L., Baudrier, É.: Object digitization up to a translation. J. Comput. Syst. Sci. 95, 193–203 (2018)

    Article  MathSciNet  Google Scholar 

  34. Mazo, L., Passat, N., Couprie, M., Ronse, C.: Paths, homotopy and reduction in digital images. Acta Appl. Math. 113, 167–193 (2011)

    Article  MathSciNet  Google Scholar 

  35. Mazo, L., Passat, N., Couprie, M., Ronse, C.: Digital imaging: a unified topological framework. J. Math. Imag. V. 44, 19–37 (2012)

    Article  MathSciNet  Google Scholar 

  36. Mazo, L., Passat, N., Couprie, M., Ronse, C.: Topology on digital label images. J. Math. Imag. V. 44, 254–281 (2012)

    Article  MathSciNet  Google Scholar 

  37. Nehlig, P.: Applications quasi affines: pavages par images réciproques. Theor. Comput. Sci. 156, 1–38 (1996)

    Article  MathSciNet  Google Scholar 

  38. Ngo, P., Kenmochi, Y., Passat, N., Talbot, H.: Combinatorial structure of rigid transformations in 2D digital images. Comput. V. Image Underst. 117, 393–408 (2013)

    Article  Google Scholar 

  39. Ngo, P., Kenmochi, Y., Passat, N., Talbot, H.: Topology-preserving conditions for 2D digital images under rigid transformations. J. Math. Imag. V. 49, 418–433 (2014)

    Article  MathSciNet  Google Scholar 

  40. Ngo, P., Kenmochi, Y., Passat, N., Talbot, H.: On 2D constrained discrete rigid transformations. Ann. Math. Artif. Intell. 75, 163–193 (2015)

    Article  MathSciNet  Google Scholar 

  41. Ngo, P., Passat, N., Kenmochi, Y., Debled-Rennesson, I.: Convexity invariance of voxel objects under rigid motions. In: ICPR. pp. 1157–1162 (2018)

  42. Ngo, P., Passat, N., Kenmochi, Y., Debled-Rennesson, I.: Geometric preservation of 2D digital objects under rigid motions. J. Math. Imag. V. 61, 204–223 (2019)

    Article  MathSciNet  Google Scholar 

  43. Ngo, P., Passat, N., Kenmochi, Y., Talbot, H.: Topology-preserving rigid transformation of 2D digital images. IEEE Trans. Image Process. 23, 885–897 (2014)

    Article  MathSciNet  Google Scholar 

  44. Nouvel, B., Rémila, E.: Characterization of bijective discretized rotations. In: IWCIA. pp. 248–259 (2004)

  45. Nouvel, B., Rémila, E.: Incremental and transitive discrete rotations. In: IWCIA. pp. 199–213 (2006)

  46. Passat, N., Kenmochi, Y., Ngo, P., Pluta, K.: Rigid motions in the cubic grid: a discussion on topological issues. In: DGCI. pp. 127–140 (2019)

  47. Passat, N., Ngo, P., Kenmochi, Y.: Homotopic digital rigid motion: an optimization approach on cellular complexes. In: DGMM. pp. 189–201 (2021)

  48. Pluta, K., Moroz, G., Kenmochi, Y., Romon, P.: Quadric arrangement in classifying rigid motions of a 3D digital image. In: CASC. pp. 426–443 (2016)

  49. Pluta, K., Romon, P., Kenmochi, Y., Passat, N.: Bijectivity certification of 3D digitized rotations. In: CTIC. pp. 30–41 (2016)

  50. Pluta, K., Romon, P., Kenmochi, Y., Passat, N.: Bijective digitized rigid motions on subsets of the plane. J. Math. Imag. V. 59, 84–105 (2017)

    Article  MathSciNet  Google Scholar 

  51. Rosenfeld, A.: Adjacency in digital pictures. Inf. Control 26, 24–33 (1974)

    Article  MathSciNet  Google Scholar 

  52. Rosenfeld, A.: Digital topology. Am. Math. Mon. 86, 621–630 (1979)

    Article  MathSciNet  Google Scholar 

  53. Rosenfeld, A., Kong, T.Y., Nakamura, A.: Topology-preserving deformations of two-valued digital pictures. Graph. Models Image Process. 60, 24–34 (1998)

    Article  Google Scholar 

  54. Roussillon, T., Coeurjolly, D.: Characterization of bijective discretized rotations by Gaussian integers. Tech. Rep. (2016), https://hal.archives-ouvertes.fr/hal-01259826

  55. Saha, P.K., Chaudhuri, B.B., Chanda, B., Majumder, D.D.: Topology preservation in 3D digital space. Pat. Recogn. 27, 295–300 (1994)

    Article  Google Scholar 

  56. Thibault, Y., Sugimoto, A., Kenmochi, Y.: 3D discrete rotations using hinge angles. Theor. Comput. Sci. 412, 1378–1391 (2011)

    Article  MathSciNet  Google Scholar 

  57. Whitehead, J.H.C.: Simplicial spaces, nuclei and m-groups. Proc. London Math. Soc. s2–45, 243–327 (1939)

    Article  MathSciNet  Google Scholar 

Download references

Funding

The funding was provided by Agence Nationale de la Recherche (ANR) (Grant Number ANR-15-CE23-0009, ANR-15-CE40-0006, ANR-18-CE23-0025).

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Nicolas Passat.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

A Construction of the Cellular Space \({{\mathbb {H}}}\)

A Construction of the Cellular Space \({{\mathbb {H}}}\)

We describe hereafter the way we build the cellular space \({\mathbb {H}}\) that refines the two cubical spaces \({{\mathbb {F}}}\) and \({{\mathbb {G}}}\).

1.1 A.1 Input

Although \({{\mathbb {F}}}\), \({{\mathbb {G}}}\) and \({{\mathbb {H}}}\) are infinite spaces, our purpose is to handle finite digital objects. As a consequence, our first input is a finite subset \({\mathsf {S}}\) of \({{{\mathbb {Z}}}}^2\) that will include these digital objects. Without loss of generality, we assume that

$$\begin{aligned} {{\mathsf {S}}} = [\![-s,s]\!]^2 \subset {{{\mathbb {Z}}}}^2 \end{aligned}$$
(90)

is a square with \(s \in \mathbb N^\star \). The continuous analogue of this digital set \({\mathsf {S}}\) is the Euclidean square subset of \({{{\mathbb {R}}}}^2\) defined as

$$\begin{aligned} S = \square {\mathsf {S}} = [-s - \frac{1}{2},s+\frac{1}{2}]^2 \subset {{{\mathbb {R}}}}^2 \end{aligned}$$
(91)

The parameters that define the affine transformation \({{\mathcal {A}}}\) are also required, namely the values \(a_{11}, a_{12}, a_{21}, a_{22}, t_x, t_y \in {\mathbb Q}\) (see Eq. 2). Consequently, the information required as input is a 7-uple \((s,a_{11}, a_{12}, a_{21},\) \( a_{22},t_x,t_y) \in {\mathbb N}^\star \times {\mathbb Q}^6\).

1.2 A.2 Output

The output of the algorithm is the finite subspace (namely a complex) of the cellular space \({{\mathbb {H}}}\) that intersects a Euclidean square

$$\begin{aligned} Q = [q_x,q_x +w] \times [q_y,q_y+w] \subset {{{\mathbb {R}}}}^2 \end{aligned}$$
(92)

with \(\mathbf{q}\in ({{{\mathbb {Z}}}}+ \frac{1}{2})^2\) and .

The output cellular space

$$\begin{aligned} {{\mathbb {H}}}(Q) = \{{\mathfrak {h}} \in {{\mathbb {H}}} \mid {\mathfrak {h}} \subset Q\} \end{aligned}$$
(93)

is defined as a finite set of faces of \({{\mathbb {H}}}\), and is partitioned into three subsets \({{\mathbb {H}}}_0(Q)\), \({\mathbb {H}}_1(Q)\) and \({{\mathbb {H}}}_2(Q)\) that contain the 0-, 1- and 2-faces of \({{\mathbb {H}}}(Q)\), respectively. In particular, \({{\mathbb {H}}}_0(Q) \cup {{\mathbb {H}}}_1(Q) \cup {{\mathbb {H}}}_2(Q) = {{\mathbb {H}}}(Q)\) is a partition of Q.

For each face \({\mathfrak {h}}\), we also compute the closure \(C({\mathfrak {h}})\) and/or the star \(S({\mathfrak {h}})\) within the subspace \({{\mathbb {H}}}(Q)\). If \({\mathfrak {h}}\) is a 0- (resp. 1-, resp. 2-) face, we compute \(S_1({\mathfrak {h}})\) and \(S_2({\mathfrak {h}})\) (resp. \(C_0({\mathfrak {h}})\) and \(S_2({\mathfrak {h}})\), resp. \(C_0({\mathfrak {h}})\) and \(C_1({\mathfrak {h}})\)) where \(S_d({\mathfrak {h}})\) (resp. \(C_d({\mathfrak {h}})\)) is the part of \(S({\mathfrak {h}})\) (resp. \(C({\mathfrak {h}})\)) composed by the d-faces (\(0 \le d \le 2\)).

For each 2-face \({\mathfrak {h}}_2\), we also compute the functions \(\phi \) and \(\gamma \). More precisely, we compute the functions \({{\widetilde{\phi }}}, {{\widetilde{\gamma }}} : {{\mathbb {H}}}_2 \rightarrow {{{{\mathbb {Z}}}}^{2}}\) such that

$$\begin{aligned} {{\widetilde{\phi }}}({\mathfrak {h}}_2)&= \boxdot (\phi ({\mathfrak {h}}_2))\end{aligned}$$
(94)
$$\begin{aligned} {{\widetilde{\gamma }}}({\mathfrak {h}}_2)&=\boxdot ( {{\mathcal {A}}}^{-1}(\gamma ({\mathfrak {h}}_2))) \end{aligned}$$
(95)

This is indeed relevant since \(\boxdot \) is a bijection between \({{\mathbb {F}}}_2\) and \({{{{\mathbb {Z}}}}^{2}}\) while \({\boxdot \circ {{\mathcal {A}}}^{-1}}\) is a bijection between \({{\mathbb {G}}}_2\) and \({{{{\mathbb {Z}}}}^{2}}\). In particular, these functions allow us to define the two functions \({{\widetilde{\varPhi }} : \boxdot Q \subset {{{{\mathbb {Z}}}}^{2}} \rightarrow 2^{{{\mathbb {H}}}_2}}\) and \({{{\widetilde{\varGamma }}} : {\mathsf {S}} \subset {{{{\mathbb {Z}}}}^{2}} \rightarrow 2^{{\mathbb {H}}_2}}\) such that for any \(\mathbf{p}\in \phi ({{\mathbb {H}}}_2)\) (resp. \(\mathbf{p}\in {\mathsf {S}}\)), we have \({{{\widetilde{\varPhi }}}(\mathbf{p}) = \widetilde{\phi }^{-1}(\{\mathbf{p}\})}\) (resp. \({{{\widetilde{\varGamma }}}(\mathbf{p}) = \widetilde{\gamma }^{-1}(\{\mathbf{p}\})})\).

1.3 A.3 Definition of the Square Q

The first task is to define the square Q, i.e. to define \(\mathbf{q}\) and w so that Q includes the image of the square S by the affine transformation \({{\mathcal {A}}}\). Since S is convex, we can simply compute the images of the four vertices of S by \({{\mathcal {A}}}\) to reach that goal. In particular, for \(0 \le i, j \le 1\), we set

$$\begin{aligned} \mathbf{c}^{i,j} = ((-1)^i (s + \frac{1}{2}),(-1)^j (s + \frac{1}{2})) \end{aligned}$$
(96)

The four points \(\mathbf{c}^{i,j}\) are the vertices of S. For \(0 \le i, j \le 1\), we compute \(\mathbf{r}^{i,j} = {{\mathcal {A}}}(\mathbf{c}^{i,j})\). We set

$$\begin{aligned} r^-_x&= \min _{i,j}\{\lfloor r^{i,j}_x + \frac{1}{2}\rfloor \} - \frac{1}{2} \end{aligned}$$
(97)
$$\begin{aligned} r^-_y&= \min _{i,j}\{\lfloor r^{i,j}_y + \frac{1}{2}\rfloor \} - \frac{1}{2} \end{aligned}$$
(98)
$$\begin{aligned} r_x^+&= \max _{i,j}\{\lceil r^{i,j}_x - \frac{1}{2}\rceil \} + \frac{1}{2} \end{aligned}$$
(99)
$$\begin{aligned} r_y^+&= \max _{i,j}\{\lceil r^{i,j}_y- \frac{1}{2}\rceil \} + \frac{1}{2} \end{aligned}$$
(100)

Finally, we define

$$\begin{aligned} q_x&= r_x^- \end{aligned}$$
(101)
$$\begin{aligned} q_y&= r_y^- \end{aligned}$$
(102)
$$\begin{aligned} w&= \max \{r_x^+ - r_x^-, r_y^+ - r_y^-\} \end{aligned}$$
(103)

The square Q is then defined by its four vertices \(\mathbf{q}^{0,0} = \mathbf{q}\), \(\mathbf{q}^{w,0} = \mathbf{q}+ w\mathbf{e}_x\), \(\mathbf{q}^{0,w} = \mathbf{q}+ w\mathbf{e}_y\) and \(\mathbf{q}^{w,w} = \mathbf{q}+ w\mathbf{e}_x + w\mathbf{e}_y\).

1.4 A.4 Definition of the Generator Lines of \({{\mathbb {H}}}(Q)\)

The cellular subspace \({{\mathbb {H}}}(Q)\) is induced by the subdivision of Q by the lines of \({\mathscr {V}}_\varDelta \), \(\mathscr {H}_\varDelta \), \({{\mathcal {A}}}({\mathscr {V}}_\varDelta )\) and \({{\mathcal {A}}}({\mathscr {H}}_\varDelta )\). These four sets are infinite, but for each of them, the subset of lines that contribute to the subdivision of Q is finite and corresponds to the lines that intersect the square Q. The subsets \({\mathscr {V}}_\varDelta (Q)\) of \({\mathscr {V}}_\varDelta \) and \(\mathscr {H}_\varDelta (Q)\) of \({\mathscr {H}}_\varDelta \) are defined by

$$\begin{aligned} {\mathscr {V}}_\varDelta (Q)&= \{V_\delta \mid \delta \in \varDelta \cap [q_x,q_x + w]\} \end{aligned}$$
(104)
$$\begin{aligned} {\mathscr {H}}_\varDelta (Q)&= \{H_\delta \mid \delta \in \varDelta \cap [q_y,q_y + w]\} \end{aligned}$$
(105)

while the subsets \({{\mathcal {A}}}({\mathscr {V}}_\varDelta )(Q)\) of \({{\mathcal {A}}}(\mathscr {V}_\varDelta )\) and \({{\mathcal {A}}}({\mathscr {H}}_\varDelta )(Q)\) of \({{\mathcal {A}}}(\mathscr {H}_\varDelta )\) can be determined as follows. For \(0 \le i, j \le 1\), we compute

$$\begin{aligned} \mathbf{u}^{i,j} = {{\mathcal {A}}}^{-1}(\mathbf{q}^{iw,jw}) \end{aligned}$$
(106)

These four points \(\mathbf{u}^{i,j}\) are the vertices of the parallelogram \({{\mathcal {A}}}^{-1}(Q)\). We set

$$\begin{aligned} \delta _x^-&= \min _{i,j}(\lceil u_x^{i,j} +\frac{1}{2} \rceil ) - \frac{1}{2} \end{aligned}$$
(107)
$$\begin{aligned} \delta _x^+&= \max _{i,j}(\lfloor u_x^{i,j} -\frac{1}{2} \rfloor ) + \frac{1}{2} \end{aligned}$$
(108)
$$\begin{aligned} \delta _y^-&= \min _{i,j}(\lceil u_y^{i,j} +\frac{1}{2} \rceil ) - \frac{1}{2} \end{aligned}$$
(109)
$$\begin{aligned} \delta _y^+&= \max _{i,j}(\lfloor u_y^{i,j} -\frac{1}{2} \rfloor ) + \frac{1}{2} \end{aligned}$$
(110)

The only lines of \({\mathscr {V}}_\varDelta \) (resp. \({\mathscr {H}}_\varDelta \)) that intersect \({{\mathcal {A}}}^{-1}(Q)\) are the lines \(V_\delta \) (resp. \(H_\delta \)) for \(\delta _x^- \le \delta \le \delta _x^+\) (resp. \(\delta _y^- \le \delta \le \delta _y^+\)). This leads us to define the subsets \({{\mathcal {A}}}({\mathscr {V}}_\varDelta )(Q)\) of \({{\mathcal {A}}}(\mathscr {V}_\varDelta )\) and \({{\mathcal {A}}}({\mathscr {H}}_\varDelta )(Q)\) of \({{\mathcal {A}}}(\mathscr {H}_\varDelta )\) as follows

$$\begin{aligned} {{\mathcal {A}}}({\mathscr {V}}_\varDelta )(Q)&= \{ {{\mathcal {A}}}(V_\delta ) \mid \delta _x^- \le \delta \le \delta _x^+ \} \end{aligned}$$
(111)
$$\begin{aligned} {{\mathcal {A}}}({\mathscr {H}}_\varDelta )(Q)&= \{ {{\mathcal {A}}}(H_\delta ) \mid \delta _y^- \le \delta \le \delta _y^+ \} \end{aligned}$$
(112)

1.5 A.5 Definition of \({{\mathbb {H}}}_0(Q)\)

Any 0-face \({\mathfrak {f}}_0\) of \({{\mathbb {H}}}(Q)\) corresponds to the intersection of (at least) two lines of \({\mathscr {V}}_\varDelta (Q)\), \({\mathscr {H}}_\varDelta (Q)\), \({{\mathcal {A}}}({\mathscr {V}}_\varDelta )(Q)\) and \({{\mathcal {A}}}({\mathscr {H}}_\varDelta )(Q)\) inside the square Q. (Of course, such two lines cannot belong to a same subset.) Reversely, two lines from two of these subsets can induce at most one such 0-face. In order to ensure that the intersection between two lines is indeed inside the square Q, we define for each line L the segment, noted Q(L), which corresponds the intersection between L and Q. In particular, two lines \(L_1\) and \(L_2\) will intersect inside Q iff \(Q(L_1)\) and \(Q(L_2)\) intersect.

Let L be a line of \({\mathscr {V}}_\varDelta (Q)\), \({\mathscr {H}}_\varDelta (Q)\), \({{\mathcal {A}}}({\mathscr {V}}_\varDelta )(Q)\) or \({{\mathcal {A}}}({\mathscr {H}}_\varDelta )(Q)\). We compute the putative intersections

$$\begin{aligned} L \cap V_{q_x}&= \{\mathbf{m}^{x-}\} \end{aligned}$$
(113)
$$\begin{aligned} L \cap V_{q_x+w}&= \{\mathbf{m}^{x+}\} \end{aligned}$$
(114)
$$\begin{aligned} L \cap H_{q_y}&= \{\mathbf{m}^{y-}\} \end{aligned}$$
(115)
$$\begin{aligned} L \cap H_{q_y+w}&= \{\mathbf{m}^{y+}\} \end{aligned}$$
(116)

with the convention that \(\mathbf{m}^{x-} = (m^{y-}_x,-\infty )\) and \(\mathbf{m}^{x+} = (m^{y+}_x,+\infty )\) if L is colinear to \(V_{q_x}\) and \(V_{q_x+w}\) and \(\mathbf{m}^{y-} = (-\infty ,m^{x-}_y)\) and \(\mathbf{m}^{y+} = (+\infty ,m^{x+}_y)\) if L is colinear to \(H_{q_y}\) and \(H_{q_y+w}\). The segment associated to L is then

$$\begin{aligned}&Q(L) = [(\max \{m_x^{x-},m_x^{y-}\},\max \{m_y^{x-},m_y^{y-}\}),\nonumber \\&(\min \{m_x^{x+}, m_x^{y+}\}, \min \{m_y^{x+},m_y^{y+}\})] \end{aligned}$$
(117)

For the sake of concision, a 0-face \({\mathfrak {f}}_0\) will be also noted as \(\langle \mathbf{h}\rangle \) where \(\mathbf{h}\) is the point that defines this face, i.e. the intersection point of these two lines.

Let \(L_1, L_2\) be two lines of two distinct subsets of \(\mathscr {V}_\varDelta (Q)\), \({\mathscr {H}}_\varDelta (Q)\), \({{\mathcal {A}}}({\mathscr {V}}_\varDelta )(Q)\) or \({{\mathcal {A}}}({\mathscr {H}}_\varDelta )(Q)\). If \(L_1 \cap L_2 = \{\mathbf{h}\}\) (i.e. if \(L_1 \cap L_2 \ne \emptyset \) and \(L_1 \ne L_2\), i.e. \(L_1, L_2\) are non-colinear), then \(\langle \mathbf{h}\rangle \) is a 0-face of \({{\mathbb {H}}}_0(Q)\) iff \(\mathbf{h}\in Q(L_1)\) and \(\mathbf{h}\in Q(L_2)\). The exhaustive scanning of all the couples of lines within \(\mathscr {V}_\varDelta (Q)\), \({\mathscr {H}}_\varDelta (Q)\), \({{\mathcal {A}}}({\mathscr {V}}_\varDelta )(Q)\) or \({{\mathcal {A}}}({\mathscr {H}}_\varDelta )(Q)\) then allows us to build \({\mathbb {H}}_0(Q)\).

1.6 A.6 Definition of \({{\mathbb {H}}}_1(Q)\)

For each line L of \({\mathscr {V}}_\varDelta (Q)\), \({\mathscr {H}}_\varDelta (Q)\), \({{\mathcal {A}}}({\mathscr {V}}_\varDelta )(Q)\) or \({{\mathcal {A}}}({\mathscr {H}}_\varDelta )(Q)\), we keep track of all the 0-faces of \({{\mathbb {H}}}_0(Q)\) induced by the intersection of L with another line. In particular, we note I(L) the sets of all the points corresponding to these 0-faces.

For the sake of concision, a 1-face \({\mathfrak {f}}_1\) will be also noted as \(\langle \mathbf{h}_1,\mathbf{h}_2 \rangle \) where \({\mathfrak {f}}_1 = \ ]\mathbf{h}_1, \mathbf{h}_2[\).

Let \(I(L) = \{\mathbf{h}_0,\ldots ,\mathbf{h}_i\ldots ,\mathbf{h}_t\}\) (\(t \ge 0\)). Without loss of generality, we assume that the points \(\mathbf{h}_i\) are sorted in the lexicographic order in \({\mathbb Q}^2\). (Note that we have \(\mathbf{h}_0\) and \(\mathbf{h}_t\) equal to the bounds of Q(L).) Then, for any \(0 \le i \le t-1\), \(\langle \mathbf{h}_i,\mathbf{h}_{i+1} \rangle \) is a 1-face of \({\mathbb {H}}_1(Q)\). Reversely, each 1-face of \({{\mathbb {H}}}_1(Q)\) satisfies this property for one (or two) line(s) L of \(\mathscr {V}_\varDelta (Q)\), \({\mathscr {H}}_\varDelta (Q)\), \({{\mathcal {A}}}({\mathscr {V}}_\varDelta )(Q)\) or \({{\mathcal {A}}}({\mathscr {H}}_\varDelta )(Q)\).

For any 1-face \({\mathfrak {f}}_1 = \langle \mathbf{h}_i,\mathbf{h}_{i+1} \rangle \), the set \(C_0({\mathfrak {f}}_1)\) is defined as \(\{\langle \mathbf{h}_i \rangle , \langle \mathbf{h}_{i+1} \rangle \}\). Reversely, for any 0-face \({\mathfrak {f}}_0 \in {{\mathbb {H}}}_0\), the set \(S_1({\mathfrak {f}}_0)\) is defined as \(\{{\mathfrak {f}}_1 \in {{\mathbb {H}}}_1 \mid {\mathfrak {f}}_0 \in C_0({\mathfrak {f}}_1)\}\).

1.7 A.7 Definition of \({{\mathbb {H}}}_2(Q)\)

Let \({\mathfrak {f}}_0 = \langle \mathbf{h}\rangle \) be a 0-face of \({{\mathbb {H}}}_0\). The set \(S_1({\mathfrak {f}}_0)\) contains many 1-faces \(\langle \mathbf{h}, \mathbf{h}' \rangle \) that can be easily sorted in the clockwise order with respect to the orientation of the vectors \(\mathbf{h}' - \mathbf{h}\). For each 1-face \({\mathfrak {f}}_1 = \langle \mathbf{h}, \mathbf{h}' \rangle \) of \({{\mathbb {H}}}_1\), we can then define the successor of \({\mathfrak {f}}_1\) in \(S(\langle \mathbf{h}\rangle )\) (resp. in \(S(\langle \mathbf{h}'\rangle )\)) with respect to this ordering. This successor will be noted \(\sigma (\langle \mathbf{h}', \mathbf{h}\rangle )\) (resp. \(\sigma (\langle \mathbf{h}, \mathbf{h}' \rangle )\)); note in particular that the order of \(\mathbf{h}, \mathbf{h}'\) in the notation of \(\sigma \) will then be important in that case.

For the sake of concision, a 2-face \({\mathfrak {f}}_2\) will be also noted as \(\langle \mathbf{h}_1,\ldots ,\) \(\mathbf{h}_i,\ldots \mathbf{h}_t \rangle \) (\(t \ge 3\)) where the \(\mathbf{h}_i\) are the vertices of the corresponding convex polygon, clockwise ordered. Each 2-faceFootnote 6\({\mathfrak {f}}_2\) is defined (up to circular permutations) by \(\langle \mathbf{h}_1,\ldots ,\mathbf{h}_i,\ldots \mathbf{h}_t \rangle \) such that for any \(1 \le i,j \le t\), we have \(\mathbf{h}_i \ne \mathbf{h}_j\), for any \(1 \le i \le t-2\), we have \(\sigma (\langle \mathbf{h}_i, \mathbf{h}_{i+1} \rangle ) = \langle \mathbf{h}_{i+1}, \mathbf{h}_{i+2} \rangle \) and \(\sigma (\langle \mathbf{h}_{t-1}, \mathbf{h}_{t} \rangle ) = \langle \mathbf{h}_{t}, \mathbf{h}_{1} \rangle \).

For any 2-face \({\mathfrak {f}}_2 = \langle \mathbf{h}_1,\ldots ,\mathbf{h}_i,\ldots \mathbf{h}_t \rangle \), the sets \(C_0({\mathfrak {f}}_2)\) and \(C_1({\mathfrak {f}}_2)\) are defined as

$$\begin{aligned} C_0({\mathfrak {f}}_2)&= \{\langle \mathbf{h}_1\rangle ,\ldots ,\langle \mathbf{h}_i\rangle ,\ldots \langle \mathbf{h}_t \rangle \} \end{aligned}$$
(118)
$$\begin{aligned} C_1({\mathfrak {f}}_2)&= \{\langle \mathbf{h}_1,\mathbf{h}_2\rangle ,\ldots ,\langle \mathbf{h}_i,\mathbf{h}_{i+1}\rangle ,\ldots , \langle \mathbf{h}_{t-1},\mathbf{h}_t \rangle , \langle \mathbf{h}_t,\mathbf{h}_1 \rangle \} \end{aligned}$$
(119)

Reversely, for any 0-face \({\mathfrak {f}}_0 \in {{\mathbb {H}}}_0\), the sets \(S_1({\mathfrak {f}}_0)\) and \(S_2({\mathfrak {f}}_0)\) are defined as

$$\begin{aligned} S_1({\mathfrak {f}}_0)&= \{{\mathfrak {f}}_2 \in {{\mathbb {H}}}_2 \mid {\mathfrak {f}}_0 \in C_0({\mathfrak {f}}_2)\} \end{aligned}$$
(120)
$$\begin{aligned} S_2({\mathfrak {f}}_0)&= \{{\mathfrak {f}}_2 \in {{\mathbb {H}}}_2 \mid {\mathfrak {f}}_1 \in C_1({\mathfrak {f}}_2)\} \end{aligned}$$
(121)

1.8 A.8 Definition of the Functions \({{{\widetilde{\phi }}}}, {{{\widetilde{\gamma }}}}, {{{\widetilde{\varPhi }}}}, {{{\widetilde{\varGamma }}}}\)

Let \({\mathfrak {f}}_2 = \langle \mathbf{h}_1,\ldots ,\mathbf{h}_i,\ldots \mathbf{h}_t \rangle \) be a 2-face of \({{\mathbb {H}}}(Q)\). We setFootnote 7

$$\begin{aligned} \mathbf{b}({\mathfrak {f}}_2) = \frac{1}{t} \sum ^t_{i=1} \mathbf{h}_i \end{aligned}$$
(122)

a point inside \({\mathfrak {f}}_2\), and . We set

(123)
(124)

where \([\,\cdot \,]\) is the rounding operator. From and , we then define and .

In particular, these functions allow us to define the two functions and as follows

(125)
(126)

Rights and permissions

Reprints and Permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Passat, N., Ngo, P., Kenmochi, Y. et al. Homotopic Affine Transformations in the 2D Cartesian Grid. J Math Imaging Vis 64, 786–806 (2022). https://doi.org/10.1007/s10851-022-01094-y

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10851-022-01094-y

Keywords

  • Affine transformations
  • Cartesian grid
  • Homotopy type
  • Binary images
  • Cubical complexes
  • Cellular complexes