This project involves tracking a ball's position in a video and classifying the ball's state using a neural network model. The classification results are used to determine the shot to be played in a game scenario.
- Ball tracking using OpenCV template matching.
- Ball state classification with a neural network model.
- Automated shot determination and execution based on ball position and state.
To set up the project, follow these steps:
- Clone the repository:
git clone https://github.com/kukr/Transforming-Gameplay-Through-Vision-Automation.git
- Install the required Python packages:
pip install -r requirements.txt
To run the ball tracking and classification:
- Execute the
automation.py
script:
python automation.py
-
Adjust the trackbars in the OpenCV window to set the area of interest.
-
The script will track the ball, classify its state, and simulate the appropriate shot.
The neural network model is trained to classify the ball's state into three categories: Left, Not Active, and Right. The model is defined and trained in the Our_NeuralNetwork_Model.ipynb
Jupyter notebook.
Contributions to this project are welcome. Please fork the repository and submit a pull request with your changes.
This project is licensed under the MIT License - see the LICENSE file for details.