This is a personal project and the final project for the Computer Vision course at Van Lang University, which I worked on alone. The project is a software that has 4 functions that can be controlled by hand gestures: light bulb, computer speaker, computer mouse, and fan.
The project was written in Python language and uses Mediapipe to detect hand gestures.
Here are some important parameters of Mediapipe that we need to pay attention to:
max_num_hands : The maximum number of hands can be detected by the GestureRecognizer. |
min_detection_confidence : The minimum confidence score for the hand detection to be considered successful. |
min_tracking_confidence : The minimum confidence score for the hand tracking to be considered successful. |
If you would like to learn more about this project, please refer to the following documents:
- Vietnamese_Project_Explain
- English_Project_Explain
Firstly, to ensure that the program can run smoothly, I recommend that you install these libraries before we begin.
And don’t forget that your computer needs a webcam to be able to use this program! 📷📷
pip install pillow
pip install opencv-python
pip install mediapipe
pip install pycaw
pip install comtypes
pip install numpy
pip install pyautogui
After you’ve installed the requirements, you can clone this repository or download it here to your local disk. Then, simply run the main.py
file to enjoy the program experience. 🎉
As you mentioned earlier above, this program includes 4 functions, and each function has a different usage.
REMEMBER: If you want escape the program, just simply press Esc
on your keyboard.
To control the light bulb function, you need to know that each light bulb corresponds to one of your fingers. When you raise a finger, the light bulb depends on it will turn on, and when you lower that finger, the light bulb will turn off.
Light Rule:
Finger | Light color |
---|---|
Thumb | Yellow🟨 |
Index | Red 🟥 |
Middle | Green 🟩 |
Ring | Blue 🟦 |
Pinky | Orange 🟧 |
📍Example:
This function allows you to control the overall sound on your computer. By raising your thumb and index finger, you can increase or decrease the volume according to the distance you create between these two fingers. The farther apart your fingers are, the louder the volume will be, and vice versa. (This function can work on both hands)
📍Example:
When you activate this function, a blue rectangle frame will appear on your webcam. This blue frame represents the resolution of the screen you are using. To control the mouse cursor, simply raise and move your index with middle finger in the frame. If you want to click the mouse, you can bend your index finger quickly at the position where you want to click. Just pretend you are clicking a real computer mouse. :]]
📍Example:
For the fan control function, all you need to do is clench your hand to turn off the fan and open all 5 fingers to turn on the fan. (Note: All 5 fingers must be open for the fan to turn on!)
📍Example:
Nobody except me! Haha😆😆
As mentioned earlier, this is a project that I worked on alone and learned from many sources on the internet, even using AI. So if you want to support me in developing and creating projects like this, please help me buy some milk 🐮 (I am really addicted to Millo).