This project focuses on detecting the trajectory and spin of a bowling ball using computer vision techniques. Leveraging Python, OpenCV, and 3D reconstruction, the system processes video recordings to extract detailed motion information for performance analysis or further research.
Example outputs from the analysis pipeline:
Final_1.mp4
Final_2.mp4
- Lines and ball detection using OpenCV
- Frame extraction and video preprocessing
- Lane and background segmentation
- 3D trajectory reconstruction
- Spin and rotation estimation using Optical Flow
- Visualization and result compilation
├── data/ # Raw and processed data
│ ├── auxiliary_data/ # Shared resources (e.g., circle_positions/)
│ ├── recording_1/ # Data for recording 1
│ ├── recording_2/ # Data for recording 2
│ ├── recording_3/ # Data for recording 3
│ └── recording_4/ # Data for recording 4
├── documents/ # Notes and reference materials
│ ├── papers/ # Research papers
│ ├── IACV_presentation.pdf # Ppt Presentation
│ ├── Links.txt # Useful links
│ ├── Notes.txt # Project notes
│ └── Report_IACV_Bowling.pdf # Project report
├── notebook/ # Jupyter notebooks for analysis
│ ├── ball_detection/ # Ball detection notebooks
│ ├── lane_detection/ # Lane detection notebooks
│ ├── reconstruction/ # 3D reconstruction notebooks
│ ├── spin/ # Spin analysis notebooks
│ ├── trajectory/ # Trajectory analysis notebooks
│ ├── various_tests/ # Miscellaneous tests
│ └── video_creation/ # Video creation notebooks
├── output_data/ # Output videos and results
│ ├── recording_1/ # Outputs for recording 1
│ ├── recording_2/ # Outputs for recording 2
│ ├── recording_3/ # Outputs for recording 3
│ ├── recording_4/ # Outputs for recording 4
│ └── templates/ # Output templates
├── src/ # Source code
│ ├── app.py # Web app entry point
│ ├── main.py # Main script to run the project
│ ├── ball_detection/ # Ball detection logic
│ ├── lane_detection/ # Lane detection logic
│ ├── reconstruction/ # 3D reconstruction logic
│ ├── spin/ # Spin analysis logic
│ ├── trajectory/ # Trajectory analysis logic
│ └── utility/ # Utility functions
├── README.md # Project overview and instructions
└── requirements.txt # Python dependencies
-
Clone the repository:
git clone https://github.com/your-username/bowling-trajectory-spin.git cd bowling-trajectory-spin
Replace
your-username
with your GitHub username. -
Install the required dependencies:
pip install -r requirements.txt
Install FFmpeg from the link https://ffmpeg.org/download.html
-
Navigate to the
src
directory:cd src
-
Run the main script:
python main.py
Alternatively, you can launch the web app (requires Streamlit):
streamlit run app.py
This will open an interactive web interface in your browser, allowing you to execute the full bowling analysis pipeline without using the command line.
-
Follow the prompts to select the recording and adjust parameters as needed.
-
Use Jupyter notebooks in the
notebook/
directory for analysis and visualization.
For questions, feedback, or collaboration, feel free to reach out:
-
Davide Corradina
Mail: [email protected]
GitHub: CorraPiano -
Michele Fassini
Mail: [email protected]
GitHub: MicheleFassini
The videos to test the program were taken from YouTube.