Wednesday, 13 April 2011

Post 9 - New Videos

Quick update, today I got some footage of 3 more people. Hopefully this will have eliminated the problem of the shadow on the floor, but it might have the problem of a tree blowing in the wind in the background. Also the first video consists of over 20,000 frames! In comparison, the largest video I previously used was about 3,500 frames. Time to cull some of the useless frames I think!

Friday, 8 April 2011

Post 8 - Adding Metrics

TL:DR - Pictures towards the bottom

For the analysis of the animation, we're going to require a lot more information than just the bounding boxes we currently use. To this end, a few new metrics to analyse have now been added to the project.

First thing to mention though is the increased efficiency. The bounding-box search for each frame was improved by using information from the previous frame, which brought the time down for analysing each frame from ~550ms to the 350-400ms range. However after adding the new metrics, the average time now hovers around the 500ms mark. Never mind, did I mention we have more metrics to measure?!


X-Centroid
The first measure is the x-centroid. After the background has been subtracted, we take each scanline through the image and find the average x-coordinate of the remaining pixels. The average of these averages then provides our x-centroid, which roughly corresponds to the center of the person.


X-Eccentricity
The second measure is the x-eccentricity. This is simply the x-distance between the actual centre of the bounding-box and the x-centroid. This gives a nice measure of how far off to one side the person is. For example, if the person punches/kicks, this will change.


X-Velocity
The third and (currently) final measure is the x-velocity. This is the distance from the x-centroid in the previous frame to the x-centroid in the current frame. So if the person moves from left to right between two frames, we will see a positive x-velocity of some value.

Pictures!
Enough words! Pictures explain it better anyway. (Click to enlarge!)
Red Box: Bounding Box
Vertical Red Line: Half Bounding Box
Vertical Green Line: X-Centroid
Space between vertical red/green: X-Eccentricity
Horizontal Green Line: X-Velociy


Standing Still

Moving Left -> Right

Moving Right-> Left

Crouching


















































Crouching Punch

















Why do we not calculate these for y-coordinates? Well, simply put we're taking a short cut in the fact that vertical movement doesn't happen very much, we're much more interested in x-movement for the time being. They may be added at a later time though.

Next up:
  • Centralising images for the game.
  • Complicated data mining.
  • SOUND! If anyone knows a good java library for sound, let me know! I'm currently investigating jOrbis and paulscode, but other possibilities would be greatly appreciated!
Edit:
Nearly forgot, a system for playing animations in the game has now been added too! Bonus!

Tuesday, 5 April 2011

Post 7 - Menu Screen

Just a quick post, today we have a new menu screen for the game!
Click to enlarge as always.