Skip to content

Headshot Tracking: A Python script that uses OpenCV and dlib to perform real-time headshot tracking with a red dot, circle, and lines on a live video feed from your camera. Great for educational purposes and experimenting with computer vision.

Notifications You must be signed in to change notification settings

VivekSai07/Headshot-tracking

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Headshot Tracking with OpenCV and dlib

Overview

This repository contains a Python script that uses OpenCV and dlib to perform headshot tracking. The script captures video from your default camera, detects a face, and then tracks the 28th facial landmark (located between the eyebrows) with a red dot. It also draws a red circle, black lines, and displays coordinates, creating a "headshot tracking" effect. The red dot is always on top of the black lines.

Prerequisites

Before running the code, ensure you have the following installed:

  • Python 3
  • OpenCV
  • dlib
  • NumPy

You can install the required libraries using pip:

pip install opencv-python-headless
pip install dlib

How to Run

  1. Clone this repository to your local machine.
git clone https://github.com/VivekSai07/Headshot-tracking.git
  1. Change into the project directory:
cd headshot-tracking
  1. Run the Python script:
python Headshot Tracking.py
  • The application will open a window displaying the camera feed with the headshot tracking effect.
  • Press the 'Esc' key to exit the application.

Configuration

You can customize the behavior of the code by adjusting parameters in the headshot_tracking.py file. For example, you can change the color of the red dot, circle, or lines, or modify the landmark position.

Acknowledgments

This code is built upon the foundations of OpenCV and dlib and was created for educational purposes. If you find this code useful or have any suggestions, feel free to contribute or provide feedback.

About

Headshot Tracking: A Python script that uses OpenCV and dlib to perform real-time headshot tracking with a red dot, circle, and lines on a live video feed from your camera. Great for educational purposes and experimenting with computer vision.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages