Skip to content

Patorik/gesture_mouse_control

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gesture mouse control

This repository makes it possible to control mouse using object detection based on HSV filter.

Software requirements

  • Python 3.8.10
  • OpenCV (contrib version 4.5.2)
  • autopy (4.0.0)
  • numpy (1.20.3)
  • screeninfo package
  • camera for input image

To install these packages you only need to use requirements.txt with the pip package manager like in the following code:
python3 -m pip install requirements.txt

How to use

To get the detection work you need to set up the software's HSV values using the trackbars. To start the software in "setup mode" you need to launch it with the following arguments:
python3 control.py --setup
Use the trackbars in the middle to set up the HSV values to detect your tool that you want to use for mouse controlling. You'll see if it's successfull if a green rectangle appears around it with a whit dot in the middle. If you're finished, just press 'q' to stop the setup. All necessary values of HSV (upper and lower limits) will be saved in a .txt file.
After a successfull setup you'll be able to move the mouse with the help of your tool you chose. All you have to do now is to start the program like that:
python3 control.py
Now you'll see that the trackbars did not appear but the HSV values are read from the txt file. You can start to move your tool in front of the camera to move your mouse around the screen.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages