This paper presents Gesture Flow, a webcam-based hand gesture recognition system developed to control a computer game without using a traditional physical controller. The system explores an alternative method of human–computer interaction by translating natural hand movements into game control commands. It uses a webcam to capture the user\'s hand movements, while OpenCV handles video acquisition and image processing. MediaPipe Hands is used to detect the hand and extract 21 key landmarks, which are then examined to identify the performed gesture. Based on the recognized hand position, the application generates keyboard commands through PyAutoGUI to interact with the game. The prototype is implemented using Hill Climb Racing, where an open palm is mapped to the acceleration command and a closed fist is mapped to the braking command. The system provides visual feedback to help the user understand the detected gesture and its corresponding action. This approach demonstrates how commonly available computer vision tools can be combined to develop a gesture-based gaming interface with minimal additional hardware requirements. The project also provides a foundation for exploring more natural and accessible interaction methods in computer applications. Further improvements can focus on recognizing additional gestures, handling variations in lighting and background conditions, and evaluating recognition performance through systematic testing.
Introduction
This study presents Gesture Flow, a webcam-based hand gesture recognition system designed to control computer games using natural hand movements. Traditional gaming systems rely on keyboards, mice, and controllers, which require direct physical interaction. To provide an alternative input method, the proposed system uses computer vision and hand tracking to recognise predefined gestures and convert them into game-control commands.
The system is developed using Python and integrates OpenCV, MediaPipe Hands, and PyAutoGUI. OpenCV captures and processes live video from a standard webcam, while MediaPipe Hands detects the user's hand and extracts 21 landmark points, including the wrist, finger joints, and fingertips. These landmarks are analysed to recognise two predefined gestures: an open palm for acceleration and a closed fist for braking. PyAutoGUI converts the recognised gestures into keyboard commands to control Hill Climb Racing. The system also provides visual feedback by displaying detected hand landmarks and recognised gestures.
The main motivation behind this project is to develop a simple, accessible, and natural human–computer interaction method that reduces dependence on traditional gaming devices. It also demonstrates how commonly available hardware and computer vision technologies can be integrated to create a real-time gesture-controlled gaming application.
The proposed system consists of five main components: webcam input and frame acquisition, hand detection and landmark extraction, gesture recognition, gesture-to-command mapping, and game control with visual feedback.
However, the system faces practical challenges, including variations in lighting conditions, complex backgrounds, hand orientation, partial hand visibility, gesture misclassification, processing delays, and compatibility with game inputs. The current implementation is also limited to two gestures, supporting only acceleration and braking.
Conclusion
Gesture Flow demonstrates a simple approach to controlling a computer game through hand gestures using a standard webcam. The system combines OpenCV for video capture, MediaPipe Hands for hand detection and landmark extraction, and PyAutoGUI for generating keyboard inputs. It recognises two predefined gestures, an open palm for acceleration and a closed fist for braking, and uses them to control Hill Climb Racing. The developed prototype shows that hand movements can be converted into game commands without requiring additional gesture-sensing hardware. During implementation, the system also provided visual feedback through displayed hand landmarks and gesture labels, making its operation easier to observe. However, the current version supports only two gestures, and its performance can be affected by lighting, hand visibility and background conditions. Further development could introduce additional gestures, improve recognition under different environments and reduce delays in command execution. More extensive testing would also help evaluate its accuracy and reliability. Overall, the project provides a practical starting point for exploring gesture-based human–computer interaction.
References
[1] Munir Oudah, Ali Al-Naji and Javaan Chahl, “Hand Gesture Recognition Based on Computer Vision: A Review of Techniques,” Journal of Imaging, Vol. 6, Issue 8, Article 73, 2020. https://doi.org/10.3390/jimaging6080073
[2] Pramod Kumar Pisharady and Martin Saerbeck, “Recent Methods and Databases in Vision-Based Hand Gesture Recognition: A Review,” Computer Vision and Image Understanding, Vol. 141, pp. 152–165, 2015. https://doi.org/10.1016/j.cviu.2015.08.004
[3] Fan Zhang, Valentin Bazarevsky, Andrey Vakunov, Andrei Tkachenka, George Sung, Chuo-Ling Chang and Matthias Grundmann, “MediaPipe Hands: On-Device Real-Time Hand Tracking,” 2020. https://arxiv.org/abs/2006.10214
[4] OpenCV, “Color Space Conversions – OpenCV Documentation.”
https://docs.opencv.org/4.x/d8/d01/group__imgproc__color__conversions.html
[5] PyAutoGUI, “Keyboard Control Functions – PyAutoGUI Documentation.”
https://pyautogui.readthedocs.io/en/latest/keyboard.html
[6] Debajit Sarma and M. K. Bhuyan, “Methods, Databases and Recent Advancement of Vision-Based Hand Gesture Recognition for HCI Systems,” SN Computer Science, Vol. 2, Article 436, 2021.
[7] Fahmid Al Farid, Noramiza Hashim, Junaidi Abdullah, Md. Roman Bhuiyan, Wan Noor Shahida Mohd Isa, Jia Uddin, Mohammad Ahsanul Haque and Mohd Nizam Husen, “A Structured and Methodological Review on Vision-Based Hand Gesture Recognition System,” Journal of Imaging, Vol. 8, Issue 6, Article 153, 2022.