Tracking 101 – An Introduction to the Discreet Tracker

The discreet motion tracking module, the Stabilizer, is one of the most powerful and versatile tools on the market. Understanding the fundamentals of how it works will prove to be an invaluable addition to your compositing skill set. Though the Stabilizer is available in nearly every module of the software, we are going to focus on how it is used in the Action module. Fire/Smoke artists will find this workflow to be very similar to working in the DVE module.

First, an overview of the Stabilizer. The Stabilizer is accessible from the desktop, or via the myriad of [S] buttons that you will find throughout the software. Tracking data from any Stabilizer module will work in any other module. The core of the Stabilizer is the Tracker.

The Tracker consists of two boxes, a solid box, called REF (reference), and a dashed box, called TRACK. Place the solid REF box over the part of the image that you want the Stabilizer to track, i.e., tracking markers, edges of a window frame, etc. The dashed TRACK box limits the part of the image that the Stabilizer will search when it is looking for your REF, speeding up the process by ignoring a large part of the frame. The dashed TRACK box should always be larger than the RE. How much larger depends on how fast your REF moves from frame to frame. The TRACK box needs to be large enough so that the REF will always be inside of it.

The tracker works best when you choose a reference which stands out from the pixels around it. Areas with higher contrast, or definable edges, work best.

Click on the dot in the middle of the solid REF box and drag it over the part of the image you want to track. As long as they overlap, the REF and TRACK boxes will move together. As you drag, the pixels inside the REF box are magnified for convenience.

After placing the Tracker, click any of the control points on the boxes to resize the REF and TRACK so that they fit accordingly. You will be surprised how often the default sizes work.

Once you are satisfied with the placement of your tracker, click ANALYZE. The Stabilizer will now analyze each frame in the clip, looking for the REF on each frame.

And there you go!

The Stabilizer has drawn a motion path on the screen, showing you where the TRACK box has traveled as it followed the REF over the course of your clip. Each small box on the motion path is a key frame, showing exactly where your REF was found. If you scrub back and forth through the clip, you will see the dashed TRACK box moving along the path. As it passes over a key frame, a large [X] fills the TRACK box. If the TRACK has strayed and is off it’s mark, you can click the [X] and drag the TRACK box back to where it has to be. As you drag, a semi-transparent image of your REF will appear to help you line up the wayward TRACK with its long lost REF.

At this point, you should save your tracking setup. It is always a good idea to save your tracking setups once you have something that is working. You may spend a great deal of time finessing a track. The more time you spend with it, the more likely you are to mess it up! If you have it saved, you can always reload it. Additionally, as your composite progresses, you may find another element or layer that needs the same tracking data. If it is saved, then you can load the setup and apply it to the new layer, as opposed to tracking the new layer all over again.

What To Do With All This Data

OK, so you have just tracked something, but what do you actually have? You have precise information about where something on your screen has moved over the length of your clip. You should always think of tracking data in those terms, as data you can later use in a number of ways. As I have just laid the foundations for a segue, let’s talk about what to do with all of this data.

To illustrate how and why you would use each of the following techniques, I have prepared some samples using footage from an early discreet tutorial. For you trivia types, this footage is from flame 7.6 tutorial lesson 8, warping. It stars one of the many androgynous females featured in this tutorial set, and I have chosen to name her Chris.

Stabilizing

If you have a shot that is unacceptably bouncy, or have an element that is moving through frame that you wish was static, you can track it and stabilize it to remove the motion. To remove motion, use the desktop Stabilizer module. This sample, called stabilize_src, simulates a shot that was filmed on a tripod, but there were people walking too close to the camera, so it shakes from time to time. Click on the desktop Stabilizer button and select this clip to enter the stabilizer.

To fix the shake, place Tracker 1 over a point in the image, such as the little white highlight in Chris’ eye. Now, click Analyze. You now have precise position data for where that point moves over the length of the clip. The desktop Stabilizer module will use that data and apply the inverse to the image. The English translation of this is, if the point you tracked moves one pixel to the left, then the Stabilizer will reposition the entire image one pixel to the right. If on the next frame, the point you tracked moves one pixel up, then the Stabilizer will reposition the entire image one pixel down. Click on RESULT to see, well, the result of what the Stabilizer will do to your image. What you will be left with may seem strange at first. The point you tracked is now locked in place, and you have black edges growing and moving around the perimeter of your frame. This is completely normal. Remember, the Stabilizer repositions your image to compensate for where the point you tracked has moved to. If your point moved 5 pixels to the left, then the Stabilizer repositions your image 5 pixels to the right. When it does this, 5 pixels of black are added to the left side of your frame. In most cases, the presence of moving, growing black edges is unacceptable. Fortunately, the Stabilizer gives you options for how to deal with this.

At the bottom of the screen, you will see a blue pop-up box that tells the Stabilizer how to deal with your tracking data. By default it is set to SHIFT. This is what we have been seeing. The image is shifted to compensate for the movement of your tracker. There are other options in the pop-up: Fit, Fit All, and Roll. We’ll deal with Roll in Tracking 102. Fit and Fit All will blow up or stretch your image so that you never see the black edges. Experiment with both to see which one works best for your image. There is a balancing act here because there is always a loss of image quality when you blow up an image. You can usually get away with a 5%-8% blow up an no one will be the wiser. You have to ask yourself if the affects of the blow up are more or less distracting then the bounce that was there to begin with.

Click APPLY to process this stabilization out to the desktop. Be sure to save your setups!

Tracking

As you might have guessed, you can also use tracker data to track one object to the motion of something in an image. Placing an image on a TV screen, billboard, or moving bus; Retouching a face, changing eye colour, replacing a sky. These are all examples of when you would track something onto something else. Depending on how the element you are trying to track moves through the frame, you may need to use more than one Tracker. Here are the criteria for when you would need more than one Tracker:

  • 1-point Tracking: Returns X & Y coordinate information. Use this if the object you are tracking only moves up and down, and/or left and right.
  • 2-point Tracking: Returns X & Y coordinate information, plus Scale and Z-Rotation. Use this technique if your object also gets bigger or smaller, and/or rotates clockwise or counterclockwise.
  • 4-point Tracking: Also called ‘Corner-Pinning’, use this technique only if your object is changing perspective, i.e., rotating away from, or towards camera. Examples of this are doors swinging, laptop computer screens opening, or products on a turntable.

onepointIn order to shield Chris and her family from her newfound fame, we are going to use the tracker in Action to protect her anonymity. For your convenience, I have also included a stunning frame of blue and a rectangular matte.

Sample 1: 1-Point Tracking

Take a look at the footage titled 1point_src. Notice how Chris is bouncing up and down, as though she were on one of those famous hayrides through the alpaca farms of Saskatchewan. Obviously, a celebrity of her stature would not want to be recognized in a place like that! To begin, enter Action with our frame of blue as the front, 1point_src as the back, and the rectangular matte as the matte (If you don’t see this, you should add an image of layer one).

Go to the schematic view. Before we begin tracking, we will construct what I call the ‘tracking tree’. This technique has worked well over the years. It consists of adding two axes to as parents to the image you are tracking. Label the top axis TRACK and the middle axis OFFSET. This way, your tracking data and it’s offset are separate entities from the image itself, and you have another axis available for tweaking. Remember the golden rule of tracking: “LEAVE IT ALONE!” Adding an additional axis node is basically free — it does not add to render times and tends to be low in net carbs.

Double-click on the TRACK axis. This will both select the TRACK axis and bring up the axis menu. Now, click on the S button at the bottom of the menu to enter the Stabilizer for this axis. This screen should look very familiar. We will only be using one tracker for this example, so if tracker 2 is also active (it will be green) select tracker 2 from the menu and click the active button to the off position. Move tracker 1 (red boxes) over Chris’ screen left eye, and click Analyze. Since this is prepared tutorial footage, it should track with no problems. Once the track is complete, click RETURN to go back to Action.

If you scrub through your comp, you will see that the blue rectangle now has the same movement as Chris. Problem is, it is not lined up with here eyes. (If you do not see Chris moving when you scrub through, go to setup in Action and turn Play Lock off). The reason that the rectangle is not lined up with her eyes is that when you track something in Action, it is centered over the place where tracker 1 was. Since we tracked Chris’ screen left eye, the rectangle is now centered over her eye. This is where our OFFSET axis comes into play. This separate axis lets us reposition our rectangle back to where it needs to be, without adjusting the tracking data.

Go back to frame 1. Make sure that the axis menu is visible in the bottom of frame. Go to the schematic and click on the TRACK axis. Look at the X and Y values. X is -39.15 and Y is 18.5. All we have to do now is put the inverse, or opposite of these values into the OFFSET axis at frame 1. So, click on the OFFSET axis in the schematic, and in the axis menu enter 39.5 for X and -18.5 for Y. This negates the tracking data at frame one, thereby repositioning our rectangle exactly where is has to be. At the same time, we have not touched our perfect tracking data, which is sitting safely on its own axis. Scrub through the comp, and you should see a result worthy of any episode of COPS.

Sample 2: 2-Point Tracking

Take a look at the footage titled 2point_src. Clearly, Chris’ cameraman was suffering a mild stroke during another one of those darn hayrides. Not only is the footage bouncing around, but the camera is rolling counterclockwise and zooming in and out.

This is where a second tracking point would make all the difference. A second tracker allows you to analyze scale and Z-rotation (clockwise/counterclockwise) in addition to X & Y position data. Let’s go back into Action with blue as our front, the new 2point_src as our back, and the rectangular matte as our matte. Once in Action, be sure to go to the setup menu and click RESET ALL.

Go to your schematic, and double-click on the TRACK axis. Next to the Stabilizer [S] button you will see three blue pop-up menus. These tell the Stabilizer and Action what to do with the data from the second tracker, and in this case, we want to use the second tracker to track scale and rotation. By default, they are in the off position. Change them to Scale On and Rot On. Once you have set them, click [S] to enter the stabilizer.

Go to your schematic, and double-click on the TRACK axis. Next to the Stabilizer [S] button you will see three blue pop-up menus. These tell the Stabilizer and Action what to do with the data from the second tracker, and in this case, we want to use the second tracker to track scale and rotation. By default, they are in the off position. Change them to Scale On and Rot On. Once you have set them, click [S] to enter the stabilizer.

Trackers 1 and 2 should be active. If Tracker 2 is not active, please activate it. Using the same technique as in the 1-point tracking example, we need to position both of the trackers on our image. Since Chris’ eye worked so well before, let’s try using both of them.

In a 2-point tracking situation, Tracker 1 must always be on the left and Tracker 2 must always be on the right. In situations where the two points you want to track are right on top of each other, then Tracker 1 must be on top, and Tracker 2 must be on the bottom. The logic behind this is quite simple. Think of the two trackers as points at the end of a line. If Tracker 2 moves away from Tracker 1, then the line must be getting longer, or, scaling up. If Tracker 2 moves closer to Tracker 1, then the line must be getting shorter, or scaling down. Similarly, if Tracker 2 moves below Tracker 1, then the line must be rotating clockwise. And, if Tracker 2 moves above Tracker 1, then the line must be rotating counter clockwise.

While at frame 1 of your clip, position Trackers 1 and 2 and click ANALYZE. Since this is prepared demo footage, it tracked perfectly! Save your tracker setup and click RETURN to go back into Action.

We need to use the same [inverse values in the offset axis] trick. If anyone can think of a catchier name for this, please email me. Once the blue rectangle is lined up, scrub through your comp. Despite the wacky camera move, Chris’ anonymity is protected. Thank Goodness!

Well, that about wraps it up for Tracking 101. Stay tuned for Tracking 102, where we will delve into the exciting world of 4-point tracking, and learn how to fix tracks that don’t go as smoothly as you would like.

 

Submitter: Andy Milkis