Motion Graphics by Jeremy Clark

Posts tagged “Compositing

Planar Tracking – Mocha Workflows: Part 3

This is my final post about Mocha for a while, I promise. I feel that after honing these skills I’ll have a decent enough grasp on Mocha and Planar tracking to use it freely within my own projects.

Anyways, the following explains my methods for countering two more situations that can make Planar tracking within a shot difficult – both are based around the tracked plane leaving and entering the shot.

Fortunately, Mocha includes several visual aids that can help allign a surface even when it out of shot. (Either partially or even fully.)

Situation 1: Our Tracked Plane Partially Leaves Frame

1.) First, I moved to a point in the footage where the entire plane I wished to track is in Shot. In the case of the first example this was fortunately the first frame.

2.) Next I drew out a spline and carried out the initial track. On the frame where I began the track I then switched on “Surface” and positioned corner pins over corners of the plane. Under “Layer Properties” in Mocha I selected the checker surface pattern. This is a great way to check for distortion.

3.) Next, I switched on Mocha’s “Grid” overlay. (Via the “View Options” panel). The pink overlay grid’s position is relative to the blue “Surface” corner pins.

4.) I positioned the Blue corner pins so that the pink grid was lined up with the edges of my plane. The surface corner points no longer matched the corners of my surface as a result but that’s okay. The pink grid lines form an excellent reference for perspective within the shot.

5.) After playing back the sequence I identified areas where distortion was occurring and found the last frame prior to this where the grid was still alligned with my plane.

6.) I switched on “Adjust Track”, and position my 4 red corner markers on top of the 4 corners of my plane. This created a master frame for my following Adjust Track keyframes.

7.) Next I selected the point in my footage where movement out of frame was at it greatest. Using the pink grid lines and checkered surface patterns as a guide, I positioned the 4 red “adjust Track” markers so that the grid lined up with my surface plane, and that the squares on the checkered surface remained constant with my original reference frame.  An adjust track keyframe was then set.

8.) I moved forward in my footage until  all 4 corners of my plane are back in shot. Here I re-aligned once again, with all four red markers placed once again on top of the corners of my plane.  I set another “Adjust Track” key.

9.) I repeated steps 5-9 every time some of my corner pins left my shot. (Only twice in this example.)

Situation 2: Our Tracked Plane Begins outside the shot, or completely leaves the frame.

This was simple enough to work around:

1.) Instead of tracking the plane from the beginning of the footage, I rather moved along the timeline until I found a point when the plane I wished to track was completely in shot.

2.) I drew a spline around my plane, lined up my surface corners, then tracked first backwards, then forwards from this point.

3.) As my plane was to move in and out of my shot multiple times, I decided to set keyframes for the shape of my spline, each time at a position where my plane was nicely centred in my shot. This was done by moving the spline points into place and hitting “Add Key” under mocha’s “Keyframe Control” panel. Thus my spline had a shape to return to after leaving shot.

4.) With Splines and tracking in place, I enable my checkered surface pattern and my pink overlay grid and alligned them as I did in the previous example.

5.) Finally, I used “Adjust Track” to minimize drift, by adding keyframes just before, during, and shortly after my plane exited the shot.

Check out the following video for the two workflows highlighted above:


Workflows to help conquer difficult tracks in Mocha

Continuing on with my learning up on Planar tracking and Mocha, I’ve come across two factors thta can adversely effect a track. Namely reflective surfaces and drifting. Good news though, for I quickly learnt some techniques to minize such things! Please… read on…

Surface Reflections Throwing of a Track

For a reflective sufrace, use a Cutout exclude refletcive area from the Planar Track. Check out the following images for a brief explaination.

This slideshow requires JavaScript.

Fixing Drifting Throughout Your Track Using “Adjust Track” Mode

Often times a track will drift off target as it moves through the shot. In this case you can use Mocha’s “Adjust Track” feature to nudge the track back on target.

My workflow for doing this is as follows:

1.) Identify the last frame in which your tracked surface is undistorted. (Without any drifting)

2.) Make sure that the “Surface” cornder pins are in place to specify the surface you wish to insert/replace.

3.) Click to enable Mocha’s “Adjust Track” feature. Mocha will then generate 4 red ‘X’s, one at each Surface corner pin. Position these new markers over 4 easily identifyable features on you footage (High contrast areas work best). These 4 red X’s will form the reference points from which mocha will then base your future adjustment tweaks/keyframes to. The offset between the reference markers and the blue Surface corner pins will be maintained – the general procedure is to keyframe animate the position of the red markers, to bump the track in the right direction.

There should also be a keyframe marked on your timeline , this is referred to as the “master frame”.

4.) On your timeline move to where distortion / drift is at it’s worst, and reposition the 4 red markers so they are accurately positioned ontop of what you placed them on top of in step #3. (On top of the same object that they were in the “Master Frame”.

5.) “In-between animate the sections where drift still remains – eventually drift will be minimized!

Check out the following video for a summary of the two planar tracking techniques I’ve described above.

Stay tuned for more!

Experimenting with Planar Tracking

Another skill which I have set out to learn this year is compositing virtual elements into live action sequences.This technique can be referred to as “Tracking”, “Match Moving”, and “Planar Tracking”.

First off, I wanted to learn how to master planar tracking.

“Planar Tracking” is a fairly new technology and gains it’s name from how the system analyzes the source video – It seeks out different ‘planes’, isolating surfaces that can be followed through a shot. The user can define a plane for the computer to follow, and if tracked successfully, the movement of the ‘tracked’ object can be used to drive the motion of newly composited elements, or inverseley to stabilize footage within a frame.

A powerful Planar Tracking program is Mocha, by Imagineer Systems. Once tracking information is derrived from a videoclip within Mocha, it can be used in After Effects to animate the motion of any composited layer. Virtual elements  can use this tracking information to control what is essentially a camera move that mimics that of the original shot, so that the virtual and live action elements appear to have been shot by the same camera.

My Planar Tracking Workflow took this shape:

1. Live action footage was shot with my digital camera and imported  into Mocha as an image sequence.

2. Using “X-Splines” I defined the rough shape of the plane I wanted to be tracked. In this example i used 5 splines, as despite being a square object, 5 points would form a shape that would better describe the movement of the plane throughout the entire shot.

3.  With “Splines” in place I then had to set “Corner Pins”. I only set 4 of these, one in each corner of the square plane I was tracking.

4. With these in place I set Mocha to “Track Forward” from a point in the centre of my footage. With this track completed, I returned to the same point and set Mocha to “Track Backwards”. This centre point that I speak of need not strictly be at the centre the timeline, but rather a point throighout the footage when the plane you want to track is at it’s most flat with the camera.

5. WIth the footage succesfully tracked I then clicked to “Export Tracking Data” from Mocha.

6. In After Effects I opened a new composition that matched the dimensions of my original footage. It’s really important to make sure that Clip Dimensions, Pixel Aspect Ratio and Frame Rate are all the same between your Mocha Track and you After Effects project.

7. I placed my original raw footage (From my digital camera) onto one layer in After Effects, then created a new layer, which would include the elements I wished to “Track” into the shot. In the case of this example I opted for a Text layer.

8. With the tracking information copied to my clipboard from Mocha’s “Export Tracking Data” window, I then simply highlighted my new text layer and “Pasted” the information, making sure that the timeline was set to the beginning of my After Effetcs comp.

And that was it! My new text (virtual object ) now appeared to move with my original (live action) footage. Check out my video above for examples of how this process unfolded. From here I hope to further experiment with this technique, and then eventually move into placing 3D object into a live action scenes through a technique which is referred to as “Match Moving”. Stay tuned, folks!