Skip to content

Rezaei-Parham/Tennis-3DVision-Project

Repository files navigation

3D Tennis Complete Analysis

Overview

This project presents a comprehensive 3D analysis of tennis, utilizing advanced computer vision methodologies. Our investigation centers on detecting players, tracking ball trajectories, establishing a 3D comprehension of the court, and classifying player poses. This framework aims to create a reliable system for fault detection and precise game statistics reporting.

Table of Contents

Introduction

This project aims to combine traditional computer vision techniques with state-of-the-art deep learning networks to create a reliable framework for 3D tennis analysis.

Ball Tracking

Introduction

Detecting a tennis ball during matches is challenging due to its high velocity and potential occlusion. Various methods, including classical and deep learning models, are used to accurately detect the ball, enabling detailed analytics and supporting ball-based analysis.

Related Work

  • Fazio et al. (2018): Utilized stereo smartphone videos for ball trajectory estimation.
  • Qazi et al. (2015): Developed an automated ball tracking system using machine learning and image processing techniques.
  • Huang et al. (2019): Employed a convolutional neural network (CNN) to predict the tennis ball’s position.

Method

We use TrackNet, a CNN that processes three sequential frames to produce a heatmap indicating the ball's location. The model achieves up to 99.7% accuracy in ball position prediction.

Challenges

To address occlusion, we use:

  1. Interpolation: Estimates the ball’s position in the current frame using the last visible points.
  2. Multi-View Correspondence: Employs 3D knowledge of epipolar lines to estimate the ball’s position using additional cameras.

Efficient Tennis Broadcast (ETB)

Introduction

ETB introduces an innovative approach to broadcasting tennis matches under limited internet bandwidth conditions by focusing on key elements - the players and the ball.

Method

ETB uses a fixed background image and dynamically updates and transmits only the regions surrounding the players and the ball, significantly reducing data transmission requirements.

Further Insights

For a comprehensive understanding and visual representation of ETB, visit our GitHub repository, where a demonstrative video is available.

Player Detection and Tracking

Method

We use MOG background removal and the CSRT tracking algorithm to detect and track players. Morphology and connected component analysis techniques enhance the accuracy and reliability of player tracking.

Implementation

Implemented using OpenCV, the system integrates MOG2 background subtraction and CSRT tracking to monitor player movement throughout the game.

Detecting Tennis Court

Detecting Tennis Court Pixels

We apply a mask to remove non-white pixels and then use RANSAC to fit lines to the remaining white pixels corresponding to the court lines.

Finding Tennis Court Lines from White Pixels

RANSAC identifies lines corresponding to the tennis court lines and the net line.

Finding Tennis Court Keypoints from Tennis Court Lines

Keypoints are identified by systematically finding the intersection of the detected lines.

Calibration Using Keypoints

Using the identified keypoints, we calibrate the camera to map 3D coordinates to 2D pixel locations.

Pose Classification

Introduction

We utilize the THREE DIMENSIONAL TENNIS SHOT HUMAN ACTION DATA SET to classify tennis movements.

Methods

  • Canny Edge Detection: Extracts useful information from video frames to provide input to a neural network for classification tasks.

Motion Detection

Overview

Motion detection identifies changes in object position within a video sequence, crucial for various applications.

Background Subtraction

Implemented using OpenCV, this technique involves comparing each video frame against a background model.

Noise Reduction

Median filtering is used to reduce noise in the detected edges, enhancing the fidelity of the motion detection.

Deep Learning Framework

Method

Our approach combines a fine-tuned CNN for spatial feature extraction with an LSTM for temporal modeling. This setup processes tennis videos to predict action classes.

Experimental Evaluation

Evaluated on a dataset of tennis serve videos, our model is trained and tested with metrics such as categorical cross-entropy loss and accuracy.

Advertising

We use homography to integrate advertisements into the tennis court's surface, ensuring a natural appearance during live broadcasts.

References

  • Canny, J. (1986). A computational approach to edge detection. IEEE Transactions on pattern analysis and machine intelligence, 8(6), 679–698.
  • Chollet, F. (2017). Xception: Deep learning with depthwise separable convolutions.
  • Huang, Y., Liao, I., Chen, C., Ik, T., & Peng, W. (2019). TrackNet: A Deep Learning Network for Tracking High-speed and Tiny Objects in Sports Applications. CoRR, abs/1907.03698.
  • Qazi, T., Mukherjee, P., Srivastava, S., Lall, B., & Chauhan, N. R. (2015). Automated ball tracking in tennis videos. 2015 Third International Conference on Image Information Processing (ICIIP), 236–240.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published