| gesture mouse control+Volume control.py | ||
| README.md | ||
Air Cursor
Mediapipe
MediaPipe offers cross-platform, customizable ML solutions for live and streaming media.It provides various kinds of detection features such as Face Detection , Face Mesh , Iris , Hands , Pose etc.
Installation
Use the package manager pip to install Mediapipe.
pip install mediapipe
PyAutoGUI
PyAutoGUI lets your Python scripts control the mouse and keyboard to automate interactions with other applications.
Installation
Use the package manager pip to install PyAutoGUI.
pip install PyAutoGUI
Opencv
OpenCV is the huge open-source library for the computer vision, machine learning, and image processing and now it plays a major role in real-time operation
Installation
Use the package manager pip to install Opencv.
pip install opencv-python
NumPy
NumPy is the fundamental package for scientific computing in Python. It is a Python library that provides a multidimensional array object, various derived objects (such as masked arrays and matrices), and an assortment of routines for fast operations on arrays, including mathematical, logical, shape manipulation, sorting, selecting, I/O, discrete Fourier transforms, basic linear algebra, basic statistical operations, random simulation and much more.
Installation
Use the package manager pip to install NumPy.
pip install numpy
Pycaw
Pycaw is the library for audio controls
Installation
Use the package manager pip to install Pycaw.
pip install pycaw
Code
from ctypes import cast, POINTER
from comtypes import CLSCTX_ALL
from pycaw.pycaw import AudioUtilities, IAudioEndpointVolume
devices = AudioUtilities.GetSpeakers()
interface = devices.Activate(
IAudioEndpointVolume._iid_, CLSCTX_ALL, None)
volume = cast(interface, POINTER(IAudioEndpointVolume))
volume.GetMute()
volume.GetMasterVolumeLevel()
volume.GetVolumeRange()
volume.SetMasterVolumeLevel(-20.0, None)
RESULTS
Controls
-
Close Hand:-Mode Selection
-
Cursor Mode:-Open Hand
a) Move Cursor:- Thumb (up) + Index Finger (up) + other 3 fingers (down)
b) Left Click:- Thumb (down) + Index Finger (up) + other 3 fingers (down)
c) Right click:- Thumb (up) + Index Finger (down) + Middle finger (down) + Ring finger (down) + little finger (up) -
Volume:-Index finger + Thumb
-
Scroll:-Index finger +Middle finger + Ring finger
a) scroll up:-Index finger +Middle finger + Ring finger
b) scroll down:-Index finger +Middle finger + Ring finger + little finger
🔗LINK TO THE VIDEO
https://drive.google.com/file/d/1bTrFoFH_yenro0C8AjXu9_BQFtGJy3Gg/view?usp=sharing