Skip to content

mfzeidan/golfeye

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Golf Ball Tracker

A golf ball tracking compass system that helps golfers locate their ball after hitting it. The system uses computer vision to track golf ball trajectories and provides directional guidance via a web interface.

Features

  • Real-time golf ball detection and tracking
  • Trajectory prediction for errant shots
  • Web-based compass interface
  • Works on Mac (prototyping) and Raspberry Pi (production)

Setup

Mac (Development)

  1. Install dependencies:
pip install -r requirements.txt
  1. Copy environment configuration:
cp .env.example .env
  1. Adjust .env settings if needed (camera index, thresholds, etc.)

  2. Run the application:

python src/main.py
  1. Open your browser to http://localhost:5000

Raspberry Pi

  1. Install system dependencies:
sudo apt-get update
sudo apt-get install -y python3-pip python3-opencv libopencv-dev
  1. Install Python dependencies:
pip3 install -r requirements.txt
  1. Configure .env for Raspberry Pi camera:
CAMERA_INDEX=0  # or use /dev/video0
  1. Run the application:
python3 src/main.py
  1. Access from your phone/tablet at http://<raspberry-pi-ip>:5000

Project Structure

golfeye/
├── src/
│   ├── detection/      # Ball detection modules
│   ├── tracking/       # Ball tracking and trajectory prediction
│   ├── compass/        # Direction calculation
│   ├── web/            # Web server and frontend
│   ├── camera/         # Camera abstraction
│   └── main.py         # Main application entry point
├── models/             # ML models (optional)
├── tests/              # Unit and integration tests
└── requirements.txt    # Python dependencies

Configuration

See .env.example for all configuration options. Key settings:

  • CAMERA_INDEX: Camera device index (0 for default)
  • FRAME_SKIP: Process every Nth frame (higher = better performance)
  • LAUNCH_VELOCITY_THRESHOLD: Minimum velocity to detect ball launch
  • WEB_PORT: Web server port

Usage

  1. Position the camera on your golf cart to view the golfer
  2. Start the application
  3. Open the web interface on your phone/tablet
  4. Hit your golf ball
  5. The compass will guide you to the predicted landing location

Development

The system uses a hybrid detection approach:

  1. Color-based detection (fast, good for white balls)
  2. ML verification (optional, more accurate)
  3. Kalman filtering for smooth tracking
  4. Physics-based trajectory prediction

License

MIT

About

Golf ball tracking compass system for locating golf balls after shots

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors