Skip to content

Mrpradhanji/Virtual-Mouse-using-OpenCV-main

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Virtual Mouse Using OpenCV

Project Overview

In this project, we utilize a webcam to create a virtual mouse using hand tracking. By leveraging the live feed from the webcam, we can control a virtual mouse with hand gestures, eliminating the need for a physical mouse. The hand detection is focused on the forefinger and middle finger, where the forefinger acts as the cursor. Moving the forefinger around moves the cursor, and bringing the forefinger and middle finger together performs a click action.

To ensure smooth cursor movement, a smoothness factor is applied to reduce shakiness.

Requirements

To ensure the project functions correctly, the following modules must be installed:

  • OpenCV: An extensive open-source library for computer vision, machine learning, and image processing. OpenCV supports various programming languages, including Python, C++, and Java. It can be installed using pip install opencv-python.

  • Mediapipe: A framework for building multimodal (e.g., video, audio, time series data), cross-platform (Android, iOS, web, edge devices) applied ML pipelines. Install it with pip install mediapipe.

  • Autopy: A cross-platform GUI automation library for Python that includes functions for controlling the keyboard and mouse, finding colors and bitmaps on-screen, and displaying alerts. Install it using pip install autopy.

Important Note

This project may encounter dependency issues. Here are some common issues and their solutions:

  • Autopy Installation Issues: Autopy does not support Python versions above 3.8.
  • Webcam Not Opening: This was a bug in Mediapipe, fixed in later Python versions.

To ensure smooth execution, you need to downgrade your Python version to 3.8.

Downgrading Python Version

Follow these steps to downgrade Python:

  1. Uninstall Python from the Add/Remove Programs.
  2. Navigate to AppData and delete any remaining Python folders.
  3. Download and install Python 3.8 from the official Python website.
  4. Confirm the installation by running pip in the command prompt.

By following these steps, your Python version should be downgraded successfully, allowing the project to run smoothly.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published