The Essentials


There's no point in learning about all the cool tricks you can perform with the tracker if you're still fighting it for a good basic track. If you still find your tracks going astray after doing everything according to the After Effects documentation, read on and don't despair. Just because it is automated doesn't mean that you don't have to come to a certain "understanding" with this feature set.

Tracking is a two step process: First, you set up and run the tracker, then you apply the tracking data thus created. Each step contains unique pitfalls. Once you learn to recognize them and take action, however, you can avoid them easily enough.

Choosing a Good Reference Point

There are trackers out there that don't require you to decide what to track (predominantly dedicated third-party 3D trackers, discussed later in this chapter). After Effects, however, relies on you to choose a reference point that will track effectively, and it is the most important choice you will make (Figure 8.1).

Figure 8.1. After Effects tracking is done by setting manual track points in the Layer window.


If your target feature changes or even disappears as the shot progresses, just hang on. Later in the chapter, I'll give you strategies for dealing with this.


Make sure the feature you plan to track

  • Contrasts in color, luminance, or saturation from the surrounding area

  • Has defined edges that fit within the feature region

  • Is identifiable throughout the shot

  • Does not have to contend with similar distinct features within the search region at any point during the track

  • Is close to the area where the tracked object or objects will be added

Be forewarned: The track point is perhaps the most-difficult-to-manipulate user interface item in all of After Effects. Clicking and dragging seems to be a challenge for just about everyone with this tool, so much so that Adobe added a diagram in the version 6.5 documenation (Figure 8.3). But wait! It gets worse: Once you've begun a track, individual track points appear for each tracked frame, adding a slew of extra items to accidentally click and drag. Should you accidentally drag one of these, you will find that Undo does not help you here. My best advice? When moving the feature region (which is usually what you want to do), look for the compass arrow icon to appear before clicking and dragging.

Figure 8.3. As this diagram from the After Effects documentation illustrates, knowing where to click when working with trackers can be elusive. Identified here are: A. Search region, B. Feature region, C. Keyframe marker, D. Attach point, E. Moves search region, F. Moves both regions, G. Moves entire track point, H. Moves attach point, I. Moves entire track point, J. Resizes region. Most useful (and most elusive if zoomed out) is F.



To find a good candidate for tracking, look for "corners" in your imageplaces where two edges meet. If you can get more than one corner into your feature region, so much the better. Figures 8.2a, b, and c show examples of this set of criteria.

Figure 8.2a, b, and c. Here are shown excellent (8.2a), fair (8.2b), and poor (8.2c) candidates for track points. A high-contrast, clearly defined corner, such as that of the painted flag (a) is perfect as long as it stays in shot. The sun glint off the back of the spare tire (b) is also high-contrast with clearly defined edges, but if light conditions in the shot change, the track will no longer work. Although the region in the trees has enough contrast (c), there is way too little distinction between the patterns inside the feature region (the small center box) and the search region (the larger outer box).


Here's something to keep in mind as you set the search and feature regions: They don't have to be square! If the feature you want to track is wide and short, make the feature region wide and short. And if the motion of the shot is only in one directionsay, a left-to-right panthen make the search region not only wider and barely taller than the feature region, but offset it to the right. The search region needs to include only the area where you think the feature region is likely to appear on the very next frameno more, and certainly no less. Be generous when setting this region, but don't give the tracker any reason to search where it has no business looking (Figure 8.4).

Figure 8.4. I happen to know that this shot tracks right to left, so I offset my search region (the outer box) to the left of the feature region (inner box). Customizing the track regions in this manner speeds up the track and reduces the margin of error considerably.


No Good Reference Point in Sight

Sometimes you get lucky, and you find trackable features that are right in the area where the target layer is supposed to appear. It's almost like being able to return to the time and place where the scene was shot and place an object exactly where it was supposed to be.

Other times, however, you may not find very many trackable features of a shot, or your feature may exit the frame at an inconvenient moment (a solution to this is coming in the section called "Continuing a Track with Expressions"). For such cases, you could use an attach point, which is that little x in Figure 8.5. Although the attach point defaults to the center of the feature region, you can offset it anywhere in the frame.

Figure 8.5. You typically have to zoom way in to see your controls. Here the tiny icon to the left shows where the attach point is being moved. This is handy when a better trackable feature is nearby, but not exactly where you want the track point to be.


Later on, however, I'm going to show you how to pretty much ignore the attach point by using nulls and parenting instead, which let you offset this point. This isn't how the documentation would have you do it, but it's much more flexible.

Optimizing Tracker Options

Prior to version 6, the After Effects tracker was tricky to use because the default settings were practically guaranteed not to produce a good track. Life is much better now. Thanks to new defaults, you can just click Play after you set your tracking regions and be assured of a good track.

Nevertheless, defaults will take you only so far. The tracker is packed with plenty of powerful options designed for specific scenarios that, sooner or later, you will encounter. Be prepared by getting to know the tracker's options now.

Typology

It's easy enough to get an idea of the types of tracks available in After Effects: Just have a look at the Track Type menu (Figure 8.6). But what exactly are the differences?

Figure 8.6. The various available track types are accessed via the Tracker Controls palette.


Stabilize and Transform tracking are very similar, until you are ready to apply them. At that point, click Edit Target, and the singular difference between them emerges. Stabilize tracks are always applied to the anchor point of the tracked layer. Transform tracks are applied to the position of a layer other than the tracked layer.

With Stabilize, the animated anchor point, which is the center of the image by default, works in opposition to Position. Increasing the anchor point's X value (assuming Position remains the same, which it does if you adjust the Anchor Point value in the timeline) moves the layer to the left, just as decreasing the Position value does.

Animating only the anchor point gives a certain advantage to Stabilize: For example, if you scale or rotate the layer at a later time, these transforms occur from the corrected (and now consistent) center of the footage. Also, you are free thereafter to edit or even animate the position of the layer without disrupting the tracking data.

As you will see, you can, and quite likely should, use Stabilize, exclusively, even when tracking footage. I'll get to how and why in a moment.

Corner Pin tracking is something else altogetheressentially a cheat to skew a rectangular source so that its four corners appear to be tracked in 3D space. This is not, however, 3D tracking in any sense. Rather than moving the target layer around in 3D, Corner Pin tracking applies data to a 2D layer via the Corner Pin plug-in. Think of replacing a billboard on the side of a moving bus (something you'll look at later in the chapter), and you get the idea.

There are two types of Corner Pin tracking. Both generate four points of data, one for each corner of the target layer, but Parallel Corner Pin does so with only three track points. This works as long your target is perfectly rectangular and remains so throughout the shota shot of a door, head-on, with the camera at a perpendicular angle, for example. In most cases, you will use Perspective Corner Pin (Figure 8.7).

Figure 8.7. The basic Corner Pin setup. Corner Pin tracking is normally applied to a target layer with the same rough dimensions as the source. The results show up in the Corner Pin effect on that layer, which translates its corners to those in the tracked source.


One tricky thing about both types of Corner Pin tracking is that offsetting the track points tends not to work, particularly if there is any variation at all in scale. You pretty much have to track the actual corners of your target, therefore, and leave the keyframe markers right at the center, on those corners (Figure 8.8).

Figure 8.8. Sometimes the corners you want to match don't make good track targets. You can offset them, as shown, but this can lead to trouble, particularly if the camera pushes or zooms in at all, in which case the offset will probably be wrong.


Finally, Raw tracks generate track data only, graying out the Edit Target button. What good is track data that isn't applied anywhere? It can be useful to drive expressions, or you can save it to apply it later. You can derive the same result by simply never clicking Edit Target; you still get the raw track data stored within the source layer (Figure 8.9).

Figure 8.9. Every track generates raw data, whether you specify it as a Raw track or not. The data is stored under Motion Trackers for the tracked layer. As shown, you can rename the full track and individual points for future reference, which is handy on a difficult track for which you attempt multiple passes.


Rotation and Scale

Stabilize and Transform tracks can also include rotation and scale data. This is straightforward enough: You use two track points instead of one. Because of the phenomenon of parallax, you must be sure these two points reside at the same depth in the scene as the item being tracked. In other words, you have to imagine where, in Z space, the object is going and track points that are at that relative depth, or your track will be way off. In such a case no bag of tricksnot offsets, not 3D extrapolationis likely to help.

The big catch about Rotation and Scale is that they essentially never look right when first applied directly to a target layer, because the relationship to the actual layer you are tracking in is arbitrary. After Effects has no way of knowing what the target layer's scale and rotation at any given frame should be, it can only get all the frames consistent with one another once one of them is correct.

So what do you do to correct for this? See the later section called "Using Nulls to Solve Transform Problems."

Another big tip about tracking rotation and scale: The fact that these are changing over time gives you nearly 100% certainty that you will want to go into the Motion Tracker Options palette and check Adapt Feature on Every Frame, which is like restarting the track on each and every frame. This might be a bad idea on a more static track because, theoretically at least, it adds a greater margin of error per frame, but I have often found turning it on delivers much better results.

Finally, perhaps the biggest tip of all: If things aren't going well tracking footage forward, try going to the end of the clip and tracking in reverse. Particularly when tracking an object moving away from the camera, working backward will prove far more effective, especially with Adapt Feature on Every Frame checked (Figure 8.10).

Figure 8.10. For tracking items that become more prominent later in the shot, try reverse tracking. The tracker does a much better job of tracking a large pattern as it gets smaller than the reverse.


Confidence

Below the Adapt Feature check box you'll find a pull-down menu that allows you to work with After Effects' mysterious Confidence settings. Take a closer look at what shows up in the Timeline window after a track has been performed.

Lo and behold, in addition to data about the feature center (the center of the feature region) and the attach point, there is keyframe data labeled Confidence, a new feature as of 6.5. Twirl its arrow to reveal a graph of the confidence values and you may see some surprises (Figure 8.11).

Figure 8.11. Twirl down this graph and you can easily see where the tracker's confidence has been shaken, so to speak. Just because a frame has low confidence doesn't mean there's a problem. This track had confidence values in the "healthy" 80% and 90% region. If you want to more easily see whether any of your values went below 80%, set the lower boundary of the Value graph to 80%


What does this figure mean? It's an algorithm used to extrapolate the relative accuracy of a given track point according to pre-established criteriawhich still doesn't explain much, without some frame as a reference. My experience is that good tracks tend to stay in the 80% to 90% region, and as soon as there is a major problem, confidence drops way off to 30% or less.

You don't have to take a manual approach to checking confidence, however. The feature is designed to be used with a setting in the Motion Tracker Options dialog for what to do according to the Confidence amount (Figure 8.12).

Figure 8.12. This pull-down menu at the bottom of Motion Tracker Options (accessable from the Tracker palette) enables you tell the tracker what to do if the Confidence rating suddenly drops below a certain threshold during the track. A good default setting is 80%. Which setting you choose depends somewhat on your specific situation.


This menu and the Confidence rating that accompanies it open a world of options for those of you wrestling with a wandering track. Adapt Feature below the default of 80% is a pretty good as a default. Look at a healthy motion track, and you'll see most of the confidence numbers are somewhere in the 90s and 80s, with the occasional inexplicable dip.

Other Options

The rest of the options in Motion Tracker Options (Figure 8.13) have to do with examining the footage in a different way. Instead of tracking a clip's luminance (the default), for example, you can track its RGB color values (for unique cases where you have contrasting colors of a similar luminance) or saturation (should you ever track a feature with extraordinarily high and low color saturation but similar color and contrast, something I don't think I've encountered in tracking). Generally, luminance does the trick, provided you can locate trackable areas of strong bright/dark contrast.

Figure 8.13. These tracker options pertain to looking at your footage in different ways.


Tracker Plug-In

So, what's with the mystery pull-down menu with only one choice and an Options button that seems to be permanently grayed out (Figure 8.14)?

Figure 8.14. What do you mean, options? The tantalizing Tracker Plug-in pull-down yields but one choice, and the Options button is in a permanent state of gray. Evidently no third party has, as yet, seen a market for a custom After Effects tracking plug-in.


Adobe considers itself to be in the application business, and where possible it leaves specialized features to third-party developers. Hence, the most powerful color keyers are not the ones made by Adobe. (Although Adobe does bundle the excellent Keylight, the company didn't create it).

Thus, although the development team put quite a lot of effort into refining the built-in tracker, the idea was to open the API for tracking so that one of the many specialists who make software that just does tracking would have the opportunity to embed their own.

Thus far, however, no one seems to have stepped up.


You probably won't need to check Track Fields unless you are working with video footage in which you've decided to leave the fields unseparated. The thing is, as soon as you start seeing your tracks go astray, as a precaution you'll probably go back and separate fields anyhow. Likewise, you can elect to use the Process Before Match options to pre-blur or pre-sharpen (Enhance) your clip, but honestly, it may indicate that your footage needs de-graining or, conversely, is too blurry to track.

In such cases, you might also want to try a third-party automated tracker if you have access to one (see the section "Making Use of 3D Tracking Data").

Fixing Tracks That Go Wrong

The feature you're tracking changes as the shot progresses, and the tracker suddenly jumps to a different, similar feature within the search region. You pounce on the Stop button in the tracker controls (Figure 8.15). But now what? The tracker has probably created a few frames' worth of bad data.

Figure 8.15. Everything was fine until the tail lights suddenly went off, causing the tracks to jump as they tried to find an equivalent shape. You can restart a track at the frame where it went off the rails without having to do anything with the bad frames, other than overwrite their tracks. In this case, I need to find new points with good contrast (perhaps the corners of the trunk) and offset the Attach Point back to the tail light positions.


It's no big deal! Just drag the time needle (in the Layer window) back to the last well-tracked frame and click Play again. In so doing, you have reset the process, so there is a higher likelihood that the tracker will succeed. If not, and the tracker drifts away from the feature multiple times in succession, the next line of defense is Adapt Feature on Every Frame, followed by altering the Confidence options:

  • If the problem was caused by some other object briefly passing in front of the object you're tracking, try the Extrapolate Motion option when confidence is below 80% (or whatever threshold at which your track went wrong, which you can check in the timeline).

    Subpixel Motion

    The key feature the After Effects tracker offers is subpixel positioning. You could never achieve this effect manually, and it can rescue a scene that requires stabilization despite being a locked-off shot in which no object in the scene ever moves even a full pixel. Yes, your eye's ability to detect motion is that good. Look closely at subtle motion in a scene that is almost locked off, and you can actually see motion occurring below the single-pixel level.

    Although it is on by default, you can turn off subpixel positioning from the Motion Tracker Options palette if for some reason you need motion in whole-pixel values. In most cases, disabling subpixel positioning will make your track look strange and crude.

    Do not be fooled as you watch a track in progress, however; the tracker icons themselves move in whole pixel values only. You will see them bounce around as if they're deriving a very crude track! Only after you've seen the result or checked the resulting values to see that they go down to 1/10,000 of a pixel (four places below the decimal point) do you discover that the tracker is, in fact, properly doing its job (Figure 8.16)despite having bounced along like granny in the rumble seat on her first date in the horseless carriage.

    Figure 8.16. Click on a keyframe holding a motion track result, and you'll see that its accuracy extends down four decimal places below the whole-pixel level. This is essential to a realistic-looking track.



  • If the problem was caused by a feature that has changed its shape, color, or luminance, try Adapt Feature in the pull-down menu (as shown back in Figure 8.12) to see if the tracker can pick up the change automatically. Keep in mind, however, that the Adapt Feature option can instead widen the margin of error for features that change too much over time. In such a case, there's no hard and fast rule for what to do other than look for a different feature to track.

  • If there is truly a problem for which neither of these helps, then Stop Tracking is probably your best option. Sometimes manually resetting the track point at certain key moments of failure is worth the trouble.

Stay flexible, be creative about your choice of points, and be ready to bail and start over if things aren't working too well, and you can get a good track with the minimum of hassle.

Using the Timeline

It seems as though the Tracker Controls palette is where all the heavy lifting of tracking is done, but in fact the decisions you make in that palette actually end up residing in the timeline. This has been alluded to several times already, but I want to take a moment to spell it out for you so that you don't get frustrated. Any track that you begin for a layer remains a property of that layer unless you twirl down the layer's properties and then delete it. Otherwise, the track sticks around.

For example, you are simply exploring the various Track Type options and discover that the Corner Pin options give you four track points. You don't want four points, so you switch back to a simple transform but four track points remain, and you can't seem to click in the Layer window to delete them. The Timeline window is the place to search and destroy those unneeded points.

Should you find later on that you need to reapply track data, there's an even easier way to find it than hunting around in the Timeline window. With the comp in question open, go to the Tracker Controls palette (under the Window menu if it's not already revealed) and look in the Motion Source pull-down menu. Layers with no tracks will be grayed out, but the black layers have track data that you can then select using the following menu, Current Track (Figure 8.17).

Figure 8.17. Easily overlooked, the Motion Source pull-down menu is your one-stop location for finding all layers in the timeline containing motion tracks.


Matching Motion Blur

Don't forget about the possibility of motion blur! It's your friend until it's unwanted, and then it's like a malingering houseguestimpossible to ignore. There are two situations in which you would think about motion blur relative to tracking:

  • When you want to add motion blur to foreground layers to match motion in the background plate; you don't have motion blur and you want it.

  • When motion blur already exists in a shot you're trying to stabilize; you have motion blur and you don't want it.

If you have several layers that need to be tracked and motion blurred to match a background plate, the next section, "Optimize Tracking with the 3D Camera," offers a method for automating this process, saving you the trouble of applying your motion track to each added layer.


The solution to the former problem is relatively simple, and the methodology is along the lines of what you did for color matching a few chapters back. Zoom into an area of the image that would be well defined if there were no motion blur on the imagea high-contrast object with well-defined edges, if possible. Now turn on motion blur for your foreground layers, and see if the length of the blur matches. Adjust accordingly, in the Composition Settings window (Ctrl+K/Cmd+K), Advanced Tab (Figure 8.18). To get the setting right, you may have to revisit this window several times in a row, as there is no interactive portion of the timeline that allows you to control motion blur.

Figure 8.18. In case you missed discussion of motion blur earlier in the book, I'll reiterate: This is the one and only place you can adjust motion blur settings for layers that have keyframed motion.


The latter problem, however, implies a nearly impossible situation, that of removing blur from footage that contains it. The truth is, however, that footage that is heavily enough blurred to give away that it has been stabilized is probably going to exhibit other problems when stabilized, such as a large gutter area around the tracked image (Figure 8.19). The best solution is probably to forgo the locked stabilization in favor of smoothing the camera motion but leaving in the move. I'll explain how this works more thoroughly in the section "Smoothing a Moving Camera."

Figure 8.19. The double whammy of stabilization: Not only has the frame leapt sufficiently away from center that it leaves a large gutter in the lower left, but this particular frame of footage contains motion blur. The former problem can be fixed only by scaling and repositioning the shot; for the latter problem, there is, alas, no good solution.


Using Nulls to Solve Transform Problems

Having a problem matching your track to its target? Nulls are the solution. It can be disconcerting to apply a track to a layer and see it repositioned, rotated, or scaled. Luckily, there's a relatively easy fix: Apply the track to a null, then parent the layer to be tracked to the null at a point where it is correctly positioned. Actually, doing this is a good habit with track data in general.

Why? For one thing, you can lock the null once you've applied the tracking data. Locking prevents you from making one of the easiest mistakes you can make with tracked layers: transforming it without having all keyframes selected.

As you'll see in the next section, and again in the next chapter, nulls can be useful for animating the 3D camera. Because the 3D camera does not use anchor points, you cannot apply a motion track, which depends on anchor point controls, directly to a 3D camera. Therefore, parenting a camera to a null is the most sensible and straightforward method for passing data to it from the Tracker.

When Corner Pins miss: The trick of using a null to offset tracks that aren't perfectly placed will not work with Corner Pins because it is an effect, not a transform operation. In such a case, expressions will help you out; see Chapter 10 for details.


If you prefer not to add a null layer, perhaps because it's just one more layer to manage, there is, of course, another solution. You can, instead, use expressions to offset the track the way you want it. If that sounds tempting, check out Chapter 10, "Expressions." For most users, however, nulls are the simplest solution.



Adobe After Effects 6. 5 Studio Techniques
Adobe After Effects 6.5 Studio Techniques
ISBN: 0321316207
EAN: 2147483647
Year: 2006
Pages: 156

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net