Skip to content

eddiewsh/Laser-Tracker-With-Webcam

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

Laser Tracker

This project implements a laser point tracking system using a webcam to control the mouse cursor on the screen. The system detects a red laser point in the webcam feed, maps it to screen coordinates using perspective transformation, and moves the mouse cursor accordingly.

Requirements

  • Hardware:
    • A webcam connected to your computer.
    • A red laser pointer for tracking.
  • Software:
    • Python 3.x
    • pip (Python package manager)
    • OpenCV dependencies (e.g., libopencv-dev on Ubuntu)

Dependencies

The project requires the following Python packages:

  • opencv-python: For webcam capture and image processing.
  • numpy: For numerical operations and array handling.
  • pyautogui: For controlling the mouse cursor.

Installation

  1. Clone or Download the Project: Ensure you have the laser_tracker.py script in the same directory.

  2. Install System Dependencies (if needed): On Ubuntu/Debian, install OpenCV dependencies:

    sudo apt-get install libopencv-dev

Usage

  1. Run the Script: Run the script directly:

    python3 laser_tracker.py
  2. Select Four Points:

    • A window will display the webcam feed.
    • Double-click to select four points in the following order: top left, top right, bottom left, bottom right.
    • These points define the region in the webcam feed to map to the screen.
  3. Track the Laser Point:

    • Point a red laser at the selected region.
    • The script will detect the laser point and move the mouse cursor to the corresponding screen coordinates.
    • A window (Track Laser) will show the transformed video feed with the detected laser point marked.
  4. Exit:

    • Press the Esc key to exit the program.

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages