Skip to main content
Log in

Fast and accurate line detection with GPU-based least median of squares

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

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.

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
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12
Fig. 13
Fig. 14
Fig. 15
Fig. 16
Fig. 17

Similar content being viewed by others

Notes

  1. Additional results for the three applications are provided in the supplemental.

  2. Available: https://github.com/ligaripash/CudaLMS2D.git.

References

  1. Atiquzzaman, M., Akhtar, M.W.: Complete line segment description using the hough transform. Image Vis. Comput. 12(5), 267–273 (1994)

    Google Scholar 

  2. 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)

  3. Bradski, G., Kaehler, A.: OpenCV. Dr. Dobb’s journal of software tools 3 (2000)

  4. 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)

    Google Scholar 

  5. 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)

    MathSciNet  MATH  Google Scholar 

  6. 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)

    MathSciNet  MATH  Google Scholar 

  7. 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)

    MATH  Google Scholar 

  8. 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)

    MATH  Google Scholar 

  9. Erickson, J., Har-Peled, S., Mount, D.M.: On the least median square problem. Discrete Comput. Geom. 36(4), 593–607 (2006)

    MathSciNet  MATH  Google Scholar 

  10. Fernandes, L.A.F., Oliveira, M.M.: Kht sansbox. https://sourceforge.net/projects/khtsandbox (2008)

  11. 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)

    MATH  Google Scholar 

  12. 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)

    Google Scholar 

  13. Galambos, C., Kittler, J., Matas, J.: Gradient based progressive probabilistic hough transform. Proc. Vis. Image Signal Process. 148(3), 158–165 (2001)

    Google Scholar 

  14. Gatos, B., Perantonis, S.J., Papamarkos, N.: Accelerated hough transform using rectangular image decomposition. Electron. Lett. 32(8), 730–732 (1996)

    Google Scholar 

  15. 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)

    Google Scholar 

  16. 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)

    Google Scholar 

  17. 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)

    Google Scholar 

  18. Kiryati, N., Eldar, Y., Bruckstein, A.M.: A probabilistic hough transform. Pattern Recognit. 24(4), 303–316 (1991)

    MathSciNet  Google Scholar 

  19. Klette, R.: image sequence analysis test site. http://www.mi.auckland.ac.nz/EISATS/ (2013)

  20. Klette, R.: image sequence analysis test site. http://www.elderlab.yorku.ca/YorkUrbanDB/ (2015)

  21. 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)

    Google Scholar 

  22. Mukhopadhyay, P., Chaudhuri, B.B.: A survey of hough transform. Pattern Recognit. 48(3), 993–1010 (2015)

    Google Scholar 

  23. 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)

    Google Scholar 

  24. 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)

    Google Scholar 

  25. 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)

    Google Scholar 

  26. 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)

    Google Scholar 

  27. Rousseeuw, P.J.: Least median of squares regression. J. Am. Stat. Assoc. 79(388), 871–880 (1984)

    MathSciNet  MATH  Google Scholar 

  28. Sanders, J., Kandrot, E.: CUDA by Example: An Introduction to General-Purpose GPU Programming. Addison-Wesley Professional, Boston (2010)

    Google Scholar 

  29. 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)

    Google Scholar 

  30. 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)

    MathSciNet  MATH  Google Scholar 

  31. Steele, J.M., Steiger, W.L.: Algorithms and complexity for least median of squares regression. Discrete Appl. Math. 14(1), 93–100 (1986)

    MathSciNet  MATH  Google Scholar 

  32. 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)

    MATH  Google Scholar 

  33. Tu, C.: Enhanced Hough transforms for image processing. PhD thesis, Université Paris-Est, (2014)

  34. 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)

    Google Scholar 

  35. Zezhong, X., Shin, B.-S., Klette, R.: A statistical method for line segment detection. Comput. Vis. Image Underst. 138, 61–73 (2015)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Gil Shapira.

Electronic supplementary material

Below is the link to the electronic supplementary material.

Supplementary material 1 (pdf 6532 KB)

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

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

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11554-018-0827-3

Keywords

Navigation