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.
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
Jayaram, M.A., Fleyeh, H.: Convex hulls in image processing: a scoping review. Am. J. Intell. Syst. 6(2), 48–58 (2016)
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)
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)
Safavi, S., Khan, U.A.: Localization in mobile networks via virtual convex hulls. IEEE Trans. Signal Inf. Process. Netw. 4(1), 188–201 (2018)
Sirakov, N.M.: A new active convex hull model for image regions. J. Math. Imaging Vision 26(3), 309–325 (2006)
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)
Gomes, A.J.P.: A total order heuristic-based convex hull algorithm for points in the plane. Comput. Aided Des. 70, 153–160 (2016)
Torch implementation: https://github.com/mosqueteer/TORCH/
scikit-image: Image processing in python. https://scikit-image.org
Qhull. https://www.qhull.org
Matlab. https://www.mathworks.com
Graham, R.L.: An efficient algorithm for determining the convex hull of a finite planar set. Inf. Process. Lett. 1, 132–133 (1972)
Andrew, A.M.: Another efficient algorithm for convex hulls in two dimensions. Inf. Process. Lett. 9(5), 216–219 (1979)
Chan, T.M.: Optimal output-sensitive convex hull algorithms in two and three dimensions. Discrete Comput. Geom. 16(4), 361–368 (1996)
Bradford Barber, C., Dobkin, D.P., Huhdanpaa, H.: The quickhull algorithm for convex hulls. ACM Trans. Math. Softw. 22(4), 469–483 (1996)
Eddy, W.F.: A new convex hull algorithm for planar sets. ACM Trans. Math. Softw. 3(4), 398–403 (1977)
Bykat, A.: Convex hull of a finite set of points in two dimensions. Inf. Process. Lett. 7, 296–298 (1978)
Akl, S.G., Toussaint, G.T.: A fast convex hull algorithm. Inf. Process. Lett. 7(5), 219–222 (1978)
Melkman, A.A.: On-line construction of the convex hull of a simple polyline. Inf. Process. Lett. 25, 11–12 (1987)
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)
Alshamrani, R., Alshehri, F., Kurdi, H.: A preprocessing technique for fast convex hull computation. Procedia Comput. Sci. 170, 317–324 (2020)
Mukherjee, D.: Reduction of two-dimensional data for speeding up convex hull computation (2022). arXiv:2201.11412
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)
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)
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)
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)
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)
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)
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)
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)
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)
Opencv. https://opencv.org
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)
Cgal: The computational geometry algorithms library. https://www.cgal.org
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)
Fabrizio, J., Cord, M., Marcotegui, B.: Text extraction from street level images. In: City models, roads and traffic (ISPRS Workshop—CMRT09), Paris, France (2009)
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)
Author information
Authors and Affiliations
Corresponding author
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.
About this article
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
Received:
Accepted:
Published:
DOI: https://doi.org/10.1007/s11554-023-01359-8