Skip to main content
Log in

Computing the Minimal Perimeter Polygon for Sets of Rectangular Tiles based on Visibility Cones

  • Published:
Journal of Mathematical Imaging and Vision Aims and scope Submit manuscript

Abstract

To study convexity properties of digital planar objects, the minimum perimeter polygon (MPP) was defined in the 1970 s in articles by Sklansky, Chazin, Hansen, Kibler, and Kim, where pixels were identified with polygonal tiles in mosaics, and two algorithms (1972, 1976) were proposed to determine the MPP vertices. These algorithms are based on constructing and iteratively restricting visibility cones, the MPP vertices result as special vertices of the tiles. The present paper proposes a novel MPP algorithm for objects given as regular complexes in rectangular mosaics, which are edge-adjacency-connected sets of tiles that have neither end tiles nor holes and whose boundaries not necessarily are simple. The new algorithm takes as input the canonical boundary path, we also propose a boundary tracing algorithm to obtain this path. We review the two classic MPP algorithms for rectangular tiles and a simplified adaptation for square tiles that is recommended in widely used modern textbooks on digital image analysis (2018, 2020) to produce approximations of simple digital 4-contours. We show that all these algorithms fail and that their mathematical basis is flawed, we correct the errors to develop the new MPP algorithm. Our MPP algorithm is illustrated using examples and its correctness is proved. Under our assumptions, the MPP coincides with the relative convex hull of a set A with respect to a polygon \(B\supset A\), where A is not necessarily a polygon, not even connected.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Algorithm 1
Fig. 10
Fig. 11
Fig. 12
Algorithm 2
Fig. 13
Fig. 14
Fig. 15
Algorithm 3
Fig. 16
Fig. 17
Fig. 18
Fig. 19
Fig. 20
Fig. 21
Fig. 22
Fig. 23
Fig. 24
Fig. 25
Fig. 26
Fig. 27
Fig. 28
Fig. 29
Algorithm 4

Similar content being viewed by others

Notes

  1. The MPP algorithm appears in the same form in the earlier editions [4, 6] of these textbooks.

  2. We will not use terms from [22, 23] such as cell mosaic, cell (instead of tile), cell complex, cell image or cell boundary to avoid confusion with cellular complexes or from cell complexes known from combinatorial topology, which are also used to model discrete sets [13, 15, 29].

  3. In [22], T is defined as end cell “if \(S=T\cap (|{\mathcal {C}}|\setminus T)\) is a single edge of T”, but then \(S=\emptyset \) since T is closed. A correct version would require that \(S=T\cap cl(|{\mathcal {C}}|{\setminus } T)\) is a single edge of \({\mathcal {M}}\) which only makes sense if \({\mathcal {C}}\) has at least two tiles.

  4. A cut point is defined in [23] for any connected subset of \({\mathbb {R}}^2\), but later used as special element of a complex, however, a complex only contains tiles.

  5. The definition of core in [22] depends on a boundary path which, in general, is not unique for the boundary \({\mathcal {B}}({\mathcal {C}})\). To avoid resulting vague details, we quote the core definition from [23], which also requires additional effort to define core vertices since the core is not necessarily a polygon.

  6. The “Implementation of Algorithm M” in [23] contains also steps of a boundary detection method. In the present work, these parts are ignored since we are interested only in the MPP algorithm, we use the complete input boundary path \(\beta ({\mathcal {C}})\) to obtain all edges.

  7. We cite the definition of r from [22], as given there in Fig. 9. The text on p. 266 of [22] defines r as starting at p and pointing clockwise along \(fr(|{\mathcal {C}} |)\) or towards the core boundary, depending on whether p is concave (authors say “lies on \(|{\mathcal {C}} |\)”, but it lies on \(fr(|{\mathcal {C}}|)\)) or convex (authors say “lies on \({core}({\mathcal {C}})\)”, but it should lie on the core boundary, or, on the spread, since not each core point can be an MPP vertex). This contradicts the indications of Fig. 9, which are applied in the example of Fig. 11. It is unclear what it means for a vector to point clockwise along the core boundary when this latter set may be disconnected.

  8. The text on p. 266 of [22] defines \(\measuredangle (\textbf{r},\overrightarrow{pz} )\) as “the absolute value of the angle swept out by a vector through p starting from r and rotating counterclockwise to p.” This statement contradicts Fig. 11 on the same page where all angles are measured in clockwise sense from r for a convex MPP vertex in an example.

  9. The sections on the MPP algorithm and its foundation appear with the same content in the previous editions [4] (2007) and [6, 8] (2009/2010).

References

  1. Chang, H.C., Erickson, J., Xu, C.: Detecting weakly simple polygons. In: Indyk, P. (ed.) Proc. of 26th Annual ACM-SIAM Symp. on Discrete Algorithms SODA 2015 (USA, 2015), vol. 3, pp. 1657–1672. SIAM (2015). https://doi.org/10.1137/1.9781611973730.110

  2. Coeurjolly, D., Klette, R.: Comparative evaluation of length estimators of digital curves. IEEE Trans. Pattern Anal. Mach. Intell. 26(2), 252–258 (2004). https://doi.org/10.1109/TPAMI.2004.1262194

    Article  Google Scholar 

  3. de Vieilleville, F., Lachaud, J.: Digital deformable model simulating active contours. In: Brlek, S., et al. (ed.) Proc. of DGCI—Int. Conf. on Discrete Geometry for Computer Imagery, pp. 203–216. Springer, LNCS 5810 (2009)

  4. Gonzalez, R., Woods, R.: Digital Image Processing, 3rd edn. Pearson Education International, Upper Saddle River (2007)

    Google Scholar 

  5. Gonzalez, R., Woods, R.: Digital Image Processing (Global Edition), 4th edn. Pearson Education Limited, Upper Saddle River (2018)

    Google Scholar 

  6. Gonzalez, R., Woods, R., Eddins, S.: Digital Image Processing using Matlab, 2nd edn. Gatesmark Publishing LLC, Knoxville (2009)

    Google Scholar 

  7. Gonzalez, R., Woods, R., Eddins, S.: Digital Image Processing using Matlab, 3rd edn. Gatesmark Publishing LLC, Knoxville (2020)

    Google Scholar 

  8. Gonzalez, R., Woods, R., Eddins, S.: Digital Image Processing using Matlab, 2nd edn. McGraw-Hill Education (India) Private Limited, New York (2004). (20th reprint 2019)

    Google Scholar 

  9. Grünbaum, B., Shephard, G.: Tilings and Patterns. W.H. Freeman and Company, New York (1978)

    Google Scholar 

  10. Kim, C., Sklansky, J.: Digital and cellular convexity. Pattern Recogn. 15(5), 359–367 (1982)

    Article  MathSciNet  Google Scholar 

  11. Klette, R.: Multigrid convergence of geometric features. In: Bertrand, G., Imiya, A., Klette, R. (eds.) Digital and Image Geometry, pp. 318–338. Springer, LNCS 2243 (2002). https://doi.org/10.1007/3-540-45576-0-19

  12. Klette, R., Kovalevsky, V., Yip, B.: On the length estimation of digital curves. In: Latecki, L., Melter, R., Mount, D., Wu, A. (eds.) SPIE Proc. of Vision Geometry VIII, pp. 117–129. SPIE Proc. Series (1999)

  13. Klette, R., Rosenfeld, A.: Digital Geometry—Geometric Methods for Digital Picture Analysis. Morgan Kaufmann Publisher, Burlington (2004)

    Google Scholar 

  14. Klette, R., Yip, B.: The length of digital curves. Mach. Graph. Vis. 9(3), 673–703 (2000)

    Google Scholar 

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

    Article  Google Scholar 

  16. Lachaud, J., Provencal, X.: Two linear-time algorithms for computing the minimum length polygon of a digital contour. Discrete Appl. Math. 159, 2229–2250 (2011). https://doi.org/10.1016/j.dam.2011.08.002

    Article  MathSciNet  Google Scholar 

  17. Provencal, X., Lachaud, J.: Two linear-time algorithms for computing the minimum length polygon of a digital contour. In: Brlek, S., Reutenauer, C., Provencal, X. (eds.) Proc. of DGCI - Int. Conf. on Discrete Geometry for Computer Imagery, pp. 104–117. Springer, LNCS 5810 (2009). https://doi.org/10.1007/978-3-642-04397-0-10

  18. Roussillon, T., Sivignon, I.: Faithful polygonal representation of the convex and concave parts of a digital curve. Pattern Recogn. 44, 2693–2700 (2011). https://doi.org/10.1016/j.patcog.2011.03.018

    Article  Google Scholar 

  19. Schulte, E.: Tilings. In: Gruber, P., Wills, J. (eds.) Handbook of Convex Geometry (Vol. B), pp. 899–932. Springer, LNCS 2059, Amsterdam (1993)

  20. Sklansky, J.: Recognition of convex blobs. Pattern Recogn. 2, 3–10 (1970). https://doi.org/10.1016/0031-3203(70)90037-3

    Article  Google Scholar 

  21. Sklansky, J.: Measuring cavity on a rectangular mosaic. IEEE Trans. Comput. C–21(12), 1355–1364 (1972)

    Article  MathSciNet  Google Scholar 

  22. Sklansky, J., Chazin, R., Hansen, B.: Minimum perimeter polygons of digitized silhouettes. IEEE Trans. Comput. 21(3), 260–268 (1972). https://doi.org/10.1109/TC.1972.5008948

    Article  MathSciNet  Google Scholar 

  23. Sklansky, J., Kibler, D.: A theory of nonuniformly digitized binary pictures. IEEE Trans. Syst. Man Cybern. 6(9), 637–647 (1976). https://doi.org/10.1109/TSMC.1976.4309569

    Article  MathSciNet  Google Scholar 

  24. Sloboda, F., Stoer, J.: On piecewise linear approximation of planar Jordan curves. J. Comput. Appl. Math. 55, 369–383 (1994). https://doi.org/10.1016/0377-0427(94)90040-X

    Article  MathSciNet  Google Scholar 

  25. Sloboda, F., Zatco, B., Stoer, J.: On approximation of planar one-dimensional continua. In: Klette, R., Rosenfeld, A., Sloboda, F. (eds.) Advances in Digital and Computational Geometry, pp. 113–160. Springer, Singapore (1998)

  26. Tajine, M., Daurat, A.: On local definitions of length of digital curves. In: Proc. of DGCI - Int. Conf. on Discrete Geometry for Computer Imagery, pp. 114–123. Springer, LNCS 2886 (2003). https://doi.org/10.1007/978-3-540-39966-7-10

  27. Toussaint, G.: Computing geodesic properties inside a simple polygon. Revue d’Intell. Artif. 3(2), 265–278 (1989)

    Google Scholar 

  28. Wiederhold, P., Villafuerte, M.: A polygonal approximation for general 4-contours corresponding to weakly simple curves. J. Math. Imaging Vis. 64(2), 161–193 (2022). https://doi.org/10.1007/s10851-021-01060-0

    Article  MathSciNet  Google Scholar 

  29. Wiederhold, P., Wilson, R.: The Alexandroff dimension of digital quotients of Euclidean spaces. Discrete Comput. Geom. 27, 273–286 (2002). https://doi.org/10.1007/s00454-001-0065-4

    Article  MathSciNet  Google Scholar 

Download references

Acknowledgements

The authors are very grateful to the reviewers for their detailed and constructive work, which contributed to improving the manuscript.

Author information

Authors and Affiliations

Authors

Contributions

There is only one author P.W. who wrote the manuscript text and prepared all figures.

Corresponding author

Correspondence to Petra Wiederhold.

Ethics declarations

Conflict of interest

The author declare that there is no conflict of interest.

Additional information

Publisher's Note

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

Appendices

Appendices

Appendix A: On the MPP Algorithm for Complexes of Square Tiles with Simple Boundaries, Proposed in the Image Analysis Textbooks [5, 7]

The books “Digital Image Processing” [5] (2018) and “Digital Image Processing using Matlab” [7] (2020) are widely used textbooks on digital image processing and analysis. Part of Sect. 11.2 of [5], which appears also as part of Sect. 13.3 of [7], suggests the MPPFootnote 9 to represent and approximate objects in the digital plane \((c{\mathbb {Z}})^2\).

The MPP algorithm in [5, 7] is proposed for edge-adjacency-connected objects of square tiles with simple boundaries, called there “simply connected cellular complexes”, this corresponds to simple 4-contours of objects in \((c{\mathbb {Z}})^2\). In the notation of the present article, each such object is an edge-adjacency-connected complex \({\mathcal {C}}\) in a square mosaic where all tiles are of the same size and such that the boundary \({\mathcal {B}}({\mathcal {C}})\) can be represented as a simple path.

Under these assumptions, both \(|{\mathcal {C}}|\) and \(|{\mathcal {C}}\setminus {\mathcal {B}}({\mathcal {C}})|\) are simple polygons and \(|{\mathcal {B}}({\mathcal {C}})|\) is an annular set with an inner frontier \(L_1\) and outer frontier \(L_2\), called the inner and outer wall in [5, 7]. Then each convex MPP vertex is a convex vertex of \(L_1\), and each concave MPP vertex is a concave vertex of \(L_2\) [22, 25]. Moreover, there is a bijection between the concave vertices of \(L_1\) and their corresponding concave vertices of \(L_2\), called mirrored concave vertices in [5, 7]. This was first used in [12,13,14], see Fig. 31. Finally, the uppermost leftmost vertex of \(L_1\) is a convex MPP vertex [22].

Using all these facts, the MPP algorithm from [5, 7] determines the ordered sequence \((m_1, m_2, \ldots , m_t)\) of MPP vertices of \({\mathcal {C}}\). It first detects the top leftmost vertex of \(L_1\), which is the first MPP vertex found \(m_1\) [22], and then traces a simple boundary path in counterclockwise sense to generate the list \({\textit{Cand}} = (c_1, c_2, \ldots , c_s)\) with \(c_1= m_1\) of all convex vertices and mirrored concave vertices lying on \(L_1\), only those points are MPP vertex candidates.

After the last MPP vertex \(m_n\), \(n\ge 1\), \(m_n = c_i\) is found for some \(i\in \{ 1,2, \ldots t\}\), the algorithm from [5, 7] finds the next MPP vertex \(m_{n+1}\) from the list Cand, \(m_{n+1} = c_j\) for some \(j\ge i+1\), with the help of two so-called crawler points: q crawls along convex vertices, p along mirrored concave vertices. It constructs a cone rooted at \(m_n\) with left border \(\overrightarrow{m_nq}\) and right border \(\overrightarrow{m_np}\), initialized by \(p= q= m_n = c_i\) and then updated and restricted by the successively involved candidates \(c_{i+1}, c_{i+2}, c_{i+3}, \ldots \) from the list Cand.

Fig. 30
figure 30

A regular complex (shaded grey) with a thin part around \(\beta _0 = T_0\). Its MPP (drawn by blue dashed lines) is a degenerate polygon determined by the cyclic vertex sequence (xyxz), where x is a convex and concave vertex, and y and z are convex. Applying Definition 6, \(w_0\) is the disconnected set drawn in pink containing x, \(u_0\) results empty. Then \(w_1\) is the disconnected set of two opposite sides (drawn in blue in the right figure) of the next boundary tile, \(u_1\) is empty. These results are unexpected and make it impossible to calculate the angles \(h_1, H_1\) and to continue Algorithm 4 from the first MPP vertex \(m_1=x\) (Color figure online)

For fixed \(m_n = c_i\), given current points p and q and \(c_{k}\) read from Cand, \(k\ge i+1\), the algorithm performs the following:

  • If \(c_{k}\) lies strictly to the left of \(\overrightarrow{m_nq}\) (outside the current cone), \(m_{n+1} = q\) is found as next convex MPP vertex.

  • If \(c_k\) lies inside the cone or on its borders (that is, \(c_{k}\) lies to the right of or is collinear with \(\overrightarrow{m_nq}\), and \(c_{k}\) lies to the left of or is collinear with \(\overrightarrow{m_np}\)) then the left cone border is updated if \(c_k\) is convex: \(q= c_k\), or the right cone border is updated if \(c_k\) is concave: \(p= c_k\).

  • If \(c_{k}\) lies strictly to the right of \(\overrightarrow{m_np}\) (outside the current cone), \(m_{n+1} = p\) is found as next concave MPP vertex.

  • The algorithm stops when it does not find another element in the list Cand. The points obtained are vertices of the tiles of the input boundary. If \({\mathcal {C}}\) represents an object in \({\mathbb {Z}}^2\) by identifying each tile with its centre point as pixel, then the resulting MPP vertices have coordinates of type \(z+\frac{1}{2}, z\in {\mathbb {Z}}\).

Fig. 31
figure 31

A complex whose simple 4-contour is shaded gray, convex vertices of the inner frontier \(L_1\) are drawn brown, mirrored concave vertices are marked blue. For some concave vertices of \(L_1\), their bijective correspondence to concave vertices of \(L_2\) is represented by diagonal lines. The boundary part with tiles numbered \(1, 2,\ldots , 22\) is discussed in Example 9 to compare the algorithm from [5, 7] with Algorithm 3

Example 9

Consider the complex shown in Fig. 31 in our notation of the endpoints \(x_i\) (right) and \(y_i\) (left) of each edge \(e_i = \beta _i \cap \beta _{i+1}\) for consecutive tiles \(\beta _i\), \(\beta _{i+1}\) in the boundary path. For the boundary part having the tiles numbered \(1, 2, \ldots , 22\) in the figure, the MPP vertices are given by \(m_n\), \(m_{n+1}= x_{13} = x_{14}\), \(m_{n+2}= x_{18} = x_{19}\), \(m_{n+3}= x_{20} = x_{21}\). Note that \(x_{13}\) is needed since \(\overrightarrow{m_nx_{18}}\) has slope 4/15, but \(\overrightarrow{m_nx_{13}}\) has the larger slope 3/11, hence \(\overrightarrow{m_nx_{13}}\) does not fit in the boundary.

Restarting the algorithm from [5, 7] at the MPP vertex \(m_n\), \(y_3 = y_4\), \(x_4 = x_5\), \(y_9\), \(x_9 = x_{10}\), \(y_{13}\), \(x_{13} = x_{14}\), \(y_{18}\), and \(x_{18} = x_{19}\) are the next candidates. An initial cone is generated with left border \(\overrightarrow{m_ny_3}\) with slope 1/3 and right border \(\overrightarrow{m_nx_4}\) with slope 1/4. The next candidate \(q= y_9\) restricts the left border, \(\overrightarrow{m_ny_9}\) has slope 2/7, \(p= x_9 = x_{10}\) confirms the right border. The slope of \(\overrightarrow{m_ny_{13}}\) is 3/10, which exceeds 2/7, hence \(y_{13}\) lies to the left outside the cone. This causes the algorithm to find the next MPP vertex as \(m_{n+1} = q= y_9\), which is a false result. After that, the correct MPP vertex \(x_{18} = x_{19}\) is found, but the algorithm detects \(y_9\) as additional vertex, which makes the perimeter of the polygon larger than that of the MPP.

Now we apply our new Algorithm 3 to the same boundary part. Since \(\beta _1\), \(\beta _2\), \(\beta _3\) present straight passing of the boundary, the initial cone is given by \(p=x_4\) (right border) and \(q=y_4\) (left border). Then \(p=x_5=x_4\) confirms the right border, \(y_5\) is ignored since it lies outside the cone to the left. The tiles \(\beta _6\), \(\beta _7\), \(\beta _8\) are ignored (straight passing), \(p=x_9\) confirms the right border, \(y_9\) lies inside the cone hence \(q=y_9\) gives a new left cone border with slope 2/7. Then \(p= x_{10}= x_9\) confirms the right border, \(y_{10}\) is ignored since it lies outside the cone on the left, \(\beta _{11}\) and \(\beta _{12}\) are ignored, \(p= x_{13}\) defines a new right border with slope 3/11, but \(y_{13}\) is ignored since it lies outside the cone to the left. In the next steps, \(p=x_{14}\) confirms the right border, \(y_{14}\), \(\beta _{15}\), \(\beta _{16}\), \(\beta _{17}\), \(x_{18}\) all are ignored, \(q= y_{18}\) confirms the left border, then \(x_{19}\), \(y_{19}\), \(x_{20}\), \(y_{20}\) all are ignored. Finally, \(x_{21}\) lies strictly to the left of \(\overrightarrow{m_ny_{21}}\), the while-condition of Algorithm 3 is not satisfied, the next MPP vertex \(m_{n+1} = p= x_{14}\) is found which is correct. It is easy to see that Algorithm 3 completes the correct sequence of MPP vertices.

Appendix B: Auxiliary Lemma for the Correctness Proof of Algorithm 3

Algorithm 3 works with cones of visibility, the current cone is rooted at the last found polygon vertex m and determined by p (right border \(\overrightarrow{mp}\)) and q (left border \(\overrightarrow{mp}\)), it is generated as the initial cone in Lines 6–7 of the algorithm. Then each \(\beta _k\) taken from the input list provides a k-th cone rooted at m and determined by \(x_k\) (right border) and \(y_k\) (left border). The condition in Line 9 requires the kth cone as well-defined, meaning that \(m,x_k,y_k\) form a left turn or are collinear. If all conditions of Line 9 are satisfied, the kth cone is compared with the current cone. As a result, the cone borders eventually are updated in Lines 10–11.

Lemma 5

For any regular complex \({\mathcal {C}}\) in a rectangular mosaic and its canonical boundary path of \({\mathcal {C}}\) as input list, the cones of visibility used in Algorithm 3 satisfy the following:

  1. (1)

    Each initial cone rooted at m and determined by \(x_i\) (right border) and \(y_i\) (left border) is well-defined. The angle given as \(\alpha = \sphericalangle (\overrightarrow{mx_i}, \overrightarrow{my_i} )\) satisfies \(0^{\circ }\le \alpha < 90^{\circ }\).

  2. (2)

    Each current cone rooted at m and determined by p (right border) and q (left border), obtained by eventual updating in Lines 10–11, is a well-defined subset of the initial cone.

  3. (3)

    Placing m at the origin of the plane, the initial cone belongs to exactly one quadrant of the plane or is reduced to a ray lying on the x- or y-axis.

  4. (4)

    Suppose that Algorithm 3 in Line 9 finds a kth cone which is not well-defined, that is, \((m,x_k,y_k)\) forms a right turn. Then both points \(x_k,y_k\) lie on the same side strictly outside the current cone, or \(x_k\) lies strictly outside the current cone to the left and \(y_k\) lies on the ray \(\overrightarrow{mq}\), or \(y_k\) lies strictly outside the current cone to the right and \(x_k\) lies on the ray \(\overrightarrow{mp}\).

Fig. 32
figure 32

All possible initial cones generated by Algorithm 3 if the last found polygon vertex m is convex, up to rotations by multiples of \(90^{\circ }\). Notations as z within a tile mean \(\beta _z\). The algorithm finds m as vertex of \(\beta _z\). From \(\beta _{z+1}\), the boundary path can only continue to the right, up or left, since \({\mathcal {C}}\) has no end tiles. If \(\beta _{z+2}\) lies to the right of \(\beta _{z+1}\), see b, \(\beta _{z+1}\) presents a right turn, hence \(x_{z+1}, y_{z+1}\) determine the initial cone. If \(\beta _{z+2}\) lies above \(\beta _{z+1}\), \(\beta _{z+1}\) presents straight passing and hence is ignored. Then if \(\beta _{z+2}\) presents a turn that can be to the left (f), or to the right (g), \(x_{z+2}, y_{z+2}\) define the initial cone. But \(\beta _{z+2}\) can present straight passing as well as other tiles, all collinear, until some \(\beta _{z+s}\) presents a right (j) or left turn. The latter case is not drawn, the initial cone would be degenerated to a ray. If \(\beta _{z+2}\) lies to the left of \(\beta _{z+1}\) then \(\beta _{z+1}\) is ignored, \(\beta _{z+2}\) offers a possible continuation to the left (c), up (d), or down (e). In e, \(\beta _{z+3} = \beta _{z-1}\), no initial cone is generated, the algorithm ends with returning m as unique polygon vertex, which is correct for a complex of four tiles

Fig. 33
figure 33

All possible initial cones generated by Algorithm 3 if the last found polygon vertex m is concave, up to rotations by multiples of \(90^{\circ }\). Notations as z within a tile mean \(\beta _z\). Now m is a concave vertex of \(fr(|{\mathcal {C}}|)\). From \(\beta _{z+1}\), the boundary path only can continue up or to the right. If \(\beta _{z+2}\) lies above \(\beta _{z+1}\), see b, \(\beta _{z+1}\) presents a left turn, hence \(x_{z+1}, y_{z+1}\) determine the initial cone. If \(\beta _{z+2}\) lies to the right of \(\beta _{z+1}\), \(\beta _{z+1}\) presents straight passing and is ignored, hence \(x_{z+2}, y_{z+2}\) are considered. If \(\beta _{z+2}\) presents a turn which can be to the left (c) or to the right (d), \(x_{z+2}, y_{z+2}\) define the initial cone. There may exist more collinear tiles, until some \(\beta _{z+s}\) presents a turn as in e. The case of \(\beta _{z+s}\) being a right turn is not drawn, the initial cone would be degenerated to a ray. It is not possible for \(\beta _{z+2}\) to lie below \(\beta _{z+1}\), since the frontier point m cannot be completely surrounded by complex tiles

Proof

Inspecting all possible initial cones generated by Algorithm 3 in Figs. 32 and 33, confirms the facts stated in (1) and (3). The angle formed by the initial cone depends on whether there are collinear tiles starting with \(\beta _{z+1}\) or not, but also on the proportion between width and height of the appearing tiles. The initial cone is the first current cone, it is well-defined by construction. Each current cone resulting from updates in Lines 10–11, is well-defined because updating only is performed if the condition of Line 9 is satisfied. This also guarantees that updating confirms or restricts the current cone, so, the current cone always remains the same or becomes a smaller subset, this confirms (2).

To prove (4), suppose that Algorithm 3 has determined a current cone given by mpq that was initialized by \(x_i, y_i\) from \(\beta _i\cap \beta _{i+1}\). Then k is found in Line 9 where \((m,x_k,y_k)\) is a right turn but for all \(t\in \{ i, i+1, \ldots , k-1\}\), the tth cone is well-defined (\(m,x_t,y_t\) form a left turn or are collinear).

Assuming m placed at the origin of the plane, by (3), the current cone lies in exactly one quadrant of the plane or is a ray lying on some coordinate axis. Up to rotation by multiples of \(90^{\circ }\), all possible initial cones are shown in Figs. 32 and 33. Since \({\mathcal {C}}\) belongs to a rectangular mosaic, the movement from \(\beta _k\) to \(\beta _{k+1}\) only can be up, to the right, down and left, and the edge \(\beta _k\cap \beta _{k+1}\) is parallel to a coordinate axis. The current cone goes through all tiles from the tile which provided the point m, until \(\beta _k\).

Consider a current cone belonging to the first quadrant, the discussion for other quadrants would be similar. Then the cone looks like those of Fig. 34 where (a)(b) show that any movement from \(\beta _k\) to \(\beta _{k+1}\) in directions up or to the right generates a well-defined kth cone, although \(x_k\) or \(y_k\) can lie outside the current cone. In contrast, any movement from \(\beta _k\) to \(\beta _{k+1}\) to the left or down causes that \((m, x_k, y_k)\) forms a right turn. Moreover, the initial cone starts with movements to the right and up (or, vice versa), see Figs. 32b, g, j and 33b, c, e. Therefore, a movement to the left is only possible if \(\beta _k\) presents a left turn (\(\beta _{k-1}\) lies below \(\beta _k\)), and a movement down requires that \(\beta _k\) presents a right turn (\(\beta _{k-1}\) lies on the left of \(\beta _k\)) where \(\beta _{k-1}\) also intersects the current cone, see Fig. 34c, d. By the updates in Lines 10–11, when Algorithm 3 reaches \(\beta _k\), \(y_{k-1}\) defines the left cone border or lies to the left outside the cone. Likewise, \(x_{k-1}\) defines the right cone border or lies to the right outside the cone. For \(\beta _k\) being a left turn, see Fig. 34c, if \(y_k= y_{k-1}\) lies outside the cone then both \(x_k, y_k\) are outside the cone on the left side, but if \(y_k= y_{k-1}\) defines the left cone border then \(y_k\) lies on \(\overrightarrow{mq}\) and \(x_k\) to the left outside the cone. For \(\beta _k\) being a right turn, Fig. 34d shows when \(x_k= x_{k-1}\) lies outside the cone, then both \(x_k, y_k\) are outside the cone on the right side, but \(x_k= x_{k-1}\) also can define the right cone border, then \(x_k\) would lie on \(\overrightarrow{mp}\) and \(y_k\) to the right outside the cone. This proves (4) for a cone lying in the first quadrant.

Let now the current cone be a ray \(\overrightarrow{c}\) lying on a coordinate axis. We consider the positive part of the x-axis, the arguments for other cases would be similar. Such a ray is result of updates from an initial cone as those in Figs. 32b, d, f, h and 33d. Since all tiles \(\beta _i, \beta _{i+1}, \ldots , \beta _{k-1}, \beta _{k}\) touch the ray \(\overrightarrow{c}\) and belong to a rectangular mosaic, each tile shares its bottom or top side with \(\overrightarrow{c}\). Figure 35a–f shows that for any movement from \(\beta _k\) up or down or to the right to \(\beta _{k+1}\), the kth cone is well-defined. A right turn \((m,x_k, y_k)\) only appears in the situation of Fig. 35g: \(\beta ({\mathcal {C}})\) moving from \(\beta _{k}\) to the left to \(\beta _{k+1}\) is only possible if \(\beta _{k-1}, \beta _{k-2}\) are situated as shown in the figure, then \(y_k\) lies on \(\overrightarrow{mq}\) and \(x_k\) lies outside the cone to the left. This completes to prove (4). \(\square \)

Fig. 34
figure 34

Current cones in the first quadrant can result, for example, from initial cones as in Figs. 32b, g, j and 33b, c, e, right borders are drawn in blue, left borders in brown, a notation k within a tile means \(\beta _k\). In a, b, a movement from \(\beta _k\) up or to the right to \(\beta _{k+1}\), always generates a well-defined kth cone given by \((m, x_k, y_k)\). In c, d, the kth cone is not well-defined, \((m, x_k, y_k)\) is a right turn. In c \(\beta _k\) presents a left turn, \(x_{k-1}\) and \(y_{k-1}\) determine the current cone. In d \(\beta _{k+1}\) lies below \(\beta _k\), \(y_{k-1}\) defines the left current cone border but \(x_{k-1}\) lies to the right outside the cone (Color figure online)

Fig. 35
figure 35

All possible movements from \(\beta _k\) to \(\beta _{k+1}\) studied in the proof of Lemma 5(4) in relation to a current cone degenerated to a ray lying on the positive part of the x-axis, when m is placed at the plane origin. Situation (h) is not possible since the central point \(x_k\in fr(|{\mathcal {C}}|)\) cannot be completely surrounded by complex tiles

Appendix C: Examples and Error Analysis for the Sklansky–Chazin–Hansen MPP Algorithm

The following examples show that the Sklansky–Chazin–Hansen MPP Algorithm has many procedural and strategy errors and is based on an erroneous mathematical foundation.

Fig. 36
figure 36

Algorithm 4 for Example 10, \(n=1\) and \(n=2\)

Example 10

We apply Algorithm 4 to the complex of square tiles also treated in Example 1 (see Fig. 13 in Sect. 6), using as input the canonical boundary path which is regular. The example presents ideal conditions, all sets \(w_i, u_i\) are well-defined.

After the MPP vertex \(m_1\) is found, \(\beta ({\mathcal {C}} )\) is shifted and becomes \(\beta ({\mathcal {C}} )=\) \((\beta _0,\) \(\beta _1,\) \(\beta _2,\) \(\ldots ,\) \(\beta _{23})\) with \(\beta _0 = T_0\), \(p_0=m_1\) also is the first candidate found. Now n = 1, \(K(1)=1\), the reference vector r is shown in Fig. 36 which illustrates the progress. For \(k=1\), \(u_1=m_1\) is again found, \(h_1=\measuredangle (\textbf{r},\overrightarrow{m_1m_1} )\) cannot be measured since \(\overrightarrow{m_1m_1}\) has zero length, which is an error of the rules of Step 5. If a vector \(\overrightarrow{m_nz}\) is a single point, \(h_k\),\(g_k\) are not well-defined, \(H_k\) and \(G_k\) should remain as unchanged from the (k-1)th step; for the starting case \(k=K(n)\), it is convenient to set \(H_k=0^{\circ }\), \(G_k=360^{\circ }\), then augment k and proceed to Step 4.

For \(k=2\), \(p_2=w_2\) is found, \(h_2=\max \{\measuredangle (\textbf{r},\overrightarrow{m_1z} ), z\in u_2\} = 45^{\circ } = H_2\), \(g_2= \measuredangle (\textbf{r},\overrightarrow{m_1w_2} )\) \(= 90^{\circ } = G_2\), \(H_2<G_2\). A cone rooted at \(m_1\) is opened by the angles \(H_2\) (left border) and \(G_2\) (right border), r lies on its left side. Then \(\beta _3\) gives no candidate, \(h_3=\max \{\measuredangle (\textbf{r},\overrightarrow{m_1z} ), z\in u_3\} > 45^{\circ }\), \(H_3=h_3\) reduces the cone, \(g_3=\min \{\measuredangle (\textbf{r},\overrightarrow{m_1z} ), z\in w_3\} = 90^{\circ } = G_3\), \(p_3= p_2\), \(H_3<G_3\), \(k=4\) provides the candidate \(p_4= u_4\), \(h_4=\measuredangle (\textbf{r},\overrightarrow{m_1u_4} ) = H_3 = H_4\), \(g_4=\min \{\measuredangle (\textbf{r},\overrightarrow{m_1z} ), z\in w_4\} < G_3\), \(G_4=g_4\) constrains the cone, \(H_4<G_4\). For \(k=5,6,7\), the algorithm constructs the cone shadowed grey in Fig. 36, \(p_6= p_5= w_5\), \(p_8 =p_7= u_7\), \(H_8>G_8\) leads to \(n=2\) and the next MPP vertex \(m_2= p_8= u_7\). \(H_8>G_8\) means that the cone is empty, its right border given by \(G_8\) lies on the left from the left border determined by \(H_8\).

Restarting with n = 2, \(K(1)=8\), see Fig. 36, \(\beta _8\) gives no candidate, \(h_8= 90^{\circ } = H_8\), \(g_8 = G_8>H_8\), a cone rooted at \(m_2\) is opened by \(H_8\) (left border) and \(G_8\) (right border). The candidate \(p_9= u_9\) is found, \(h_9= 90^{\circ } = H_8= H_9\), \(G_9= g_9= 90^{\circ } < G_8\), resulting in \(H_9= G_9\). It is an error that this case is not considered in Algorithm 4. The construction of the MPP frontier should be continued when the cone is reduced to a ray, \(H_k < G_k\) in Step 7 should be substituted by \(H_k \le G_k\). Proceeding, \(\beta _{10}\) provides no candidate, \(h_{10}= 90^{\circ } = H_9 = H_{10}\), \(G_{10}= g_{10}< G_9\), \(p_{10}= p_9\). Since \(H_{10}>G_{10}\), we get \(n=3\) and the next MPP vertex \(m_3= p_{10}= u_9\).

Fig. 37
figure 37

Advances of Algorithm 4 for Example 10, \(n=3\)

Proceeding with n = 3, \(K(3)=10\), see Fig. 37, \(\beta _{10}\) gives no candidate, \(h_{10}=\max \{\measuredangle (\textbf{r},\overrightarrow{m_3z} ), z\in u_{10}\} = 90^{\circ } = H_{10}\), \(g_{10}=\min \{\measuredangle (\textbf{r},\overrightarrow{m_3z} ), z\in w_{10}\} = 135^{\circ } =G_{10}\), \(p_{10}= p_9= m_3\), \(H_{10}<G_{10}\). For \(k=11,12,13\), \(p_{11} = w_{11}\) and \(p_{12}= u_{12}\) are found, \(H_{11} = h_{11}\) and \(G_{13}=g_{13}\) reduce the cone which is shaded grey in Fig. 37. Then \(p_{14} = u_{14}\), \(H_{14} = h_{14}=\measuredangle (\textbf{r},\overrightarrow{m_3u_{14}} ) < H_{13}\), \(G_{14} = g_{14} < G_{13}\). Since \(H_{14}>G_{14}\) we get \(n=4\), \(p_{14}= u_{14}\) is considered the next MPP vertex \(m_4\) which is a false result, \(m_4\) should be \(p_{13}= p_{12}= u_{12}\), see Figure 37. If skipping \(u_{12}\) and taking \(u_{14}\) as next polygon vertex, the polygon excludes \(\beta _{12}\) and is not a preimage of \({\mathcal {C}}\).

Fig. 38
figure 38

Algorithm 4 for Example 10, \(n=4,5,7\)

Restarting with n = 4 and using the correct MPP vertex \(m_4= u_{12}\), \(K(4)=13\), see Fig. 38, only applying the already mentioned corrections, one finds n = 5, \(m_5= p_{14}= u_{14}\) and the first concave MPP vertex \(m_6= p_{19} = w_{17}\). For n = 6, K(6) should have value 18, but the rule in Step 2 gives the result 17, the rule is not correct if \(m_n\) is concave. Continuing with \(k=18\), \(\beta _{18}\) provides no candidate. Recall that the angles are measured in clockwise sense from r to the vector \(\overrightarrow{m_6z}\). Since \(m_6\) is a concave vertex, the angles turn out as larger that \(180^{\circ }\).

Only using our corrections, one can get the next MPP vertex \(m_7= p_{21}= w_{20}\) and proceed from n = 7 to find \(p_{23} =u_{23}\), \(h_{23}= H_{22}= H_{23}< G_{23}= g_{23} < G_{22}\), the cone given by \(H_{23}\) and \(G_{23}\) is shown in Fig. 38. Since \(\beta _{23}\) is the last tile in \(\beta ({\mathcal {C}})\), Algorithm 4 ends to return the list MPP = \((m_1, m_2, \ldots , m_7)\). Note that the stop condition is never reached, it is necessary to visit \(\beta _{24} = \beta _0\) after \(\beta _{23}\), to obtain \(H_k >G_k\) satisfied, and so to find \(m_1\), again.

For the small complex with ideal conditions in this example, Algorithm 4 would not determine the correct MPP, it presents several types of errors which occur a large number of times.

\(\vartriangle \)

Fig. 39
figure 39

Algorithm 4 for Example 11

Example 11

We apply Algorithm 4 to the simple boundary path in Fig. 39, which shows a last found MPP vertex m and the cone borders up to \(k=6\), \(p_6= u_6\). The candidate \(p_7 = w_7\) is found, \(h_7=\max \{\measuredangle (\textbf{r},\overrightarrow{mz} ), z\in u_7\} > H_6\), \(H_7= h_7\) defines a new left cone border, \(g_7= \measuredangle (\textbf{r},\overrightarrow{mw_7} ) > G_6\) hence \(G_7=\min \{g_7, G_6\} = G_6\), \(H_7\le G_7\). The tile \(\beta _8\) provides no candidate, \(h_8=\max \{\measuredangle (\textbf{r},\overrightarrow{mz} ), z\in u_8\} = H_8 > H_7\) defines a new “left border”, \(g_8= \min \{ \measuredangle (\textbf{r},\overrightarrow{mz} ), z\in w_8\}\ = G_7 = G_8\), \(p_8= p_7\). Now \(H_8 > G_8\), \(p_8 = w_7\) is found as next MPP vertex, this is a false result because \(\overline{mw_7}\) does not fit in \(|{\mathcal {B}}({\mathcal {C}})|\). The last candidate \(p_6= u_6\) found before also is not the next MPP vertex, although \(\overline{mu_6}\) fits in the boundary. The correct next MPP vertex is given as \(p_5= w_5\), but this cannot be found by the algorithm. \(\vartriangle \)

Examples 10 and 11 reveal several errors, in particular, that \(p_k\) is updated too early: suppose \(p_k\) is updated in Step 6 and then \(H_k> G_k\) in Step 7, i.e., \(H_{k-1}\le G_{k-1}\). Then \(p_k\) is considered the next MPP vertex, which is in general a wrong result since \(p_k\) has just caused the contradiction \(H_k> G_K\), which means that the cone is empty. Then \(p_k\) is already no longer the possible next MPP node since \(\overline{m_np_k}\) is no longer guaranteed to fit in \(|{\mathcal {B}}(C)|\). The true next MPP node is then given as a candidate found in some previous step. Another error is that \(h_k, g_k\) are based on angles \(\measuredangle (\textbf{r},\overrightarrow{pz})\) for \(z\in u_k\) or \(z\in w_k\), respectively, which are not defined for \(p=z\). The situation \(p\in u_k\) or \(p\in w_k\) can occur at each restart after finding a new MPP vertex, but is not considered. Furthermore, the condition \(H_k < G_k\) in Step 7 should be replaced by \(H_k\le G_k\), which allows to continue the construction of a straight line segment belonging to the MPP boundary when the cone is reduced to a ray, since the line then still fits in \({\mathcal {B}} ({\mathcal {C}})\). Finally, the rule defining K(n) is only correct for convex \(m_n\), and the stop condition of the algorithm is never satisfied, since \(m_0\) cannot be found again by processing the input list only up to \(\beta _t\).

Example 10 also shows that Theorem 11 and its proof in [22] are not correct: this theorem affirms that Algorithm 4 determines the ordered sequence of MPP vertices. The main argument of its proof supposes that \(m_n\) is a MPP vertex, and Algorithm 4 has reached Step 7 and \(H_k> G_k\) is true, that is, \(H_{k-1}\le G_{k-1}\). Then let \(s_k\) be the interior (that is, without its endpoints) of a segment of the MPP frontier joining \(m_n\) by counterclockwise tracing to any point of the tile \(\beta _k\), assuming also that \(K(n)\le j<k\) for some tile \(\beta _j\) which provides a candidate. The proof in [22] (p. 267) states that then \(s_k\) contains exactly one MPP vertex which precisely is given as the last found candidate \(p_k\). Both these affirmations are false.

To see this, consider Example 10 for \(n=3\) and \(k=14\), see Fig. 37. The MPP frontier intersects \(\beta _{14}\) only at the point \(u_{14}\), hence \((\overline{m_3u_{12}}\cup \overline{u_{12}u_{14}}){\setminus } \{ m_3, u_{14}\}\) is the unique possibility for \(s_{14}\). It is true that \(s_{14}\) contains exactly one MPP vertex, but this is \(u_{12}\) which does not coincide with the last found candidate \(p_{14}=u_{14}\). In Example 11, see Fig. 39, \(H_k> G_k\) is satisfied for the first time for \(k=8\), \(\beta _8\) gives no candidate, \(p_8= p_7= w_7\). The MPP frontier tracing from m goes first through \(w_5\), then touches \(w_7\), then continues at the inferior horizontal side of \(\beta _8\). Hence, for any point \(p\ne w_7\) lying on that side of \(\beta _8\), the curve \(\overline{mw_5}\cup \overline{w_5w_7}\cup \overline{w_7p}\) (excluding its endpoints m and p) is a possible case for \(s_8\). Each such \(s_8\) contains the two MPP vertices \(w_5\) and \(w_7\), but the last found candidate \(w_7\) is not the correct next MPP vertex which should be found for \(k=8\).

Finally, even if one corrects all the errors already described, one can easily find complexes where the reference vector lies inside the cone, which leads to ambiguities in the angle calculations and erroneous results. Recall that a similar error was observed in Example 3 for the base line in the Sklansky–Kibler MPP algorithm.

Rights and permissions

Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Wiederhold, P. Computing the Minimal Perimeter Polygon for Sets of Rectangular Tiles based on Visibility Cones. J Math Imaging Vis 66, 873–903 (2024). https://doi.org/10.1007/s10851-024-01203-z

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10851-024-01203-z

Keywords

Mathematics Subject Classification

Navigation