# Golf ball, spin, speed and creating a trailer

**URL:** <https://forums.openmv.io/t/golf-ball-spin-speed-and-creating-a-trailer/8470>\
**Category:** OpenMV Boards\
**Created:** [June 22, 2023, 6:24pm UTC](https://forums.openmv.io/t/golf-ball-spin-speed-and-creating-a-trailer/8470 "2023-06-22T18:24:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![craig](https://avatars.discourse-cdn.com/v4/letter/c/ed8c4c/32.png) [@craig](https://forums.openmv.io/u/craig)\
**Post date:** [June 22, 2023, 6:24pm UTC](https://forums.openmv.io/t/golf-ball-spin-speed-and-creating-a-trailer/8470/1 "2023-06-22T18:24:38Z")

</div>

Hi,  
I’m new to OpenMV … I’m a big fan of Golf and think a cool implementation would be a real-time video golf ‘trailer’ …  
Q0. Is the OpenMV camera sensitive enough to calculate the spin-rate of a golf ball in flight? Could it do this for a baseball (seeing the seems may be easier on a baseball).

Q1. Could I take video using a GoPro, or similar, stream the video and overlay a colored ‘tail’ on the ball in flight? (similar to how CBS does this for golf tournaments, they also give other metrics: angle, apex, etc.).

Both seem to need similar functionalities. Anyone try something like this or similar?  
Any pointers or help appreciated!  
Craig

---

<div class="post-metadata">

**Author:** ![kwagyeman](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/kwagyeman/32/4_2.png) [@kwagyeman](https://forums.openmv.io/u/kwagyeman)\
**Post date:** [June 22, 2023, 6:42pm UTC](https://forums.openmv.io/t/golf-ball-spin-speed-and-creating-a-trailer/8470/2 "2023-06-22T18:42:09Z")

</div>

Q0: It depends on the algorithm, frame rate, etc. If you use the global shutter imager you can get high FPS, but the resolution is very small.

I don’t actually know how one even does this type of algorithm honestly. So, I’d say this is uncharted territory.

Q1: Yeah… but, the technical challenge here is getting the data to the system that’s doing the overlay in time. There’s a whole exquisite world of systems that do HD video overlay. You’re talking a minimum of $1K equipment for that.

Can our system track a ball? Maybe, but, to do the video overlay from a live camera stream is a huge amount of engineering work.

Now, if the OpenMV Cam was the source of video… that would be much easier. But, we don’t have gro pro quality video (yet).

---

<div class="post-metadata">

**Author:** ![craig](https://avatars.discourse-cdn.com/v4/letter/c/ed8c4c/32.png) [@craig](https://forums.openmv.io/u/craig)\
**Post date:** [June 23, 2023, 2:16pm UTC](https://forums.openmv.io/t/golf-ball-spin-speed-and-creating-a-trailer/8470/3 "2023-06-23T14:16:27Z")

</div>

Hi @kwagyeman,  
I did some digging how golf simulators do it … cheap ones (~$500) use some kind of radar (not sure how they get a spin rate using radar … ugh) and the more expensive (~$3k-$5k) ones use HD camera(s) (which, I’m not sure how they get the spin rate of a ball, but seems like they do and the accuracy is accepted).  
I’m not looking to spend this kind of $$ … I’m looking to do this as an academic experience.  
Thanks,  
Craig

---

<div class="post-metadata">

**Author:** ![craig](https://avatars.discourse-cdn.com/v4/letter/c/ed8c4c/32.png) [@craig](https://forums.openmv.io/u/craig)\
**Post date:** [June 23, 2023, 2:23pm UTC](https://forums.openmv.io/t/golf-ball-spin-speed-and-creating-a-trailer/8470/4 "2023-06-23T14:23:36Z")

</div>

sorry, for completeness … I did find this Python code for anyone looking at doing something similar

> **[Ball Tracking with OpenCV - PyImageSearch](https://pyimagesearch.com/2015/09/14/ball-tracking-with-opencv/)**
>
> Discover how use OpenCV for ball tracking. You'll learn how to perform basic object detection and tracking in video streams using OpenCV and Python.

here is the underlying Py code:

> **[GitHub - Practical-CV/Color-Based-Ball-Tracking-With-OpenCV](https://github.com/Practical-CV/Color-Based-Ball-Tracking-With-OpenCV)**
>
> Contribute to Practical-CV/Color-Based-Ball-Tracking-With-OpenCV development by creating an account on GitHub.

Hope this helps

---

<div class="post-metadata">

**Author:** ![kwagyeman](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/kwagyeman/32/4_2.png) [@kwagyeman](https://forums.openmv.io/u/kwagyeman)\
**Post date:** [June 23, 2023, 7:03pm UTC](https://forums.openmv.io/t/golf-ball-spin-speed-and-creating-a-trailer/8470/5 "2023-06-23T19:03:47Z")

</div>

Yeah, that’s the basics of the algorithm… but, you have to do it at high speeds… which… is hard.

We can do ball tracking with our blob detection. No problem. But, you need like 500 FPS with a large field of view at a high resolution.
