Join us
@qramkrishna ・ Jan 22,2022 ・ 4 min read ・ 2247 views ・ Originally posted on faun.pub
Hey surfer, in this blog, I am going to write about how can we do basic mouse operations like move pointer, click, double click and right click using only finger gestures.
Controlling Mouse with Gestures
Hey surfer, in this blog, I am going to write about how can we do basic mouse operations like move pointer, click, double click and right click using only finger gestures.
This blog is the part of the series #7DaysOfComputerVisionProjects. Links to the blogs and videos of each projects are:
Introduction
As the project name Air Mouse, it is a Computer Mouse except working by the Gestures of fingers. We will be using 2 python libraries, mouse and Mediapipe. Mouse is a library to do mouse operations like click, drag, release and so on. We will be using [Hand Module of Mediapipe a OpenSource tool to extract the landmarks of hand and fingers. But it have multiple modules like selfie segmentation, pose estimation, face detection etc.
Installation
It will be best idea to install these tools on virtual environment.
Preliminary Tasks
Import Dependencies
Get Screen Size
The use of tkinter is only to find screen size.
Write Basic Functions
Writing a Code
Step By Step
It is necessary to view the landmark position before making a gesture assumptions. Please follow the below image.
Flip the frame to look like selfie camera.
Convert our useful landmarks from entire frame world to screen world:
Complete Code
Better Version of the Code
Finally
The above code works but it is hard to get to the come point and do the desired operation within a while so it is still a bad system. I will be working on above system to try make it more efficient. If you found this blog helpful then please leave us a comment on our YouTube video and don’t forget to subscribe us. The code is available on GitHub.
* Code Link
* YouTube Video Link
Join other developers and claim your FAUN account now!
Associate Data Scientist, eXtenso Data
@qramkrishnaInfluence
Total Hits
Posts
Only registered users can post comments. Please, login or signup.