Abstract
We propose an accurate and efficient 2D line detection technique based on the standard Hough transform (SHT) and least median of squares (LMS). We prove our method to be very accurate and robust to noise and occlusions by comparing it with state-of-the-art line detection methods using both qualitative and quantitative experiments. LMS is known as being very robust but also as having high computation complexity. To make our method practical for real-time applications, we propose a parallel algorithm for LMS computation which is based on point-line duality. We also offer a very efficient implementation of this algorithm for GPU on CUDA architecture. Despite many years since LMS methods have first been described and the widespread use of GPU technology in computer vision and image-processing systems, we are unaware of previous work reporting the use of GPUs for LMS and line detection. We measure the computation time of our GPU-accelerated algorithm and prove it is suitable for real-time applications. Our accelerated LMS algorithm is up to 40 times faster than the fastest single-threaded CPU-based implementation of the state-of-the-art sequential algorithm.
Similar content being viewed by others
Notes
Additional results for the three applications are provided in the supplemental.
Available: https://github.com/ligaripash/CudaLMS2D.git.
References
Atiquzzaman, M., Akhtar, M.W.: Complete line segment description using the hough transform. Image Vis. Comput. 12(5), 267–273 (1994)
Batcher, K.E.: Sorting networks and their applications. In: Proceedings of the April 30–May 2, 1968, spring joint computer conference, pp. 307–314. ACM (1968)
Bradski, G., Kaehler, A.: OpenCV. Dr. Dobb’s journal of software tools 3 (2000)
Candamo, J., Kasturi, R., Goldgof, D., Sarkar, S.: Detection of thin lines using low-quality video from low-altitude aircraft in urban settings. IEEE Trans. Aerosp. Electron. Syst. 45(3), 937–949 (2009)
Cole, R., Salowe, J.S., Steiger, W.L., Szemerédi, E.: An optimal-time algorithm for slope selection. SIAM J. Comput. 18(4), 792–810 (1989)
Dillencourt, M.B., Mount, D.M., Netanyahu, N.S.: A randomized algorithm for slope selection. Int. J. Comput. Geom. Appl. 2(01), 1–27 (1992)
Duda, R.O., Hart, P.E.: Use of the hough transformation to detect lines and curves in pictures. Commun. ACM 15(1), 11–15 (1972)
Edelsbrunner, H., Souvaine, D.L.: Computing least median of squares regression lines and guided topological sweep. J. Am. Stat. Assoc. 85(409), 115–119 (1990)
Erickson, J., Har-Peled, S., Mount, D.M.: On the least median square problem. Discrete Comput. Geom. 36(4), 593–607 (2006)
Fernandes, L.A.F., Oliveira, M.M.: Kht sansbox. https://sourceforge.net/projects/khtsandbox (2008)
Fernandes, L.A.F., Oliveira, M.M.: Real-time line detection through an improved hough transform voting scheme. Pattern Recognit. 41(1), 299–314 (2008)
Furukawa, Y., Shinagawa, Y.: Accurate and robust line segment extraction by analyzing distribution around peaks in hough space. Comput. Vis. Image Underst. 92(1), 1–25 (2003)
Galambos, C., Kittler, J., Matas, J.: Gradient based progressive probabilistic hough transform. Proc. Vis. Image Signal Process. 148(3), 158–165 (2001)
Gatos, B., Perantonis, S.J., Papamarkos, N.: Accelerated hough transform using rectangular image decomposition. Electron. Lett. 32(8), 730–732 (1996)
Guan, J., An, F., Zhang, X., Chen, L., Mattausch, H.J.: Real-time straight-line detection for xga-size videos by hough transform with parallelized voting procedures. Sensors 17(2), 270 (2017)
Ji, J., Chen, G., Sun, L.: A novel hough transform method for line detection by enhancing accumulator array. Pattern Recognit. Lett. 32(11), 1503–1510 (2011)
Jošth, R., Dubská, M., Herout, A., Havel, J.: Real-time line detection using accelerated high-resolution hough transform. In: Heyden A., Kahl F. (eds.) Scandinavian Conference on Image Analysis, vol. 6688, pp. 784–793. Springer, Berlin, Heidelberg (2011)
Kiryati, N., Eldar, Y., Bruckstein, A.M.: A probabilistic hough transform. Pattern Recognit. 24(4), 303–316 (1991)
Klette, R.: image sequence analysis test site. http://www.mi.auckland.ac.nz/EISATS/ (2013)
Klette, R.: image sequence analysis test site. http://www.elderlab.yorku.ca/YorkUrbanDB/ (2015)
Xiaofeng, L., Song, L., Shen, S., He, K., Songyu, Y., Ling, N.: Parallel hough transform-based straight line detection and its fpga implementation in embedded vision. Sensors 13(7), 9223–9247 (2013)
Mukhopadhyay, P., Chaudhuri, B.B.: A survey of hough transform. Pattern Recognit. 48(3), 993–1010 (2015)
Oberst, J., Joachim Flohrer, S., Elgner, T.M., Margonis, A., Schrödter, R., Wilfried Tost, M., Buhl, J.E., Christou, A.: The smart panoramic optical sensor head (sposh)a camera for observations of transient luminous events on planetary night sides. Planet. Space Sci. 59(1), 1–9 (2011)
Peters, H., Schulz-Hildebrandt, O., Luttenberger, N.: Fast in-place sorting with cuda based on bitonic sort. In: Wyrzykowski R., Dongarra J., Karczewski K., Wasniewski J. (eds.) Parallel Processing and Applied Mathematics, vol. 2409, pp. 403–410. Springer, Berlin, Heidelberg (2010)
Rafalin, E., Souvaine, D., Streinu, I.: Topological sweep in degenerate cases. In: Mount D.M., Stein C. (eds.) Algorithm Engineering and Experiments, vol. 6067, pp. 155–165. Springer, Berlin, Heidelberg (2002)
Ramachandran, R.M., Karpand, V., Karp, R.M.: A survey of parallel algorithms for shared-memory machines. In: van Leeuwen J. (ed.) Handbook of Theoretical Computer Science, vol A, pp. 869–941. Elsevier, Amsterdam (1990)
Rousseeuw, P.J.: Least median of squares regression. J. Am. Stat. Assoc. 79(388), 871–880 (1984)
Sanders, J., Kandrot, E.: CUDA by Example: An Introduction to General-Purpose GPU Programming. Addison-Wesley Professional, Boston (2010)
Ser, P.-K., Siu, W.-C.: A new generalized hough transform for the detection of irregular objects. J. Vis. Commun. Image Represent. 6(3), 256–264 (1995)
Souvaine, D.L., Steele, J.M.: Time-and space-efficient algorithms for least median of squares regression. J. Am. Stat. Assoc. 82(399), 794–801 (1987)
Steele, J.M., Steiger, W.L.: Algorithms and complexity for least median of squares regression. Discrete Appl. Math. 14(1), 93–100 (1986)
Stromberg, A.J.: Computing the exact least median of squares estimate and stability diagnostics in multiple linear regression. SIAM J. Sci. Comput. 14(6), 1289–1299 (1993)
Tu, C.: Enhanced Hough transforms for image processing. PhD thesis, Université Paris-Est, (2014)
van den Braak, G.J., Nugteren, C., Mesman, B., Corporaal, H.: Fast Hough transform on gpus: Exploration of algorithm trade-offs. In: Blanc-Talon J., Kleihorst R., Philips W., Popescu D., Scheunders P. (eds.) International Conference on Advanced Concepts for Intelligent Vision Systems, vol. 6915, pp. 611–622. Springer, Berlin, Heidelberg (2011)
Zezhong, X., Shin, B.-S., Klette, R.: A statistical method for line segment detection. Comput. Vis. Image Underst. 138, 61–73 (2015)
Author information
Authors and Affiliations
Corresponding author
Electronic supplementary material
Below is the link to the electronic supplementary material.
Rights and permissions
About this article
Cite this article
Shapira, G., Hassner, T. Fast and accurate line detection with GPU-based least median of squares. J Real-Time Image Proc 17, 839–851 (2020). https://doi.org/10.1007/s11554-018-0827-3
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s11554-018-0827-3