We have developed an algorithm that accurately detects basketball players in a video and is able to accurately place them in a 2D top-view court. We have achieved such results making use of an association of the hog detector from OpenCV and color segmentation.
This project was developed entirely on MATLAB. In order to achieve our end goal of a two dimensional image with player positioning, we made use of a five step algorithm, each of which will be further expanded:
1) Court Detection – find lines of the court;
2) Individual Detection – detect individuals standing on the court;
3) Color Classification – Separate these individuals into two teams;
4) Player Tracking – Keep positions information frame by frame;
5) Mapping – translate onto a court
The data for the project consisted of multiple YouTube videos which were then cropped in order for us to do our analysis. We mainly selected videos in which we were able to see all major lines of the court in order to accurately perform the homography.
Fig. 1 illustrates the block diagram of algorithm developed.