Skip to content

CorraPiano/bowling-analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Trajectory and Spin Detection in Bowling Throws

Language Platform By License

Project Overview

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.

Video results

Example outputs from the analysis pipeline:

Final_1.mp4
Final_2.mp4

Techniques Used

  • 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

Repository structure

├── 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

Documentation

Hot to run

  1. 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.

  2. Install the required dependencies:

    pip install -r requirements.txt

    Install FFmpeg from the link https://ffmpeg.org/download.html

  3. Navigate to the src directory:

    cd src
  4. 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.

  5. Follow the prompts to select the recording and adjust parameters as needed.

  6. Use Jupyter notebooks in the notebook/ directory for analysis and visualization.

Contacts

For questions, feedback, or collaboration, feel free to reach out:

Mentions

The videos to test the program were taken from YouTube.

Contributors 2

  •  
  •