Modules used: mediapipe, pyautogui and opencv
Process
- Initializing camera, setup, plotting using opencv.
- Obtaining hand landmarks using mediapipe.
- Focussing only on 2 landmarks: 8->Index Finger Tip, 12->Middle Finger Tip.
- Hovering mouse using index finger.
- Register a click by bringing two fingers (middle and index) closer.
To run:
- Simply Run main.py.
- Fps display functionality can be achieved by uncommenting the triple Quote comments.
Optimizations:
- Shifting the purple rectangle up, since bottom access becomes difficult. - Done
- Removing numpy and math imports by adding onlt required self made functions. to reduce code complexity and for better optimization.
- Further smoothening of movement and clicks.
- Optimizations for specific softwares for pointer to work with.eg: Paint, On-Screen Keyboard etc.