Journal of Real-Time Image Processing

, Volume 16, Issue 6, pp 2213–2231 | Cite as

Generalized N-way iterative scanline fill algorithm for real-time applications

  • Vladan VučkovićEmail author
  • Boban Arizanović
  • Simon Le Blond
Original Research Paper


A generalized iterative scanline fill algorithm intended for use in real-time applications and its highly optimized machine code implementation are presented in this paper. The algorithm uses the linear image representation in order to achieve the fast memory access to the pixel intensity values. The usage of the linear image representation is crucial for achieving the highly optimized low-level machine code implementation. A few generalization features are also proposed, and discussion about the possible real-time applications is given. The proposed efficient machine code implementation is tested on several PC machines, and a set of numerical results is provided. The machine routine is compared with standard and optimized implementations of the 4-way flood fill algorithm and scanline fill algorithm. The machine code implementation performs approximately 2 times faster than the optimized scanline fill algorithm implementation and 6 times faster than standard iterative scanline fill algorithm implementation on two-dimensional image data structure. Furthermore, the machine routine proved to perform even more than 15 times faster than the optimized flood fill algorithm implementations. Provided results prove the efficiency of the proposed generalized scanline fill algorithm and its advantage over the state-of-the-art algorithms, and clearly show that optimized machine routine is capable of performing the real-time tasks.


Image processing Region filling Flood fill Boundary fill Scanline fill Machine optimization 



