Ball position detection in Padel game

Hi.
This is my first post and if there is something wrong, please let me know.
I’d like to build an project which detects and analyze a padel game (similar to tennis ball).
But I’m still not sure whether this is possible to detect a ball position (x,y,z) and Ball elevation when it reaches the NET.
The reason why I worry about this issue is that all videos (data source) uses a single camera at a single point.
All record is recorded from a single camera at a fixed position.
One source video looks like this.

I have many videos but all are recorded using same camera at a same point.
Looking forward to hearing for you.
Thanks.

Hi, currently, this application is very hard for our system to do. It will become much easier though once we integrate a generic bilinear image remap feature which we are being paid to work on and hope to deliver before the end of the year.

To solve your problem… generally you need these steps:

  1. Lens Correction to make the lines straight.
  2. Birds Eye View transform to make it such as if the camera was staring at the scene from top down.

We have lens correction code via lens_corr() and birds-eye view via rotation_corr(). However, they are slow and produce ugly-looking images, as we currently use the nearest neighbor resize.

Anyway, after these two steps are done you basically have a 2D image with the ball moving around which you can track find find_blobs() to determine where it’s at. Height off the ground will not be something you can easily tell, though.

So, as mentioned, if you don’t mind bad image quality/speed the current software library can do what you want. color tracking of the ball doesn’t care how rough the image looks. But, there’s work to do done on our end to make this faster and look good.

With a generic remap of each pixel using bilinear sampling we can transform the image into a birds-eye-view with high quality pixel interpolation in one step with very little FPS impact.