Discussion in 'Other Equipment' started by tennisplayer_85, Nov 12, 2012.

1. ### tennisplayer_85New User

Joined:
Apr 2, 2012
Messages:
37
So I have this idea that I would like to give a shot but I don’t know if it’s worth all the energy. So hopefully you guys can help me figuring out if I should spend the next 150 hours or so on building this.

I got this idea because I guess I am an extremely fanatic tennisplayer (who wishes he could play like the PRO’s ) and keep watching them on TV all the time. What bothered me was that you can almost always see how fast the PRO’s serve, which made me wanna know how fast I could serve (aaarrrhhh).

So I thought first of buying a speedgun, but they are pretty expensive. Than I got interested in the mathematical part of it. So I wondered of a bit and finally figured I could probably built an iphone app (I’ve been programming for over 10 years). So in my enthusiasm i did make a start and actually know now its possible to calculate the speed very accurate with my iphone. But its still a lot of work to make it available for you guys.

Since I work a lot and have much other stuff too I don’t know if I should spend the next 150 ours or so in making this App to find out I am maybe the only one who is so curious.

I made this link for a poll: www.tenniservespeed.com so you can let me know.

So what do you guys think?

2. ### SabrathaG.O.A.T.

Joined:
Jun 6, 2012
Messages:
15,853
Location:
weak era
That's a broken link, but I'm interested.

Joined:
Apr 2, 2012
Messages:
37
4. ### The MeatHall of Fame

Joined:
Aug 9, 2012
Messages:
1,996
Attach Iphone on net, capture the serve with the video capture and try to get the frames per second off of it. Create a program that converts that to seconds and then find a way to input a specific distance from one end to the other. Then the simple V=d/t formula. I would like 40% of your profit when your finished.

5. ### mmkProfessional

Joined:
Sep 20, 2011
Messages:
1,107
Location:
1 AU from the Sun
As I understand it, the speed guns measure the speed shortly after the ball leaves the racquet. Using time and distance will result in a slower speed than the gun would give, as the ball loses a fair amount of speed due to friction moving through the air. The data would still be useful as a relative measure, but would not be comparable to radar data. If you were to use time and distance, would it be to where it bounces, or to the receiver's racquet? If the latter, then court material will also be a factor. Then you also need to take into account spin, as a heavily sliced serve will travel a greater distance than a flat serve (assuming the same release and bounce points).

6. ### SatchHall of Fame

Joined:
Nov 5, 2007
Messages:
1,859
i believe that his profit would be 0 if he listened to you

i am afraid that to make accurate measure of ball speed, using simple camera from you iphone, is not gonna get you the results. You could get some results but it will be way off.

However i believe that using some kind of sensor inserted in the ball, and gps, you can get much better results. But its also a harder to do it right.

To the OP, i know that idea is good, but how would you create the app? I need details. How the app will know where is the ball in that video. How the app will know when the ball is going off the racquet, and when it crosses the net (to calculate)?

As a programmer myself, i would like to know your idea, or it didnt happened.

7. ### rufus_smithProfessional

Joined:
Apr 21, 2011
Messages:
887
Please make an android version.I would pay you real cash for that.

8. ### Fearsome ForehandProfessional

Joined:
Aug 23, 2007
Messages:
1,213
Location:
USA
Make an app that tells the user " Your serve speed is 150 mph" no matter what the real speed is. You will sell millions.

9. ### tennisplayer_85New User

Joined:
Apr 2, 2012
Messages:
37
Thank you all for the positive reply's and votes already within this short period of time ! After working so many hours on something that is only costing time you get demotivated. So i was really doubting if it was still worth it. But this really gives me a boost!

