0

So, I have been working on a cricket ball tracking project and have managed to do ball detection and tracking fairly successfully. The next step is to predict the future trajectory, using polynomial regression.

Below is an illustration of the stage I am at. The blue dots represent the last few ball locations before the ball reaches the batsman.

enter image description here

Now, if I were to apply regression on these points to predict the future path (i.e. where the ball would go if it is not intercepted), I might get something like this:

enter image description here

The issue is, if I were to carry this red line on, it would appear to pass above the stumps and carry on due to the perspective from which the video is taken when in reality, the ball would actually go on to hit the stumps and not carry on past the batsman. However, this is the only viewing angle I have.

(For reference, the stumps are the three sticks at either end of a cricket pitch:

enter image description here

In the image on which I've plotted ball positions, the batsman is partially obscuring the stumps.)

I am unsure on how to fix this issue however.

Is it possible to apply some kind of perspective transform to the video frames so that the viewing angle is improved, and the predicted trajectory might more closely match reality?

Alternatively, is it possible to compute the height of the ball above the ground? Then I can compare this to the height of the stumps (known, both in pixels in the video frames, and in real life). I also know the (x,y) coordinates of a single point when the ball is in contact with the ground (height = 0).

Lastly, I believe I can also calculate approximate 3D depths - i.e. at any point, how far along the pitch is the ball - if this may help. I haven't tried to implement this, however, because I wasn't sure how depths would fix my problem.

Any suggestions would be much appreciated because this is the last hurdle on a project I've spent a lot of hours on!

V. Jain
  • 13
  • 3
  • the title confuses me. why would you wanna warp the video when you should be projecting the trajectory into the camera's perspective? do you mean to say you're trying to solve this in 2D? that'll never work. you need a proper 3d trajectory. – Christoph Rackwitz Oct 12 '22 at 16:29
  • What exactly do you mean by projecting the trajectory into the camera's perspective? I've very little experience with cameras and rays and the like. I essentially want some way of finding the height of the ball in real life relative to the height of the stumps in real life (which is known) – V. Jain Oct 12 '22 at 18:04
  • these virtual umpire systems use multiple cameras. they actually track the ball in 3D – Christoph Rackwitz Oct 12 '22 at 18:44
  • @ChristophRackwitz Yes I'm aware they have several, but I have been unable to find any synchronised footage from different angles. So I'm trying to do the best I can with a single camera angle :/ Maybe I can use some software to get a 3D model from the 2D image? – V. Jain Oct 12 '22 at 18:54
  • @ChristophRackwitz I found a paper employing a similar technique to mine, and it says that "perspective projection" was used to transform video (x,y) coordinates to real world (x,y) coordinates? Does this sound like something that can be done? – V. Jain Oct 12 '22 at 19:05
  • this is going beyond the scope of a question that fits on stack overflow. please review [help/on-topic] and consider discussing this on a forum rather than SO. – Christoph Rackwitz Oct 12 '22 at 19:20

0 Answers0