SforAiDl / Playground

A python library consisting of pipelines for visual analysis of different sports using Computer Vision and Deep Learning.
MIT License
18 stars 17 forks source link

Plain court template for heatmap #34

Closed ashwinvaswani closed 4 years ago

ashwinvaswani commented 4 years ago

Currently, the heatmap base image contains the players too. We would like to have a base template court of the same size as the wrapped transform(see dimensions of heatmap.png) and show heatmap on that rather than a court image with players. Eg: If we can have a pure white image with just badminton court "white" lines in black as base image, that would be good to show the heatmap on. We can explore other colors and black/neon color scenes later

Sharanranjit commented 4 years ago

For this I was wondering if we can get the court through hough transform and grabcut algo as done in this paper(Secion 4.1) by the same author. This will help in avoiding the user input for court coordinates and we can maintain this template throughout. But I was failing multiple times in hough transform to get the courts borders. If anyone has any suggestion regarding this, please feel free to share.

ashwinvaswani commented 4 years ago

The current extraction based on the manual input is this: https://drive.google.com/open?id=1nAi3SaP1fFYBf4lT1afYhjkorCveGrju

@Sharanranjit Can we explain what issues were you facing with the Hough transform? Would you like to take up this issue?

Sharanranjit commented 4 years ago

Oh, I am not sure yet. I was just exploring an alternate way to generate heat maps as we are depending on the user to input court coordinates. Was curious whether we can avoid that. Regarding Hough transform, I could'nt come up with right number of lines as the image has various redundant lines. Check out this fig. Do you think its necessary or can we just continue with user input?

image

Sharanranjit commented 4 years ago

Yep, I can take up this issue now. Will share a screenshot soon

ashwinvaswani commented 4 years ago

Sure!

Sharanranjit commented 4 years ago

Can you verify if this is fine? I made the all pixels at column mid white, to represent the net. It was kinda trial and error values i used for dilation and erosion, but works fine for most images. image

ashwinvaswani commented 4 years ago

That's great! Send a PR. Currently result of perspective transform is used as base image for heatmap. Change it to this and for center bottom coordinates use any neon/bright colour.