

Track a Moving Ball in Real Time using HTML5 and JavaScript - yread
http://css.dzone.com/articles/track-moving-ball-real-time

======
robin_reala
Blogspam. Original is at [http://lusob.com/2012/02/tracking-a-football-match-
with-html...](http://lusob.com/2012/02/tracking-a-football-match-with-
html5-and-javascript/)

------
paulrouget
Looking at the code, it looks familiar. It's based on a demo I built ~3 years
ago:
[http://people.mozilla.com/~prouget/demos/DynamicContentInjec...](http://people.mozilla.com/~prouget/demos/DynamicContentInjection/play.xhtml)

------
andypants
It's tracking based on hardcoded colours. Try this on a video with even the
slightest colour variation, and it will fall apart.

Still pretty cool to see it actually work in the demo though.

~~~
patrickk
_"It's tracking based on hardcoded colours. Try this on a video with even the
slightest colour variation, and it will fall apart."_

How would you improve it? (Serious question.) Some sort of training data set
of many different footballs from many different games? It's easy to offer
criticism without also offering how this could improve.

I personally think this kind of thing could be the future of television -
heavy in-game analysis for sports stat nerds.

At the moment football (i.e. _soccer_ ) teams pay a lot of money to get stats
on their own players[1] (distance ran, passes complete, assists, etc, etc).
This kind of thing could lower the cost of gathering this data. I'm not an
expert in the area, but I read somewhere that at the moment at least some
stats are gathered manually (guy sitting in the stands.) It would be of
particular interest to clubs doing the whole _soccernomics_ thing (idea
adopted from "Moneyball" in US baseball). Some clubs practicing soccernomics:
Liverpool in England and Lyon in France [2]. Could be a serious startup
opportunity here!

[1] <http://www.optasports.com/sports/football.html>

[2] See this book for more: [http://www.amazon.co.uk/Soccernomics-England-
Germany-Austral...](http://www.amazon.co.uk/Soccernomics-England-Germany-
Australia-Destined/dp/1568584253)

~~~
onemoreact
One of the major improvements that human vision includes is predictive
decoding. Basically, how you interpret an immage is based on your model what
you expected that immage to look like.

In the case of football, you might build a model of probable footballs for
each frame then try to connect them frame by frame until you create a
reasonable path and then say ok _that's_ where the actual football is. Then
for each new frame you keep extending that path based on what's in the frame
and how far the ball can reasonably travel.

PS: Classic example, you tend to swap between vase or face, not see them both
at the same time. <http://en.wikipedia.org/wiki/Rubin_vase> Or the more
striking <http://www.michaelbach.de/ot/fcs_hollow-face/index.html>

------
kendroberts
I think this is really cool.

