Skip to Content
  • Proceeding Paper
  • Open Access

23 April 2026

8 Pages

Maze Navigating Robot Using Lucas–Kanade Optical Flow with Coarse-to-Fine Method †

and
School of Electrical, Electronics, and Computer Engineering, Mapua University, Manila 1002, Philippines
*
Author to whom correspondence should be addressed.
†
Presented at the 7th Eurasia Conference on IoT, Communication and Engineering 2025 (ECICE 2025), Yunlin, Taiwan, 14–16 November 2025.

Abstract

We applied the Lucas–Kanade optical flow method combined with a coarse-to-fine approach for robot navigation. While Lucas–Kanade is widely used for flow estimation and tracking, its utilization in robot navigation remains limited. Using a Raspberry Pi 5 (8 gigabytes) and a Logitech webcam, a mobile robot was developed that processes optical flow vectors to guide navigation decisions aimed at exiting a maze. While most maze navigation research relies on sensor fusion, we adopted computer vision to achieve collision-free navigation. The coarse-to-fine method effectively addresses the challenge of processing large motions inherent in Lucas–Kanade, resulting in an 80% success rate and 67% recovery rate. Simple linear regression analysis results revealed a negative correlation between optical flow magnitude and the robot’s distance to the nearest obstacle, indicating that closer obstacles correspond to higher flow magnitudes. The results highlight the potential of low-cost, vision-based autonomous navigation systems that eliminate the need for complex sensor arrays, making them suitable for cost-sensitive applications. The demonstrated effectiveness of the coarse-to-fine Lucas–Kanade method in handling large motion suggests its broader applicability in real-time robotic navigation, including autonomous vehicles and service robots operating in challenging or resource-limited environments.

1. Introduction

Robot navigation has been widely used due to the advancement of technologies and research [1]. It relevantly contributes to fields such as agriculture, medical activities, and military tasks [2,3], whereas these robots aim to reach their end point in the shortest time possible [4] and attain their objectives [5]. Real-time processing through computer vision is used as a technique in mobile robots, as real-time action enhances and adds relevance to studying mobile robot navigation [6,7,8]. In previous studies, it was found that navigation through mapping and map reference is disadvantaged by relying on collision-free setups [9]. To overcome these disadvantages, researchers have improved methodologies and found that enhancing vision sensing techniques may provide better performance with lower-cost components [10]. Mapless navigation is considered one of the action plans by previous studies to improve robot navigation [11]. One technique used for mapless navigation is the concept of optical flow, which uses vision-based input [12]. Lucas–Kanade optical flow is one of the known approaches in object tracking and motion detection [13], embedded systems [14], traffic motion patterns [15], surveillance systems [16], and visual monitoring [17]. Another approach of Lucas–Kanade is called the Pyramidical Lucas–Kanade optical flow. This approach is used in object detection for stationary obstacles [18]. With these, optical flow analysis makes even vehicle and weather detection possible [19].
The concept of Lucas–Kanade optical flow has three assumptions: (1) the illumination is constant throughout the path [20], (2) time is continuous, where the change of displacement of the image is slow, and (3) the adjacent points that are on the same surface in a scene have similar movements [21]. These assumptions were tested using the coarse-to-fine method in processing large motions throughout 20 experiments [22]. Other research results on the Lucas–Kanade optical flow approach show that optical flow vectors from the Lucas–Kanade method can be used in an appropriate methodology of robot navigation [23].
Hence, we developed a mobile robot that uses Lucas–Kanade with a coarse-to-fine method to navigate and exit a maze. A robot prototype was developed using Raspberry Pi 5 and a camera. Lucas–Kanade optical flow with coarse-to-fine method was adopted to navigate the robot prototype throughout the maze without wall and obstacle collision. The performance of the robot was evaluated using its success and recovery rate, and the linear relationship between optical flow magnitude and robot distance to the nearest obstacle was determined.

2. Methodology

2.1. Conceptual Framework

