Go to file
Pranav Mailarpawar 0808c04008
Update README.md
2021-09-13 10:52:24 +05:30
gesture mouse control+Volume control.py Added Right Click 2021-08-27 17:45:38 +05:30
README.md Update README.md 2021-09-13 10:52:24 +05:30

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

  1. Close Hand:-Mode Selection

  2. 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)

  3. Volume:-Index finger + Thumb

  4. 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

https://drive.google.com/file/d/1bTrFoFH_yenro0C8AjXu9_BQFtGJy3Gg/view?usp=sharing