runfinder.py - counts catches and links to the start of each run.
When I juggle for 7 ball endurance, I like to turn the camera on and try to juggle 7 balls for about 10 minutes. I capture juggling, but I also capture picking up drops, taking breaks, and drinking water. Reviewing video can be time consuming.
Why not automate?
I wrote runfinder.py. This program watches the video and counts the number of catches in each run. The number of catches and the time the run started are displayed.
This is the 9 minutes 7 ball endurance juggling practice video I analyzed using runfinder.py: https://youtu.be/sm-GxpeuMsA.
This is the output from runfinder.py:
Run number 1 was 14 catches: https://youtu.be/sm-GxpeuMsA?start=12
Run number 2 was 43 catches: https://youtu.be/sm-GxpeuMsA?start=23
Run number 3 was 44 catches: https://youtu.be/sm-GxpeuMsA?start=45
Run number 4 was 31 catches: https://youtu.be/sm-GxpeuMsA?start=88
Run number 5 was 40 catches: https://youtu.be/sm-GxpeuMsA?start=117
Run number 6 was 40 catches: https://youtu.be/sm-GxpeuMsA?start=142
Run number 7 was 27 catches: https://youtu.be/sm-GxpeuMsA?start=212
Run number 8 was 24 catches: https://youtu.be/sm-GxpeuMsA?start=240
Run number 9 was 36 catches: https://youtu.be/sm-GxpeuMsA?start=262
Run number 10 was 43 catches: https://youtu.be/sm-GxpeuMsA?start=282
Run number 11 was 52 catches: https://youtu.be/sm-GxpeuMsA?start=309
Run number 12 was 85 catches: https://youtu.be/sm-GxpeuMsA?start=341
Run number 13 was 34 catches: https://youtu.be/sm-GxpeuMsA?start=403
Run number 14 was 29 catches: https://youtu.be/sm-GxpeuMsA?start=429
Run number 15 was 152 catches: https://youtu.be/sm-GxpeuMsA?start=461
The throw counts are off by only a few throws, if any. Any juggles with fewer than 14 throws (an arbitrary number) aren't considered runs. The accuracy is good enough to find the best few runs out of the video, without having to watch any of it.
Here is a link to the code: https://pastebin.com/WVgjbetY.
Daniel Simu - - Parent #
This is amazing! Not to find your best run in the video, but to quickly acquire a big amount of data!
I always thought 'records' were unreliable data, they say nothing about your 'average'. I'd love to see how my averages differ from day to day, how often I really do qualify, etc.
If we were to create a video database with training videos, we might be able to find some cool data to help improve training! The uses for this are countless!
I'm going to try your program, soon..!
Stephen Meschke - - Parent #
I wrote runfinder.py to collect data.
After a post by Dee, I was reading about inverse gamma distributions. For several days I was preoccupied with whether length of juggling runs is an example of a Poisson distribution or an inverse gamma distribution. I devised an experiment. I found that collecting data would be too time consuming without automation.
Working on this, I realized that personal records are not indicative of general skill. Looking at the statistical distribution of the runs, such as in a histogram, is more valuable training data.
"I realized that personal records are not indicative of general skill"
Are you suggesting a personal best of 175 catches of 7 balls for person A vs a personal best of 10 catches of 7 balls for person B will give no indication of skill level?! Or simply that two people with records of 175 catches may have quite* different averages?
*How different?
Mike Moore - - Parent #
We could find out! Next time we post an endurance record (that's not long enough to be really fatiguing), we could also record the next 10 attempts. I'll do that next time I beat my 7b record.
Stephen Meschke - - Parent #
I was wrong. Personal records are indicative of general skill. This will be easier to understand if you look at the graph I made.
What I should have said: To assess general skill you have to look at more than just personal records. Looking at a histogram (like this one from my 7b endurance practice today) to see the distribution of the number of catches per run is more helpful than looking at the best run of the day.
For example: Looking at the graph above, the best run of the day was 184 catches*, but 17 (out of 36) runs only lasted between 9 and 26 catches. A better juggler may have a best run of <100 catches, but a lot more runs from 60 to 70 catches, giving them a higher average than me.
*I used matplotlib in Python to make that graph using the code plt.plot(plt.hist(runs, bins=10)[0]). From the graph the best run does look like 175, but it was 184 in the data. There is only a single data point in the bin from 166 to 184 catches, and it falls on the extreme right side of the bin.
Personal, to be able to identify distributions; I prefer to use densities rather than histograms for visualisation purposes...
an example comparing and contrasting the two: linky here using data I generated that came from a mixture of a gamma distribution and a poisson distribution...
How histograms look are particularly influenced by what rule you use for deciding how many "bins" to use and where to put the breaks between bins.
Stephen Meschke - - Parent #
Your example was very informative. 38 data points in a single juggling session was quite tiring. Reaching 300 data points (the size of the set in your example) will take some time, but I am very interested to see the resulting density function.
I generated a density function for the 17 minute practice session: https://i.imgur.com/kpk6hI2.png.
Glad to be of help!
Also, think about plotting the run time against how far into the session the run was. This would be interesting to see what the "optimal" practice time for endurance sessions. This is likely to be highly variable per person, so with your automated run detection script, you could then come up with a personalised strategy.
That is great work! I wonder if the guys behind jtv would be able to integrate this into the encoding process?
Stephen Meschke - - Parent #
Integrating juggling ball detection and run counting into the encoding process is possible. Run time was manageable. After optimization, the run time to process the 9 minute video (1.1gigs) was 4 minutes on my AMD Athlon Dual Core 4850e.
noslowerdna - - Parent #
Very cool. Earlier this year I created a video clip catalog system that could be a complimentary tool to this.
Brook Roberts - - Parent #
Awesome. I really hope I actually get round to trying this.
Stephen Meschke - - Parent #
I'll try it for you if you will send me some video.
I took this video in a freshly painted white racquetball court with 2.65" dark blue spherical Russian style juggling balls. I used a Garmin Virb action camera set on 720p60fps Ultra-zoom. Contrast between the background and the juggling balls should be maximized.
The camera was placed on top of a 7.5' door that opened into the racquetball court. I was standing 12 feet from the camera. I am 5' 11" tall.
A setup similar to this is necessary to optimize the video for processing.
Mike Moore - - Parent #
Fantastic! Sounds like a good way of measuring progress. Back when I was learning how to flash 7b, I'd do 40 attempts each day, and record how many were successes...this would have made life much easier.
Owen Greenaway - - Parent #
Thanks for making this. I'll look at it over the weekend :)
Stephen Meschke - - Parent #
To run this program you need to install Python and OpenCV. Both are free, and easy to install in Ubuntu. They are possible to install in Windows and Mac.
Read through this page on the Hough Circle Transform before you look at the program.
Stephen Meschke - - Parent #
Thank you everyone! Your comments and ideas are very helpful.
I made this video to help explain how runfinder.py works: https://youtu.be/Y_g-t9S-2fk.
Subscribe to this forum via RSS
1 article per branch
1 article per post