The framework in Figure 1 shows the relationship between the input, the processes executed, and the output of the proposed system. The system’s input is the environment’s video stream. The frames captured undergo the process for circle detection through bilateral filtering with noise reduction, Lucas–Kanade optical flow with the coarse-to-fine method, and a Decision Tree. The system outputs robot navigation, obstacle detection, and obstacle avoidance.
Figure 1. Conceptual framework of this study.

2.2. Hardware Development

Hardware components were purchased from the local store, e-Gizmo Mechatronix Central in Manila, Philippines, and used to develop the robot prototype (Figure 2). The robot uses two 18650 batteries with 3350 mAh high-discharge power sources for the system. The batteries are connected to supply power to the 8GB Raspberry Pi 5 (Raspberry Pi Ltd., Cambridge, UK), which uses the Logitech C270 720p webcam (Logitech, Suzhou, China) as input for the system. The Raspberry Pi 5 instructs the L298N motor driver to control four 6V DC geared motors and the connected Arduino Nano (Arduino, Strambino, Italy) through USB to display the correct number of identified obstacles on the seven-segment display (SSD).
Figure 2. Hardware block diagram.
Figure 3 shows the actual prototype design of the robot from two perspectives. Figure 3a shows the robot prototype in its side profile, while Figure 3b shows how it appears from the front. The components are enclosed in two 3D printed layers, the upper and lower layers. Both layers are measured to be 170 mm in width and 200 mm in length. The gap between these layers is 28 mm. The small box mounted on the top left side of the robot is the case for the seven-segment display (SSD), which measures 66 mm in width and length.
Figure 3. (a) Side view of the robot prototype; (b) Front view of the robot prototype.

2.3. Software Development

Figure 4 shows the system workflow, which starts by capturing the video stream through the Logitech webcam. The frames from the video stream are filtered through the process of Blurred Frame Filter with Laplacian Variance, ensuring that the system has four non-blurry frames to start the system. The non-blurry frames are processed for circle detection through bilateral filtering with noise reduction to isolate and identify the circles and use them as input for the Lucas–Kanade method. Once the system enters the process of Obstacle Avoidance and Maze Navigation through Lucas–Kanade optical flow and the Decision Tree algorithm, the system takes the input of the vector array and uses it with the Decision Tree method to decide on turning and considering correct decisions made from previous trials to improve system performance. This part of the system continues while producing the output of navigation until it reaches the end of the maze, where no circles within a grid are detected.
Figure 4. System workflow of developed robot.

2.4. Experimental Setup

The experimental setup of a maze is shown in Figure 5, where the robot prototype was observed. The 120 × 110 inch maze is placed within an area where there is standard room brightness. The maze is designed to observe and navigate the robot in a straight, turning, and intersecting pathway. There are also pre-determined obstacles in the maze. These obstacles are a water jug, a Ping-Pong toy racket, a bunny-shaped penny bank, and a shoe box. The robot is expected to navigate through this setup from the start to the end of the maze without colliding with any walls or obstacles.
Figure 5. Experimental setup.

2.5. Data Gathering

The data for this study were gathered through 15 maze runs [24]. These included the time recorded for each maze run and the outcome of the maze run, which are categorized into three events: reaching the endpoint without collision, reaching the endpoint but colliding with a wall or obstacle, being stuck, and not reaching the endpoint. There were also 100 data points gathered and processed through Scikit-Learn and Pandas in Python 3.13 to see the relationship between optical flow magnitude and robot distance as it approaches the nearest obstacle.

3. Result and Discussion