As requested I'll explain some more details of the app:
It calculates from when the racket touches the ball until the ball lands on the ground.
I have already a working app that does the whole calculation but it's definitely not a friendly app yet. So it still needs a lot of work. I am not gonna give away my secret why my calculations are accurate. But what i meant wondering of in the mathematics was more than the formula V=d/t. In fact i created a Macbook application first to calculate the whole thing. Especially the position in the field for calculating the distance seemed to be a big problem in the beginning. So i used A=USVt (singular value decomposition) to get an H-matrix to transfer coordinates from one perspective to another. As i said before i was pretty enthusiastic and i came to find all the important factors for getting the speed as accurate as possible. In the end it turned out to be relatively more simple but if you don’t walk the walk you cannot know.

Than I figured an iphone app would be better because when you go and play tennis you mostly carry your phone with ya, and it would be much more practical.
So I transfered my code into an ios app (luckily without to many complications because it’s both objective c). Unfortunately its only ios for now, sorry for the android people. But if there’s gonna be sufficient downloads I will definitely consider looking into it.

The more votes the more enthusiastic I get means the quicker I finish the app.
Thank you all so far!

10. ### DoublesHall of Fame

Joined:
May 4, 2010
Messages:
4,319
Location:
Approaching the net
Make it, and make it free, please

11. ### SatchHall of Fame

Joined:
Nov 5, 2007
Messages:
1,859
ok you are keeping a secret.. but you still didnt told me how the app will know where is the ball on the screen and when it is hitted by the racquet. I am not asking for a code or something, just the idea.

But ok, we will see your result when finished.

12. ### Chas TennisHall of Fame

Joined:
Feb 17, 2011
Messages:
4,807
Location:
Baltimore, MD
considerations for Smartphone velocity measurement

I thought of using my Samsung Galaxy S2 Smartphone. I was surprised to learn that the frame rate on that particular phone may vary under some circumstances. Maybe it only slows down (<30fps) in low lighting levels. ? I would check that point for any phone video camera before assuming that it is an accurate 30 or 60 fps.

Scale for calibrating distance-
https://vimeo.com/49909907

Another consideration - most smartphones have very wide angle lenses. The magnification changes across the image.

There are some golf smartphone applications that you might want to check.

Good luck, it looks like a great, fun project!

13. ### db10sHall of Fame

Joined:
May 14, 2012
Messages:
1,954
Location:
S. FL/Maine
Good luck with it.... And make it free to TT members.

14. ### bugeyedSemi-Pro

Joined:
Sep 14, 2010
Messages:
543
Location:
Tx
Sten Kaiser,AKA stoneage, developer of RacquetTune, has an iOS app, SpeedClock, that measures object speed using the iPhone/iPod camera. He includes instructions for measuring serve speed. Here's a link http://appmaker.se/?m=5&s=1

Cheers,
kev

Last edited: Nov 12, 2012
15. ### sundaypunchHall of Fame

Joined:
May 17, 2011
Messages:
1,756
Are you going to tell the OP that Santa isn't real next?

16. ### stoneageRookie

Joined:
Apr 8, 2010
Messages:
255
Location:
Stockholm, Sweden
Measuring the speed of tennis balls with a smartphone is an interesting problem that I have been spending some time on (as note above). Since there is some interest here I though I would explain how I did it. As shown at the end of the speedClock video measuring a tennis serve involves recording a video of the event. This means that you don't have be so careful when to start and stop and you can measure yourself. Then you scroll the video to point where the ball is roughly mid screen. The app then starts analyzing the frames around this point in the video. After some image processing the ball is isolated and presented as colored blobs. By aligning them to one point you get information about how much the ball has moved between each frame. In the video this is done manually, but in recent version of speedClock this is done automatically. This gives you the speed in pixels/frame, fun but not so useful. The picture below shows a screen dump of an actual serve with the mid frame and the ball from 2 frames on each side before speedClock aligns them.

Since the iPhone camera is a passive device there is no way for it to know if it is a small, slow, close object or a big, fast distant object. So you have to tell the app either how far away or how big it is. Since a tennis ball is fairly small and the image usually is a little blurred giving the distance is more accurate. On a tennis court this is seldom a problem since you have known distances marked up i.e. from the sideline to the mid point. With that information the app can convert pixels to meters.

Finally you need the time. As Chas Tennis noted, a smart phone can drop frames in low light. However, you can still get the information of the exact time each frame was captured, so a lower frame rate is not a problem. Still you get the best results when the light conditions are good since the motion blur is less.

There are of course other ways to measure the speed, but all has their own challenges.

tennisplayer_85's app will of course be a competitor, but since speedClock has a much broader aim than tennis serves I don't see it as problem. And the app store could benefit from more serious apps this area (as you noted). With the cost of iPhone apps I also think most people can afford both

Since I am developing as much for fun as for profit I am also interested in seeing how you solved the problem. So I am looking forward to buying your app.

/Sten

___________________________________________________________
racquetTune, stringBed and swingTool racquet apps for the iPhone/iPad.

17. ### ramos77Semi-Pro

Joined:
Mar 19, 2012
Messages:
602
even real police radar guns have to be calibrated often so they are accurate.

no way you could make make app to accurately measure serve speed.

18. ### bugeyedSemi-Pro

Joined:
Sep 14, 2010
Messages:
543
Location:
Tx
OK! Well there you have it. No sense in pursuing this. Sorry guys, but don't waste your time.

Cheers,
kev

19. ### Chas TennisHall of Fame

Joined:
Feb 17, 2011
Messages:
4,807
Location:
Baltimore, MD
Some subjects to cover for a Smartphone/video velocity measuring capability-

1) Jello Effect Distortions
My understanding subject to correction - CMOS imagers read out lines sequentially, for example, first at the top to last at the bottom of the frame. A single video line is read out simultaneously but there is a very slight readout delay until the next line is readout. This delay can add up to cause errors when the ball does not travel parallel to a line of video. Balls traveling parallel to lines have minimum time error and those traveling across video lines have the greatest error.

The HTC One X Smartphone does high speed video at 120 fps. Here is an example of Jello effect distortion-

2) Alignment Error. Objects or balls that travel away or toward the camera (instead of just across the frame, etc.) will introduce errors. An error analysis should show how sensitive the velocity measurement would be to ball travel direction alignment error. The analysis might indicate that alignment error would still yields a small velocity error, 5-10%?, for reasonable 'eyeball" alignments. Also, I believe the error of poor alignment might always yield a slower velocity that the real serve velocity(a good thing for poor alignment & bragging rights).

3) For the tennis serve placing the camera on the singles or doubles sideline and into the court, say, 8-10 feet might give a pretty good alignment viewing perpendicular to most serve trajectories.

Last edited: Nov 13, 2012
20. ### Mister droolRookie

Joined:
Dec 20, 2011
Messages:
184
Location:
Pt
why by image and not by sound?

