Skip to content

kota2004/Edgefleet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Edgefleet

Cricket Ball Detection and Trajectory Tracking

This project detects the centroid of a cricket ball in each frame of a video captured from a static camera. It generates a processed video with the ball trajectory and a CSV file containing per-frame annotations.


Features

  • Detects cricket ball using color-based segmentation.
  • Tracks the ball using temporal consistency.
  • Generates trajectory overlay on output video.
  • Produces per-frame centroid annotations.

Requirements

Install the required libraries:

pip install opencv-python numpy pandas

Input

  • Cricket video from a static camera.
  • Supported format: .mp4

If your video is in .mov format, convert it:

ffmpeg -i input.mov input.mp4

How to Run

  1. Place your video file in the same directory as the script.

  2. Open the Python script and set:

video_path = "your_video.mp4"
  1. Run the script:
python cricket_ball_detection.py

Output

For each video, the following files are generated:

  • output_with_trajectory.mp4 → Processed video with ball trajectory

  • ball_annotations.csv → Per-frame ball centroid data

CSV format:

frame_index, x_centroid, y_centroid, visibility_flag

If the ball is not visible:

x = -1, y = -1, visibility_flag = 0

Multi-Video Processing

To process multiple videos, place them in a folder and modify the main script to loop through all files.


Author

Dhana Lakshmi AI22BTECH11012

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors