One-Point Tracking with MatchMove


Shake has three tracking nodes: Tracker, Stabilize, and MatchMove. Tracker is a generic generator of an unlimited number of curves and is useful for passing these curves to the transform nodes. Stabilize removes bounce or jitter from a clip and can generate up to four trackers to be used for positioning, scaling, and rotational stabilizing. MatchMove can track up to four points and apply the tracked motion from one clip to another.

Despite all the demos you love to see, tracking is rarely a magic bullet that works on the first attempt. In the MatchMove exercise, I'll provide you with some strategies to help you get accurate tracks.

View the Clips

It is always best to view the clips that you'll be tracking. It will help you choose the proper feature to track.

1.

Open Shake.

2.

FileIn the building.1-50.iff, building_comp.1-50.iff, and neon_globe.1-50.iff clips from the Lesson07 folder.

3.

Start by setting the Global timeRange to 1-50.

4.

While you're at it, click the Home icon at the bottom right of the screen to make the Time Bar's low and high values match those of the Globals timeRange.

5.

Make a flipbook of building_comp.

The globe was tracked and composited on top of the building.

6.

Make a flipbook of your two elements: building and neon_globe.

You will be motion-tracking the building clip and applying that motion to the neon_globe clip.

7.

Close all your flipbooks when you're done.

Tracking Workflow

Here is your basic tracking workflow:

  • Play through your clip several times to determine a good track point.

  • Attach your tracking MatchMove node to the clip.

  • Make sure the onscreen controls are visible in the Viewer.

  • Go to the frame where you want to start tracking.

  • Position the tracker at the point you want to track, and adjust the reference pattern and the search region.

  • Click either the reverse or forward tracking button.

Positioning the Tracker

By default, the tracker appears in the Viewer. Each tracker has a reference pattern, search region, and track point.

  • Reference pattern The inner box is the reference pattern. It defines a small pattern that the tracker will search for in subsequent frames. It's always a good idea to choose a region with good contrast and detail. A corner with sharp contrast is usually a good area to track, because motion can be detected easily in any direction. The reference pattern can be scaled to the desired size.

  • Search region The outer box is the search region, which should be the maximum amount your track point will move between frames. The larger it is, the slower the tracker is. The search region can be sized in the same fashion as the reference pattern.

  • Track point The crosshairs constitute the track point, which represents the position of the motion track. Normally, the track point is at the center of the tracker, but it can be offset if the reference pattern becomes obscured.

Pick a Good Reference Pattern

The ideal reference pattern is one that doesn't change perspective, scale, or rotation, and does not go offscreen or get obscured by other objects. It also doesn't change overall brightness or color, has a very high contrast, and is distinct from other patterns in the same neighborhood. Meanwhile, in the real world, you have to contend with all of these factors, which will cause your trackers to lose accuracy. A successful composite requires an accurate track.

1.

Make sure that you are positioned at frame 1 of the timeline.

2.

Go to the Transform tab, right-click MatchMove, and choose Create.

3.

Connect the output of the building clip to the right input (background input) of MatchMove1.

4.

Position the tracker over the 12 o'clock position.

You might want to zoom in to allow precise placement of the tracker.

5.

Size the reference pattern so that it has only a few pixels around 12 o'clock.

Pick a Good Search Region

You should position and size your search region to match both the movement and the patterns near your reference pattern. Set it to the maximum amount that your track point will move between frames. The larger it is, the slower the tracker will be.

1.

Size the search region around the outside of the reference pattern.

How do you know if the search region is the right size? If you make the search region too small, the tracker will lose the reference pattern. If it's unnecessarily large, it will take too long to process. The key is to make the search region as small as possible without getting tracking errors.

Track the Image in Its Highest Quality

  • Ideally, you should be tracking an image with the greatest amount of raw data, so make sure both proxyScale and proxyRatio settings are turned off. Once the tracks are done, return to your proxy settings.

  • In some cases, you may in fact want to modify your images to improve contrast in the reference pattern, either with a ContrastLum or ContrastRGB. Since you are just using this image to generate tracks, you are not obliged to keep the contrast-modified image for the rest of your composite.

  • Finally, you may sometimes have problems when random film grain is too severe and your reference pattern becomes useless. To reduce the effects of grain, click the preProcess button in the tracker before you track.

Creating a Tracking Curve

When creating a tracking curve, you'll need to make sure that the trackRange, matchSpace, and subPixelResolution parameters are set properly and that you know how the Track buttons work.

  • trackRange When you create a tracking node, the length of the input clip is automatically fed into the trackRange parameter of the tracker. The tracker will run from the current frame to either the beginning or end of the range, since you can track forward or backward. In this case, the trackRange is 150.

  • matchSpace The tracker works best with a high-contrast reference pattern. The human eye sees contrast as represented by value. However, you may sometimes have an image with higher contrast in saturation or hue. Also, when attempting to track a pattern, pixels are matched according to the correlation between the selected color space: either luminance, hue, or saturation. By default, luminance is selected, and that will work well here because you are tracking an illuminated clock. To switch to a different color space, just click the + next to Tolerances to reveal the matchSpace parameters.

    A shot's contrast may also be higher in one specific RGB channel than in others; for example, the blue channel might have a wider range than the red or green channels. In that case, you could put a Reorder node (from the Color tab) with the channels set to bbb on the image, and then track with luminance as your matchSpace.

  • subPixelResolution The precision (and therefore the time) of your track is determined by subPixelResolution, which by default is 1/64. For this track, 1/64 is fine; for more precise tracks, change the value.

  • Track buttons The Track buttons are located under the Viewer when your tracking node is loaded into the Parameters workspace. The Track buttons start the tracking, going either backward or forward in time from the current frame. For this reason, you generally are positioning the tracker on frame 1 when you start. The tracker will go for the entire time specified in the trackRange parameter.

Track the Building

Enough talking already; it's time for some tracking.

1.

Turn on limitProcessing in the MatchMove1 node.

This will speed up processing. You'll see what I mean in a moment.

2.

Click the forward tracking button.

When limitProcessing is turned on, the screen turns black except for the area enclosed within the search region. This will create a domain of definition (DOD) around the bounding box of all active trackers. Only that portion of the image will be loaded from disk when tracking; therefore, tracking goes more quickly. This has no effect on the final output image.

MatchMove tracks each frame of the building clip and superimposes the tracked points for each frame.

Note

To stop the tracker at any time, press Esc.

Now that you have acquired the tracking data, you can apply it to another clip.

Apply a Tracking Curve

In this case, the default settings in MatchMove for applying the curve are already set the way you want, with the exception of applyTransform. Remember, there are always exceptions. For different types of match-moving, you may want to change some of these settings:

  • trackType Allows you to choose what track type you want, either one-point(panning), which is the default; two-point (panning, scaling, and/or rotation); or four-point (corner-pinning).

  • applyX/applyY For panning, you can select applyX or applyY separately, or you can select both. Both are on by default. applyScale and applyRotate will show up in the menu only if 2 pt is selected.

  • applyTransform The applyTransform function applies the transform needed to stabilize the image. It is inactive by default. You will need to turn it on for this project.

Now let's apply the tracking curve.

1.

Connect the output of the neon_globe node to the foreground or first input of MatchMove1.

2.

In the outputType pop-up box, choose IAdd.

This selects the method by which you will combine the foreground with the background.

3.

Make sure that 1 pt is selected as the trackType.

4.

Turn on applyTransform.

The tracking data is now applied to the neon_globe clip.

5.

Drag the Time Bar to various frames.

The globe's motion is now following the motion of the building clip. It's not in the right position, but it is tracked.

6.

Go to frame 1, highlight the neon_globe clip, and select Move2D from the Transform tab.

7.

Reposition the neon_globe with Move_2D1 so that it rests on the top of the building.

8.

Double-click MatchMove1 and click the Flipbook icon under the Viewer to test the results of your track.

The track looks pretty good, but what if your reference pattern becomes obscured at some point?

Offset Tracking

Sometimes your original reference pattern gets obscured. In those instances, you can offset the search region from the track point. You will simulate this with a new track and the building clip.

1.

Turn off applyTransform so that MatchMove1 is not trying to move the foreground at the same time you are trying to track.

2.

Set the outputType pop-up to Background so that the foreground is not composited with the background.

3.

Scroll down the Parameters workspace, turn off the Visibility of track1, and turn on the Visibility of track2.

4.

Go to frame 50.

Just for fun, you will track track2 backward.

5.

Position track2 over the 6 o'clock position of the clock, and size the reference pattern and search region the way you did for track1.

6.

Click the reverse tracking button and press the Esc key at about frame 25 to stop the track.

7.

Drag the Time Bar to frame 25 if you are not already there.

The track point at frame 25 just became obscured. You're pretending, remember. If you turn on the Offset Track function, the search region and reference pattern can be moved to a new location while keeping the track point in the same location.

  • Offset Track Off The track search region/reference pattern and the track point are linked. If you move one, the other follows.

  • Offset Track On The search region/reference pattern and the track point are offset from each other.

8.

Turn on offset tracking.

Make sure to turn on offset tracking before you move the search region.

9.

Position track2's search region and reference pattern over the 11 o'clock position.

10.

Click the reverse tracking button to continue tracking.

The track point follows the same path, but the new search region is used to acquire the tracking data.

Averaging Tracks

A common technique is to track forward from the first frame to the last, and then create a second track, tracking backward from the last frame to the first. It just so happens that you have already done this. What a coincidence! These two tracks are then averaged together to hopefully derive a more accurate track. Because MatchMove always uses track1 for x-y transformations, you will need to copy track1 to a different track before averaging.

1.

At the bottom of the Parameters workspace, right-click track3 and choose Load Track.

2.

When the Select Track window opens, choose MatchMove1.track1 from the pop-up menu and click OK.

This loads track1 into track3.

3.

Right-click track1 and choose Average Tracks.

A window opens that lets you average up to four input trackers.

4.

Choose MatchMove1.track2 and MatchMove1.track3 from the first two pop-up menus, and leave the last two pop-ups at None. Click OK when you're done.

This creates an expression in both the track1X and track1Y parameters. The expression for the track1X parameter looks like this:

 (MatchMove1.track3X + MatchMove1.track2X) / 2 

You can see the effect of this averaging clearly in the Curve Editor.

5.

Expand the track1Name, track2Name, and track3Name parameter groups, and click the clock icon next to the trackX parameter for each track.

6.

Select the Curve Editor in the tool tabs.

The middle curve represents the averaged track1. Slight differences in the tracks have been averaged, yielding a more accurate result. Let's take a look.

7.

Choose IAdd from the outputType pop-up box.

8.

Turn on applyTransform.

9.

Click the Flipbook icon, and play the clip when it's done loading.

You should have a pretty decent track at this point.




Apple Pro Training Series. Shake 4. Professional Compositing and Visual Effects
Apple Pro Training Series. Shake 4. Professional Compositing and Visual Effects
ISBN: 321256093
EAN: N/A
Year: 2005
Pages: 156

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