cricket-umpire-assistance
Cricket umpire assistance and ball tracking system that using video from a single smartphone camera.
Instructions
- Run
python object_detector/ballTracking.py
with the following arguments:-v/--video
(Required): Path to the video file-a/--attack
(Optional): Specify bowling attack - 1 for Spin bowling and 0 for Fast-s/--sliding
(Optional): Show sliding windows during ball detection-f/--first
(Optional): First frame number
- This will save run the ball tracking algorithm and generate the 3D coordinates of the tracked ball, which will be written to
coordinates.txt
in the form:x,y,radius,frame_no,is_bouncing_point, linear_reg_radius, quad_reg_y
- Finally run
python object_detector/3d.py
which uses the coordinates generated byballTracking.py
to visualize the trajectory and output the umpiring decisions.
GUI
To use the GUI for running the tracking and visualization scripts directly, run python gui/gui.py
. The GUI requires the Kivy library to be installed.
(The python_bin
paths in gui/gui.py
and path to the object_detector
and gui
directories will have to be updated accoridng to the local machine before running the GUI.)
Video
You can see the frame-by-frame visualization of the tracked ball here: https://www.youtube.com/watch?v=K9MP5UlGBEI
Report
You can find a pre-print (unfinished) version of the report associated with this project here: https://peerj.com/preprints/3402/
Dependencies
- Ball Tracking
- OpenCV 3.x
- Numpy
- Scipy
- Visualization
- VPython
- Pillow
- GUI
- Kivy