Skip to main content
Log in

How to compute the convex hull of a binary shape? A real-time algorithm to compute the convex hull of a binary shape

  • Research
  • Published:
Journal of Real-Time Image Processing Aims and scope Submit manuscript

Abstract

In this article, we present an algorithm to compute the convex hull of a binary shape. Efficient algorithms to compute the convex hull of a set of points had been proposed long time ago. For a binary shape, the common practice is to rely on one of them: to compute the convex hull of binary shape, all pixels of the shape are first listed, and then the convex hull is computed on this list of points. The computed convex hull is finally rasterized to provide the final result [as, for example, in the famous scikit-image library (scikit-image: Image processing in python. https://scikit-image.org)]. To compute the convex hull of an arbitrary set of points, the points of the list that lie on the outline of the convex hull must be selected (to simplify, we call these points “extrema”). To find them, for an arbitrary set of points, it is necessary to browse all the points but not in the particular case of a binary shape. In this specific situation, the extrema necessarily belong to the inner boundary of the shape. It is a waste of time to browse all the pixels as it is possible to discard most of them when we search for these extrema. Based on this analysis, we propose a new method to compute the convex hull dedicated to binary shapes. This method browses as few pixels as possible to select a small subset of boundary pixels. Then it deduces the convex hull only from this subset. As the size of the subset is very small, the convex hull is computed in real time. We compare it with the commonly used methods and common functions from libraries to prove that our approach is faster. This comparison shows that, for a very small shape, the difference is acceptable, but when the area of the shape grows, this difference becomes significant. This leads us to conclude that substituting current functions to compute convex hull of binary shapes with our algorithm in frequently used libraries would lead to a great improvement.

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

Access this article

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

Similar content being viewed by others

Data availability

The database used for the evaluation is openly available at https://www.lrde.epita.fr/dload/papers/fabrizio.23.jrtip.tar.bz2

References

  1. Jayaram, M.A., Fleyeh, H.: Convex hulls in image processing: a scoping review. Am. J. Intell. Syst. 6(2), 48–58 (2016)

    Google Scholar 

  2. Giorginis, T., Ougiaroglou, S., Evangelidis, G., Dervos, D.A.: Fast data reduction by space partitioning via convex hull and MBR computation. Pattern Recogn. 126, 108553 (2022)

    Article  Google Scholar 

  3. Shen, Z., Zhao, M., Jia, X., Liang, Y., Fan, L., Yan, D.-M.: Combining convex hull and directed graph for fast and accurate ellipse detection. Graph. Models 116 (2021)

  4. Safavi, S., Khan, U.A.: Localization in mobile networks via virtual convex hulls. IEEE Trans. Signal Inf. Process. Netw. 4(1), 188–201 (2018)

    MathSciNet  Google Scholar 

  5. Sirakov, N.M.: A new active convex hull model for image regions. J. Math. Imaging Vision 26(3), 309–325 (2006)

    Article  MathSciNet  MATH  Google Scholar 

  6. Cevikalp, H., Yavuz, H.S., Triggs, B.: Face recognition based on videos by using convex hulls. IEEE Trans. Circuits Syst. Video Technol. 30(12), 4481–4495 (2020)

    Article  Google Scholar 

  7. Gomes, A.J.P.: A total order heuristic-based convex hull algorithm for points in the plane. Comput. Aided Des. 70, 153–160 (2016)

    Article  MathSciNet  Google Scholar 

  8. Torch implementation: https://github.com/mosqueteer/TORCH/

  9. scikit-image: Image processing in python. https://scikit-image.org

  10. Qhull. https://www.qhull.org

  11. Matlab. https://www.mathworks.com

  12. Graham, R.L.: An efficient algorithm for determining the convex hull of a finite planar set. Inf. Process. Lett. 1, 132–133 (1972)

    Article  MATH  Google Scholar 

  13. Pylene. https://gitlab.lrde.epita.fr/olena/pylene

  14. Andrew, A.M.: Another efficient algorithm for convex hulls in two dimensions. Inf. Process. Lett. 9(5), 216–219 (1979)

    Article  MATH  Google Scholar 

  15. Chan, T.M.: Optimal output-sensitive convex hull algorithms in two and three dimensions. Discrete Comput. Geom. 16(4), 361–368 (1996)

    Article  MathSciNet  MATH  Google Scholar 

  16. Bradford Barber, C., Dobkin, D.P., Huhdanpaa, H.: The quickhull algorithm for convex hulls. ACM Trans. Math. Softw. 22(4), 469–483 (1996)

    Article  MathSciNet  MATH  Google Scholar 

  17. Eddy, W.F.: A new convex hull algorithm for planar sets. ACM Trans. Math. Softw. 3(4), 398–403 (1977)

    Article  MATH  Google Scholar 

  18. Bykat, A.: Convex hull of a finite set of points in two dimensions. Inf. Process. Lett. 7, 296–298 (1978)

    Article  MathSciNet  MATH  Google Scholar 

  19. Akl, S.G., Toussaint, G.T.: A fast convex hull algorithm. Inf. Process. Lett. 7(5), 219–222 (1978)

    Article  MathSciNet  MATH  Google Scholar 

  20. Melkman, A.A.: On-line construction of the convex hull of a simple polyline. Inf. Process. Lett. 25, 11–12 (1987)

    Article  MathSciNet  MATH  Google Scholar 

  21. Jarvis, R.A.: On the identification of the convex hull of a finite set of points in the plane. Inf. Process. Lett. 2(1), 18–21 (1973)

    Article  MATH  Google Scholar 

  22. Alshamrani, R., Alshehri, F., Kurdi, H.: A preprocessing technique for fast convex hull computation. Procedia Comput. Sci. 170, 317–324 (2020)

    Article  Google Scholar 

  23. Mukherjee, D.: Reduction of two-dimensional data for speeding up convex hull computation (2022). arXiv:2201.11412

  24. Potebnia, A., Pogorilyy, S.: Innovative GPU accelerated algorithm for fast minimum convex hulls computation. In: 2015 Federated Conference on Computer Science and Information Systems (FedCSIS), pp. 555–561. IEEE (2015)

  25. Qin, J., Mei, G., Cuomo, S., Sixu, G., Li, Y.: Cudachpre2d: A straightforward preprocessing approach for accelerating 2d convex hull computations on the GPU. Concurr. Comput. Pract. Exp. 32, 04 (2019)

    Google Scholar 

  26. Nguyen, L.K., Song, C., Ryu, J., An, P.T., Hoang, N.-D., Kim, D.-S.: Quickhulldisk: A faster convex hull algorithm for disks. Appl. Math. Comput. 363, 124626 (2019)

    MathSciNet  MATH  Google Scholar 

  27. Kallrath, J., Ryu, J., Song, C., Lee, M., Kim, D.-S.: Near optimal minimal convex hulls of disks. J. Global Optim. 80(3), 551–594 (2021)

    Article  MathSciNet  MATH  Google Scholar 

  28. Chan, T.M., Chen, E.Y.: Multi-pass geometric algorithms. In: Proceedings of the twenty-first annual symposium on Computational geometry, pp. 180–189 (2005)

  29. Brodal, G.S., Jacob, R.: Dynamic planar convex hull. In: The 43rd Annual IEEE Symposium on Foundations of Computer Science, 2002. Proceedings, pp. 617–626. IEEE (2002)

  30. Gao, M., Cao, T.-T., Tan, T.-S., Huang, Z.: Flip-flop: convex hull construction via star-shaped polyhedron in 3D. In: Proceedings of the ACM SIGGRAPH Symposium on Interactive 3D Graphics and Games, pp. 45–54 (2013)

  31. Gao, M., Cao, T.-T., Nanjappa, A., Tan, T.-S., Huang, Z.: ghull: A GPU algorithm for 3D convex hull. ACM Trans. Math. Softw. (TOMS) 40(1), 1–19 (2013)

    Article  MathSciNet  MATH  Google Scholar 

  32. Balestriero, R., Wang, Z., Baraniuk, R.G.: Deephull: Fast convex hull approximation in high dimensions. In: ICASSP 2022–2022 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 3888–3892 (2022)

  33. Opencv. https://opencv.org

  34. Roynard, M., Carlinet, E., Géraud, T.: An image processing library in modern c++: getting simplicity and efficiency with generic programming. In: Kerautret, B., Colom, M., Lopresti, D., Monasse, P., Talbot, H. (eds.) Reproducible research in pattern recognition, pp. 121–137. Springer International Publishing, Cham (2019)

  35. Cgal: The computational geometry algorithms library. https://www.cgal.org

  36. Fabrizio, J.: A precise skew estimation algorithm for document images using KNN clustering and fourier transform. In: IEEE International Conference on Image Processing, pp. 2585–2588 (2014)

  37. Fabrizio, J., Cord, M., Marcotegui, B.: Text extraction from street level images. In: City models, roads and traffic (ISPRS Workshop—CMRT09), Paris, France (2009)

  38. Fabrizio, J., Robert-Seidowsky, M., Dubuisson, S., Calarasanu, S., Boissel, R.: Textcatcher: a method to detect curved and challenging text in natural scenes. Int. J. Doc. Anal. Recognit. (IJDAR) 19, 99–117 (2016)

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Jonathan Fabrizio.

Additional information

Publisher's Note

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

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

Fabrizio, J. How to compute the convex hull of a binary shape? A real-time algorithm to compute the convex hull of a binary shape. J Real-Time Image Proc 20, 106 (2023). https://doi.org/10.1007/s11554-023-01359-8

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1007/s11554-023-01359-8

Keywords

Navigation