The thumb of a raquet hitting a serve is pretty loud, and if you put a phone (or something similar near the service box you are aiming, it could pick up the sound of when the ball hits the gound... from both noises it could calculate the amount of time the ball traveled the air up until it hit the ground. you type in the measurements of a tennis court, from the baseline to the service box, count the height of the net, and then do the part where im bad at - the maths.

no?

21. ### Chas TennisHall of Fame

Joined:
Feb 17, 2011
Messages:
4,807
Location:
Baltimore, MD
The article below on the kick serve says that the serve bounces so high because it hits the court at a large angle. Since the ball curves more it will travel a longer path. How would serve trajectory based on sound measurements affect the velocity calculation compared to a flat serve?

Rod Cross, the kick serve in "TW University" link above
http://twu.tennis-warehouse.com/learning_center/kickserve.php

For comparisons, the standard measurement has become the radar measurement after hitting the ball.

Last edited: Nov 13, 2012
22. ### Mister droolRookie

Joined:
Dec 20, 2011
Messages:
184
Location:
Pt
I did not tought of that my good sir
I was only thinking flat serve all the way...
good point good point

23. ### pvaudioLegend

Joined:
Jul 13, 2009
Messages:
7,538
This is exactly the reason they measure this way. Trajectories and various spins vastly alter simpler radar methods. As a simple example using a hand-held radar, if you have a car traveling around a curve, the only point that you should measure the car's velocity (as speed and velocity are not the same) is when it as close to dead-on ahead of you (assuming you're standing in the track and somehow will not be killed by a speeding race car). If you measure it at any other time during the curve, the reading you will get is of its velocity which is going to be lower than its speed (what you really want to know). Put simply: how fast it is going around a bend is not the same as how fast it is approaching your fixed measurement point. The latter is slower. Since a serve can travel in a severe arc, measurements right off the stringbed (in the car example, when you're staring right at the headlights and take the reading) are the most accurate measure.

24. ### 3feesHall of Fame

Joined:
Jun 24, 2010
Messages:
2,958
Location:
NorCal
I'll do it the easy way,,,one person stand at the net with a stop watch(good to the tenths of seconds-interpolate if in between tenths) and clicks it at moment of impact and then clicks it again as the ball crosses the net(fast clicking) take V=D/T
With a calculator in scientific notation input 39'/x seconds multiply by the factor 1.467 to get miles per hour or mi/hr.

examples:
39/.40 sec ~ 143 mi/hr
39/.50 sec ~ 111 mi/hr
39/.60 sec ~ 95 mi/hr
....
39/1.0 sec ~ 57 mi/hr

The factor 1 x 60 sec/ minute x 60 minutes/ hour= 3600 seconds = 1 hour
5280 feet = 1 mile
5280 ft/ 3600 sec = 1.467 miles/ hour

:mrgreen:

Credit were credit is due for this....

Last edited: Nov 13, 2012
25. ### golferNew User

Joined:
Sep 17, 2012
Messages:
10
can't you do this with a camera side view of serve. Take the frame at impact and the time it takes to cross the net and use that distance. That way human error is gone. I know bowling is slower but you can get axis tilt revs and ball speed by putting a strip of tape on the ball and recording the throw.

26. ### tennisplayer_85New User

Joined:
Apr 2, 2012
Messages:
37
hey guys, just updating you on my progress!
So i took last week off to work fulltime on this app! I am really happy with the result so far and hope i can commit it to the app store by the end of this week or at most beginning of next week.

@3fees: I have looked into this method but human error is a big issue here. With a 30 fps camera, selecting the frame the ball is hit and lands, the error can be 10 miles off. I dont think that a human is more precise than 30fps.

Solution: 60fps.

In the App i am using this approach and it works very well. There will always be a slight error in accuracy but it is reduced to the very minimun possible. And i guess we can live with a measurement that is about 2.5 miles off.

please keep on letting me know what you think at:
http://www.tennisservespeed.com/
Because this really gives me a boost to work hard and make this happen.

I'll let you guys now as soon as i am ready!

27. ### paul_tennisRookie

Joined:
Jan 27, 2010
Messages:
234
Great idea, I definitely will get this app for my iPhone.

Good luck with the app!

Joined:
Nov 9, 2012
Messages:
2,291
Location:
Toronto
Me too!

29. ### tennisplayer_85New User

Joined:
Apr 2, 2012
Messages:
37
Hi guys! I submitted the app to the AppStore just now!
It still needs to be reviewed by apple, dont know how long that takes. But soon it will be available !

Its called, who could have guessed: "ServeSpeed".

I'll let you know as soon as it really is available. Just happy that i made it through this whole process

30. ### BHiCRookie

Joined:
May 7, 2012
Messages:
308
Location:
USA
What are the chances that you come up with an android version of the app?

The concept sounds really cool, but I don't have an Iphone :cry:

31. ### The MeatHall of Fame

Joined:
Aug 9, 2012
Messages:
1,996
How much will the app cost? Hope you get it approved!!

32. ### SystemicAnomalyG.O.A.T.

Joined:
Feb 25, 2006
Messages:
11,970
Location:
Stuck in the Matrix somewhere in Santa Clara CA
WTF, no Santa? Heresy! Next you'll be promoting the idea of a heliocentric solar system. I'd be willing to bet that you are also a card-carrying member of the Round Earth Society (or do you guys prefer to be known as the Oblate Spheroid Terra Society?).
.

Last edited: Nov 26, 2012
33. ### tennisplayer_85New User

Joined:
Apr 2, 2012
Messages:
37
hey guys, the app will cost 2.99. so if you can afford some tennisballs you should be able to buy this too. i could not make it free, the idea is if i do make some money with it to keep improving the app in future updates.

@BHic: the more people buy this app, the more chance i'll look into android too. I still need to do some more reseach into android though. how many android phones have a camera that can record at 60FPS?

@SystemicAnomaly: I also bought that app to try it and can confirm it did not work at all.

My app isnt perfect yet either but pretty accurate, definitely the best out there. I hope to achieve even better accuracy with some future plans i have using statistic serve data.

34. ### raemuel9323New User

Joined:
Apr 2, 2012
Messages:
52
to bad it isn't available in the uk, i would have bought it asap

35. ### cluckcluckHall of Fame

Joined:
Apr 29, 2010
Messages:
2,389
Location:
Between the baseline and netcord.
Check the site, looks cool. Problem is the instructions...there are none.
Should one stand behind the server? On the receiving end? At the net waiting for the ball to cross?

36. ### SwissXVNew User

Joined:
Oct 26, 2012
Messages:
28
Location:
New York
When I try to view it on iTunes from your website, it says that it is not available in the US. Why is that?

37. ### paul_tennisRookie

Joined:
Jan 27, 2010
Messages:
234
+1

I'm having the same problem...

38. ### cluckcluckHall of Fame

Joined:
Apr 29, 2010
Messages:
2,389
Location:
Between the baseline and netcord.
+1....says not available in US.

39. ### AvlesHall of Fame

Joined:
Oct 14, 2009
Messages:
1,519
Location:
The Peak of Good Living
Couple comments on your site, since the app doesn't seem to be available yet.

Your Info page says "more than 500 people up-voted this app at the Tennis Warehouse community." Does this mean that 500 people expressed interest in the app on your poll? If so, your page is misleading, because it implies that the Tennis Warehouse community has actually tried out your app.

Also, you have a tennis ball graphic and a little video graphic on the homepage that lead right back to the homepage. Not so good to have links to nowhere.

Also, I hope you'll eventually reveal the secret algorithm you use for calculating serve speed-- seems a little questionable to ask people to pay money for a tool which relies on calculations that are kept hidden. Just curious, how have you verified that your app is accurate?

40. ### AvlesHall of Fame

Joined:
Oct 14, 2009
Messages:
1,519
Location:
The Peak of Good Living
One other thing.

If the numbers in your example screenshot are actually from the app, it looks to me like you are calculating the average speed between when the ball leaves the racquet and when it hits the ground, rather than estimating the initial speed of the ball when it leaves the racquet. Is that true?

If so, you should keep in mind that pro radar guns don't measure average speed-- they measure speed coming off the racquet (as mentioned further up in the thread). So your app will read considerably slower than a pro gun.

Last edited: Nov 30, 2012
41. ### Chas TennisHall of Fame

Joined:
Feb 17, 2011
Messages:
4,807
Location:
Baltimore, MD
Was there a poll?

Searching "poll" yields many finds.

Not sure if the word 'Poll" is inserted in the thread title by the TW software or the thread originator writes it. ?

Last edited: Dec 1, 2012
42. ### AvlesHall of Fame

Joined:
Oct 14, 2009
Messages:
1,519
Location:
The Peak of Good Living
The link in the original post in the thread used to lead to a poll which said "would you be interested in an app to measure serve speed?" (yes or no)

I'm guessing the reference to "500 up-votes" means that 500 people voted yes on that poll. Not quite the same thing as giving a good review to this particular app, which is what the website implies.

43. ### tennisplayer_85New User

Joined:
Apr 2, 2012
Messages:
37
hey guys,

I had some time to make a website promoting the App and since i committed the App already i took the poll offline.
I of course should have put a 'SOON AVAILABLE' sign on the website right away since the App is still under review by apple. Please bear with me till its available.

The reference to the 500 up-votes (actually 750, wrote the text when it was still 500) might have been slightly misleading. It was not my intention and changed it to “The idea for this App originated from the Tennis Warehouse Community where more than 750 people up voted for this App to be made.”

As i said, the accuracy is definitely the best out there, but of course I want future updates to improve it. And with your help (buying the App), I shortly hope to make a great update (using the statistical serve data) to make it even more accurate right away.

Although it still needs to be improved it is very reliable and therefore it will help to keep track of your improvements consistently.

I really appreciate all your comments and concerns and believe that together we can make this tool work the way we all want!

44. ### DagsProfessional

Joined:
Aug 29, 2008
Messages:
1,065
This is a bold claim. Are you willing to share your methodology (in the same way Sten did a couple of pages back)? And how you calibrate the app to validate the accuracy?

As others have mentioned, a demo video of the device in use would be very interesting whilst we wait for release.

45. ### spacediverHall of Fame

Joined:
Sep 21, 2009
Messages:
1,871
Location:
Have you got empirical data on how your app compares to a gold standard measurement?

46. ### tennisplayer_85New User

Joined:
Apr 2, 2012
Messages:
37
I am happy to inform you all that the ServeSpeed App got accepted and is AVAILABLE!

Here's the link that should take you straight to it:
https://itunes.apple.com/us/app/servespeed/id581908085

If you sign up within the App you automatically get send a video that gives you the best tips to measure your serve as accurate as possible.

I am still working on a demo video. I'll let you know as soon as i have it.

About the empirical data question. Currently the App calculates the the speed from when the ball gets hit 'till its landing location. plans are to calculate the initial serve speed in a near update using empirical data.

if you like the App i would really appreciate some positive ratings in the App Store.
if you have something negative to say please email it to me and i'll do my best to come with updates. Hold in mind that this is only version 1.0

47. ### rk960925New User

Joined:
Apr 28, 2012
Messages:
27
wait isnt this simply a labpro??

48. ### rk960925New User

Joined:
Apr 28, 2012
Messages:
27
no offense, tho.
The design looks great

49. ### tennisplayer_85New User

Joined:
Apr 2, 2012
Messages:
37
Thanks to some of you that bought the app already!
it would be cool if you can give a positive rating at least i havent seen anything negative yet so that hopefully means you are happy with it.

if you are looking for an original gift for your tennisfriends these upcoming holidays you might wanna consider this app just wanna mention that in the app store its possible to select this app as a gift.

sorry to spam you guys with this promo message, but it might be usefull to some of you.

50. ### Chas TennisHall of Fame

Joined:
Feb 17, 2011
Messages:
4,807
Location:
Baltimore, MD
Error Analysis

How are you estimating the serve velocity accuracy? How accurate is the serve velocity?

My error analysis is a little rusty -

Usually a measuring instrument has a reproducibility error and a systematic error. I'm not sure how to add the conditions under which the measurement is made, camera to ball distance, etc.......?

For the reproducibility error -
How reproducible is the measurement when the instrument measures identical serve velocities? +/-1% or +/-10% etc.

For the systematic error -
Does the instrument have a systematic error whereby it measures all serve velocities with a bias, for example, all are 10% high. This might vary depending on the conditions, distance from the camera to the serve, etc. ?

As an example, suppose that you have a ruler that is supposed to be 12" long but it is really only 11" long. You might reproducibly record lengths to +/- <0.3 % or +/- <0.036". But because your ruler is too short a correction has to be applied.

Last edited: Dec 11, 2012