This paper is supported by the Ministry of Education, Science and Technological Development of the Republic of Serbia (Project III44006-10) and Mathematical Institute of Serbian Academy of Science and Arts (SANU).


  1. 1.
    Albert, T.A., Slaaf, D.W.: A rapid regional filling technique for complex binary images. Comput. Graph. 19(4), 541–549 (1995)CrossRefGoogle Scholar
  2. 2.
    Arquè, D., Grange, O.: A fast scan-line algorithm for topological filling of well-nested objects in 2.5D digital pictures. Theor. Comput. Sci. 147(1–2), 211–248 (1995)CrossRefGoogle Scholar
  3. 3.
    Bhargava, N., Trivedi, P., Toshniwal, A., Swarnkar, H.: Iterative region merging and object retrieval method using mean shift segmentation and flood fill algorithm. In: 3rd International Conference on Advances in Computing and Communications (ICACC) (2013)Google Scholar
  4. 4.
    Burger, W., Burge, M.J.: Principles of digital image processing: core algorithms, 1st edn. Springer, London (2009)CrossRefGoogle Scholar
  5. 5.
    Cai, Z., Ye, L., Yang, A.: FloodFill maze solving with expected toll of penetrating unknown walls for micromouse. In: IEEE 14th International Conference on High Performance Computing and Communication and 2012 IEEE 9th International Conference on Embedded Software and Systems (HPCC-ICESS) (2012)Google Scholar
  6. 6.
    Dang, H., Song, J., Guo, Q.: An efficient algorithm for robot maze-solving. In: 2nd International Conference on Intelligent Human-Machine Systems and Cybernetics (IHMSC) (2010)Google Scholar
  7. 7.
    Duo-le, F., Ming, Z.: A new fast region filling algorithm based on cross searching method. In: Zhou M., Tan H. (eds) Advances in Computer Science and Education Applications. Communications in Computer and Information Science, p. 202. Springer, Berlin, Heidelberg (2011)Google Scholar
  8. 8.
    Elshamarka, I., Saman, A.: Design and implementation of a robot for maze-solving using flood-fill algorithm. Int. J. Comput. Appl. 56(5), 8–13 (2012)Google Scholar
  9. 9.
    Fanfeng, Z., Wei, F.: Hole filling algorithm based on contours information. In: 2nd International Conference on Information Science and Engineering (ICISE) (2010)Google Scholar
  10. 10.
    Fathi, M., Hiltner, J.: A new fuzzy based flood-fill algorithm for 3D NMR brain segmentation. In: IEEE International Conference on Systems, Man, and Cybernetics, IEEE SMC ‘99 Conference Proceedings (1999)Google Scholar
  11. 11.
    Fellah, S.E., Rziza, M., Haziti, M.E.: An efficient approach for filling gaps in landsat 7 satellite images. IEEE Geosci. Remote Sens. Lett. 14(1), 62–66 (2016)CrossRefGoogle Scholar
  12. 12.
    Fukukawa, T., Maeda, Y., Sekiyama, K., Fukuda, T.: Road detection method corresponded to multi road types with flood fill and vehicle control. In: 2nd International Conference on Robot, Vision and Signal Processing (RVSP) (2013)Google Scholar
  13. 13.
    Golda, A.F., Aridha, S., Elakkiya, D.: Algorithmic agent for effective mobile robot navigation in an unknown environment. In: International Conference on Intelligent Agent and Multi-Agent Systems, IAMA (2009)Google Scholar
  14. 14.
    Henrich, D.: Space-efficient region filling in raster graphics. Vis. Comput. 10(4), 205–215 (1994)CrossRefGoogle Scholar
  15. 15.
    Hersch, R.D.: Descriptive contour fill of partly degenerated shapes. IEEE Comput. Graph. Appl. 6(7), 61–70 (1986)CrossRefGoogle Scholar
  16. 16.
    Jou, S., Tsai, M.: A fast 3D seed-filling algorithm. Vis. Comput. 19(4), 243–251 (2003)CrossRefGoogle Scholar
  17. 17.
    Ju, Z., Chen, Y.: New filling algorithm based on chain code. Comput. Eng. 17(33), 211–215 (2007)Google Scholar
  18. 18.
    Kang, H., Lee, S., Lee, J.: Image segmentation based on fuzzy flood fill mean shift algorithm. In: Annual Meeting of the North American Fuzzy Information Processing Society (NAFIPS) (2010)Google Scholar
  19. 19.
    Khudeev, R.: A new flood-fill algorithm for closed contour. In: IEEE International Siberian Conference on Control and Communications, SIBCON ‘05 (2005)Google Scholar
  20. 20.
    Law, G.: Quantitative comparison of flood fill and modified flood fill algorithms. Int. J. Comput. Theory Eng. 5(3), 503–508 (2013)CrossRefGoogle Scholar
  21. 21.
    Li, X., Huang, L.: New region filling algorithm based on chain codes description. In: 3rd International Congress on Image and Signal Processing (CISP) (2010)Google Scholar
  22. 22.
    Li, X., Li, X.: Filling the holes of 3D body scan line point cloud. In: 2nd International Conference on Advanced Computer Control (ICACC) (2010)Google Scholar
  23. 23.
    Liu, S., Ma, W.: Seed-growing segmentation of 3-D surface from CT-contour data. Comput. Aided Des. 31(8), 517–536 (1999)CrossRefGoogle Scholar
  24. 24.
    Mishra, S., Bande, P.: Maze solving algorithms for micro mouse. In: IEEE International Conference on Signal Image Technology and Internet Based Systems, SITIS ‘08 (2008)Google Scholar
  25. 25.
    Mohammed, F.G.: Satellite image gap filling technique. Int. J. Adv. Res. Technol. 2(4), 348–351 (2013)MathSciNetGoogle Scholar
  26. 26.
    Nosal, E.M.: Flood-fill algorithms used for passive acoustic detection and tracking. In: New Trends for Environmental Monitoring Using Passive Systems, pp. 1–5 (2008)Google Scholar
  27. 27.
    Oikarinen, J.: Using 2- and 2½-dimensional seed filling in view lattice to accelerate volumetric rendering. Comput. Graph. 22(6), 745–757 (1998)CrossRefGoogle Scholar
  28. 28.
    Oikarinen, J.T., Jyrkinen, L.J.: Maximum intensity projection by 3-dimensional seed filling in view lattice. Comput. Netw. ISDN Syst. 30, 2003–2014 (1998)CrossRefGoogle Scholar
  29. 29.
    Patel, A., Dubey, A., Pandey, A., Choubey, S.D.: Vision guided shortest path estimation using floodfill algorithm for mobile robot applications. In: 2nd International Conference on Power, Control and Embedded Systems (ICPCES) (2012)Google Scholar
  30. 30.
    Pavlidis, T.: Filling algorithms for raster graphics. Comput. Graph. Image Process. 10(2), 126–141 (1979)MathSciNetCrossRefGoogle Scholar
  31. 31.
    Pavlidis, T.: Algorithms for Graphics and Image Processing. Computer Science Press, Rockville (1982)CrossRefGoogle Scholar
  32. 32.
    Ren, M., Yang, W., Yang, J.: A new and fast contour-filling algorithm. Pattern Recogn. 38(12), 2564–2577 (2005)CrossRefGoogle Scholar
  33. 33.
    Sarpate, G.K., Guru, S.K.: Image inpainting on satellite image using texture synthesis and region filling algorithm. In: International Conference on Advances in Communication and Computing Technologies (ICACACT) (2014)Google Scholar
  34. 34.
    Tang, G.Y., Lien, B.: Region filing with the use of the discrete green theorem. Comput. Vis. Graph. Image Process. 42(3), 297–305 (1988)CrossRefGoogle Scholar
  35. 35.
    Thapaliya, K., Kwon, G.R.: Extraction of brain tumor based on morphological operations. In: 8th International Conference on Computing Technology and Information Management (ICCM) (2012)Google Scholar
  36. 36.
    Torbert, S.: Applied Computer Science, 2nd edn, p. 158. Springer, Berlin (2016)Google Scholar
  37. 37.
    Vučković, V., Arizanović, B.: Efficient character segmentation approach for machine-typed documents. Expert Syst. Appl. 80, 210–231 (2017)CrossRefGoogle Scholar
  38. 38.
    Vučković, V., Arizanović, B.: Automatic document skew pre-processor for character segmentation algorithm. Facta Univ. Electron. Energ. 30(4), 611–625 (2017)CrossRefGoogle Scholar
  39. 39.
    Vučković, V., Arizanović, B., Le Blond, S.: Ultra-fast basic geometrical transformations on linear image data structure. Expert Syst. Appl. 91, 322–346 (2018)CrossRefGoogle Scholar
  40. 40.
    Wayalun, P., Chomphuwiset, P., Laopracha, N., Wanchanthuek, P.: Images enhancement of G-band chromosome using histogram equalization, OTSU thresholding, morphological dilation and flood fill techniques. In: 8th International Conference on Computing and Networking Technology (ICCNT) (2012)Google Scholar
  41. 41.
    Yu, W., He, F., Xi, P.: A rapid 3D seed-filling algorithm based on scan slice. Comput. Graph. 34(4), 449–459 (2010)CrossRefGoogle Scholar
  42. 42.
    Yu, Y., Wang, J.: Image segmentation based on region growing and edge detection. In: IEEE International Conference on Systems, Man, and Cybernetics, 1999. IEEE SMC ’99 Conference Proceedings, vol. 6 (1999). doi: 10.1109/ICSMC.1999.816653
  43. 43.
    Zhu, H., Zhang, G., Liu, G., Sun, Q.: Flotation bubble seed image filling algorithm based on boundary point features. Int. J. Min. Sci. Technol. 22(3), 289–293 (2012)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag GmbH Germany 2017

Authors and Affiliations

  • Vladan Vučković
    • 1
    Email author
  • Boban Arizanović
    • 1
  • Simon Le Blond
    • 2
  1. 1.Computer Department, Faculty of Electronic EngineeringNišSerbia
  2. 2.Department of Electronic and Electrical EngineeringUniversity of BathBathUK

Personalised recommendations