Table 1 presents the data collected from 15 maze runs. System performance was evaluated by calculating the success rate, defined as the proportion of runs in which the robot successfully reached the maze exit without colliding with walls or obstacles. Based on the sample of 15 runs, the success rate was determined to be 80% [25]. The recovery rate was computed as the proportion of runs in which the robot reached the exit despite colliding with a wall or obstacle. This value was obtained by dividing the number of such events by the total number of unsuccessful exits considered (three runs). The resulting recovery rate was 67%. To examine the linear relationship between optical flow magnitude (measured in pixels per frame) and the distance between the robot and an obstacle (measured in inches), simple linear regression (SLR) was applied. The best-fit line for these variables is expressed in Equation (1).
y = (−0.0813) x + 8.0309
where y is the optical flow magnitude, −0.0813 is the slope, x is the distance of the robot to the nearest obstacle in inches, and 8.0309 is the y-intercept. This line is also illustrated in Figure 6.
Table 1. Maze outcome table.
Figure 6. Relationship between optical flow magnitude and robot distance to the nearest obstacle.
A dataset of one hundred points was used to examine the relationship between optical flow magnitude and the robot’s distance from an obstacle. Using the equation of the simple regression line, with a regression coefficient of −0.9687, the analysis revealed a significant negative correlation, indicating an inverse relationship between the variables. Specifically, as the robot approached an obstacle, the optical flow magnitude increased, whereas greater distances corresponded to lower optical flow magnitudes.

4. Conclusions and Recommendations

We developed a robot prototype utilizing a Raspberry Pi 5 (8 gigabytes) and a Logitech webcam, applying the Lucas–Kanade optical flow method with a coarse-to-fine approach for navigation. The system incorporated the assumptions of Lucas–Kanade optical flow and addressed its limitations in handling large motions through the coarse-to-fine method. Additionally, the integration of a Decision Tree algorithm enabled performance evaluation, yielding a success rate of 80% and a recovery rate of 67% across 15 maze runs. Through simple linear regression analysis, an inverse relationship was observed between optical flow magnitude and the robot’s distance from the nearest obstacle, demonstrating that proximity to obstacles results in higher optical flow magnitudes. The study was conducted under controlled conditions, including constant room brightness and stationary obstacles. Future work should extend the system to more complex maze scenarios, such as environments with moving obstacles or varied layouts, and incorporate features that enhance navigation under different illumination levels. Subsequent research is necessary to explore the development of prototypes using lower-cost components that can deliver comparable or improved performance.

Author Contributions

Topic development, Research Conceptualization, Paper editing, Polishing, and Finalization, C.O.M.; Paper writing, Software development (programming), Hardware development (prototype creation), H.M.A. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Data Availability Statement

