AUTOMATIC FOOTPLANT DETECTION
inside FlMoView

by
Peter Bodik, Peter.Bodik@st.fmph.uniba.sk
Comenius University, Bratislava, Slovakia

A summer project for Michael Gleicher
June -- August 2000

Why do we need footplant detection?

Given a motion of a character, the problem of footplant detection is to determine when the character has it's feet on the floor. The footplants are extensively used in FlMoView. FlMoView is a software used for retargeting captured motion from an original skeleton to a new one. If we want the new, retargeted motion to look realistically, it has to meet a set of constraints. For instance, if the original character grabbed a glass from a table, the new character (despite being shorter) should also grab the glass. The grabbing of the glass is a constraint that ties the original motion and the new motion together. However, one the most important types of constraints are footplants -- time intervals when the feet of the character are placed on the floor. Had the feet (toes and heels) not been constrained during the footplant, the feet in the retargeted motion would move up and down or "skate" along the floor, instead of being statically placed on the floor. Therefore one has to create footplant constraints for the whole motion, before actually using it for retargeting.

Of course, the footplant constraints could be created manually; you could play the motion over and over and determine the time interval of each footplant (i.e., the set of frames when the foot is on the floor) simply by looking at the character. This is, however, a very tedious process even for short motions. Thus, an automatic way of detecting footplants is needed. 

How to automatically detect footplants?

One of the simplest, yet reliable, ways of detecting footplants is to use the speed of the respective joint. When the foot is statically placed on the floor, the speed of the toe and heel should be zero. However, due to noise in the motion data, the speed of the respective joints will rarely be exactly 0, but will usually stay below 0.05 feet/frame (as experimentally determined). This brings us to the actual algorithm used for automatic footplant detection; first, the speed of the joint is computed in each frame of the motion (the distance traveled during 1 frame). Then, each frame with speed less then some value (0.05 feet/frame used as a default) is marked as having a footplant. This process is done separately for both toes and both heels (or for whatever other joint for which the user wishes to detect contact with ground).

The speed-based detection of footplants is not a 100% method, so the constraints usually have to be adjusted manually. FlMoView now supports an intuitive way of editing the constraints -- you can use mouse to add constraints while watching the motion in the background. A great help in determining the footplant interval is the option of drawing several graphs of the motion and using it as a guidance.

How to use the constraints detection window?

When creating constraints in FlMoView, we actually want to create a script file written in Python. When this script is opened from FlMoView, it will load a motion (bvh) file and set all constraints for that motion. To create the Python script for a new motion (bvh file), follow these steps:

  1. create a blank script file: open a .bvh file from FlMoView, open the Constraints Detection window from Windows menu and click "Save to .py script" button. This will create a "blank" script named cd_motion.py in directory FMV\MotionData\Motions,

  2. make some changes: open the file in a text editor and make necessary changes: change the name of the loaded motion file (motionfile = "..."), add toes or heel by uncommenting a few lines in the file and finally, give the file an appropriate name, 

  3. create constraints: open the .py file from FlMoView (this will also load the motion file) and open the Constraints Detection window; select joints for which you want to create constraints (from the list on the left) and click "speed". This will automatically generate constraints, which you can save to the Python script by clicking the "Save to .py script" button.

A complete list of choices for editing constraints follows (first select the joint you want from the list and then you can do one of the following):

To draw a graph, select a joint and the name of the quantity (you can select multiple joints and quantities). In the graph, the constraints marked as green dots are the original constraints loaded from the Python script and the constraints marked as red dots are the ones you can edit from within the Constraints Detection window.