The original data presented in the study are openly available at the following link: https://drive.google.com/drive/folders/1cGuvxYfbrF1GyTapC667I_PQtF3G5Ak9 (accessed on 20 April 2026).

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Popkova, E.G.; De Bernardi, P.; Tyurina, Y.G.; Sergi, B.S. A theory of digital technology advancement to address the grand challenges of sustainable development. Technol. Soc. 2022, 68, 101831. [Google Scholar] [CrossRef] [Scilit]
  2. Yadav, N.D.; Khandekar, S. Overview of Optical Flow Technique for Mobile Robot Obstacle Avoidance. In Proceedings of the 3rd International Conference on Communication and Electronics Systems. ICCES, Coimbatore, India, 15–16 October 2018; pp. 619–622. [Google Scholar] [CrossRef] [Scilit]
  3. Manlises, C.; Martinez, J.M.; Belenzo, J.L.; Perez, C.K.; Postrero, M.K.T.A. Real-Time Integrated CCTV Using Face and Pedestrian Detection Image Processing Algorithm for Automatic Traffic Light Transitions. In Proceedings of the 8th IEEE International Conference on Humanoid, Nanotechnology, Information Technology, Communication and Control, Environment and Management (HNICEM), Cebu, Philippines, 9–12 December 2015. [Google Scholar] [CrossRef] [Scilit]
  4. Yumang, A.; Magwili, G.; Ruben, P.C.; Sy, M.L.M.; Siapoc, D.R.P. Route Optimization for Multiple Forklifts Using D* Lite Algorithm. In Proceedings of the 2020 IEEE 12th International Conference on Humanoid, Nanotechnology, Information Technology, Communication and Control, Environment, and Management (HNICEM), Manila, Philippines, 3–7 December 2020; pp. 1–5. [Google Scholar] [CrossRef] [Scilit]
  5. Alagenio, J.; Jabanes, E.J.L.; Genobiagon, C.P.; Linsangan, N.B. Hardware Development of a Humanoid Robot Head: ‘Gabot,’. In Proceedings of the 2021 IEEE 13th International Conference on Humanoid, Nanotechnology, Information Technology, Communication and Control, Environment, and Management (HNICEM), Manila, Philippines, 28–30 November 2021; pp. 1–6. [Google Scholar] [CrossRef] [Scilit]
  6. Chang, C.-E.; Chen, S.-L.; Chen, C.-A.; Lin, T.-L.; Kuo, Y.-T.; Cheng, H.-H.; Kao, W.-T.; Villaverde, J.F. A Hardware-Oriented Contrast Enhancement Algorithm for Real-Time Applications. In Proceedings of the 2018 1st International Cognitive Cities Conference (IC3), Okinawa, Japan, 7–9 August 2018; pp. 183–185. [Google Scholar] [CrossRef] [Scilit]
  7. Fitz Bumacod, D.S.; Delfin, J.V.; Linsangan, N.; Angelia, R.E. Image-Processing-based Digital Goniometer using OpenCV. In Proceedings of the 2020 IEEE 12th International Conference on Humanoid, Nanotechnology, Information Technology, Communication and Control, Environment, and Management (HNICEM), Manila, Philippines, 3–7 December 2020; pp. 1–6. [Google Scholar] [CrossRef] [Scilit]
  8. Galindo, J.A.; Caya, M.V. Development of street lighting system with object detection. In Proceedings of the 2018 IEEE 10th International Conference on Humanoid, Nanotechnology, Information Technology, Communication and Control, Environment and Management (HNICEM), Baguio City, Philippines, 29 November–2 December 2018. [Google Scholar] [CrossRef] [Scilit]
  9. Toan, N.D.; Woo, K.G. Mapless navigation with deep reinforcement learning based on the convolutional proximal policy optimization network. In Proceedings of the 2021 IEEE International Conference on Big Data and Smart Computing, BigComp 2021, Jeju Island, Republic of Korea, 17–20 January 2021; pp. 298–301. [Google Scholar] [CrossRef] [Scilit]
  10. Sharifi, M.; Chen, X. Introducing a novel vision-based obstacle avoidance technique for navigation of autonomous mobile robots. In Proceedings of the 2015 IEEE 10th Conference on Industrial Electronics and Applications (ICIEA), Auckland, New Zealand, 15–17 June 2015. [Google Scholar] [CrossRef] [Scilit]
  11. Zhang, P.; Wei, C.; Cai, B.; Ouyang, Y. Mapless Navigation for Autonomous Robots: A Deep Reinforcement Learning Approach. In Proceedings of the 2019 Chinese Automation Congress, CAC 2019, Jiangsu, China, 20–22 September 2019; pp. 3141–3146. [Google Scholar] [CrossRef] [Scilit]
  12. Guzel, M.S.; Bicker, R. Optical flow-based system design for mobile robots. In Proceedings of the 2010 IEEE Conference on Robotics, Automation and Mechatronics, Singapore, 28–30 June 2010. [Google Scholar] [CrossRef] [Scilit]
  13. Yang, Z.; Zhong, X.; Miao, C.; Zhao, J.; Zhong, X. Optical-Flow-Based Visual Servoing for Robotic Moving Control Using Closed-Loop Joints. In Proceedings of the Chinese Control Conference, CCC, Shanghai, China, 26–28 July 2021. [Google Scholar] [CrossRef] [Scilit]
  14. Ammar, A.; Ben Fredj, H.; Souani, C. Accurate real-time motion estimation using optical flow on an embedded system. Electronics 2021, 10, 2164. [Google Scholar] [CrossRef] [Scilit]
  15. Moradi, A.; Shahbahrami, A.; Akoushideh, A. An unsupervised approach for traffic motion patterns extraction. IET Image Process. 2021, 15, 428–442. [Google Scholar] [CrossRef] [Scilit]
  16. Guarnieri, G.; Fontani, M.; Guzzi, F.; Carrato, S.; Jerian, M. Perspective registration and multi-frame super-resolution of license plates in surveillance videos. Forensic Sci. Int. Digit. Investig. 2021, 36, 301087. [Google Scholar] [CrossRef] [Scilit]
  17. Yao, S.; Han, X.; Zhang, H.; Wang, X.; Cao, X. Learning Deep Lucas-Kanade Siamese Network for Visual Tracking. IEEE Trans. Image Process. 2021, 30, 4814–4827. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  18. Hatmaja, S.B.W.T.; Nugroho, S.; Setyawan, I. Stationary obstacle detection using pyramidal Lucas Kanade optical flow. In Proceedings of the QiR 2017—2017 15th International Conference on Quality in Research (QiR): International Symposium on Electrical and Computer Engineering, Nusa Dua, Bali, Indonesia, 24–27 July 2017; pp. 474–478. [Google Scholar] [CrossRef] [Scilit]
  19. Padilla, D.A.; Villaverde, J.F.; Magdaraog, J.J.T.; Oconer, A.J.L.; Ranjo, J.P. Vehicle and Weather Detection Using Real Time Image Processing Using Optical Flow and Color Histogram. In Proceedings of the 2019 5th International Conference on Control, Automation and Robotics (ICCAR), Beijing, China, 19–22 April 2019; pp. 880–883. [Google Scholar] [CrossRef] [Scilit]
  20. Leonida, K.L.; Sevilla, K.V.; Manlises, C.O. A Motion-Based Tracking System Using the Lucas-Kanade Optical Flow Method. In Proceedings of the 2022 14th International Conference on Computer and Automation Engineering (ICCAE), Brisbane, Australia, 25–27 March 2022; pp. 86–90. [Google Scholar] [CrossRef] [Scilit]
  21. Wang, Z.; Yang, X. Moving Target Detection and Tracking Based on Pyramid Lucas-Kanade Optical Flow. In Proceedings of the 2018 3rd IEEE International Conference on Image, Vision and Computing, ICIVC 2018, Chongqing, China, 27–29 June 2018; pp. 66–69. [Google Scholar] [CrossRef] [Scilit]
  22. Wang, C.; Maib, X.; Hoc, D.; Liud, T.; Lie, C.; Pan, J.; Meng, M.Q.-H. Coarse-to-fine visual object catching strategy applied in autonomous airport baggage trolley collection. IEEE Sensors J. 2021, 21, 11844–11857. [Google Scholar] [CrossRef] [Scilit]
  23. Elasri, A.; Cherroun, L.; Nadour, M.; Elaoua, A. Mobile Robot Visual Navigation Systems using Optical Flow. In Proceedings of the 2023 2nd International Conference on Electronics, Energy and Measurement (IC2EM), Medea, Algeria, 28–29 November 2023; pp. 1–6. [Google Scholar] [CrossRef] [Scilit]
  24. Manlises, C.O.; Yumang, A.N.; Marcelo, M.M.; Adriano, A.J.B.; Reyes, J.R.V. Indoor navigation system based on computer vision using CAMShift and D* algorithm for visually impaired. In Proceedings of the 2016 6th IEEE International Conference on Control System, Computing and Engineering (ICCSCE), Penang, Malaysia, 25–27 November 2016; pp. 481–484. [Google Scholar] [CrossRef] [Scilit]
  25. Allorde, R.R.; Fornoles, C.; Caya, M.V. Computer Vision-Based Foot Measurement Using Modified Canny Edge Algorithm. In Proceedings of the 2023 IEEE 5th Eurasia Conference on IOT, Communication and Engineering (ECICE), Yunlin, Taiwan, 27–29 October 2023; pp. 416–420. [Google Scholar] [CrossRef] [Scilit]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.