Four-point tracking is traditionally used to match the perspective of one shot and apply it to anotherfor instance, tracking the four corners of a sign and replacing it with a new billboard. In this example, you will track a television screen and insert an image inside it. For this exercise, you will use Stabilize instead of MatchMove. This has several advantages: More flexibility in what extra nodes you can apply, because you separate the composite out of MatchMove. Better control over the transform concatenation of the foreground. Better control over the premultiplication of the foreground. Accurate pass-through of onscreen controls. Intuitive control of foreground positioning. Workflow for Match-Moving with Stabilize Here is the workflow for match-moving with a Stabilize node: Attach Stabilize to the node you are going to be tracking and generate your tracksin this example, the TV. Extract the Stabilize node (select it and press the E key), and reattach it to the image you want to transformin this example, the skier. Turn on the transformation with applyTransform and change Stabilize to match. Composite the Stabilize node over the background with an Over node. Insert a Viewport node above the Stabilize node to adjust the frame around what you want to track. Insert a CornerPin between the Viewport node and the Stabilize node. This is used to match the foreground clip's perspective and size to the background image. Viewing the Elements OK, let's see what we're about to create. 1. | Choose File > New Script and click No when prompted whether to save.
| 2. | FileIn the tv_comp.1-70.iff, tv.1-70.iff, and ski_powder.1-70.iff clips from the Lesson07 folder.
| 3. | Set the Globals timeRange and Time Bar to 1-70.
| 4. | Make a flipbook of the tv_comp clip.
A four-point track was used to match the perspective of the TV screen and to place the skier inside.
| 5. | Make a flipbook of your two sequences: tv and ski_powder.
The TV screen clip has four points on it, obviously placed by a visual effects supervisor who cares. This will make tracking relatively painless. The skier clip is a great action shot that will be used for the foreground insert.
| 6. | Close your flipbooks.
| Track the TV Screen Start by tracking the TV screen with a Stabilize node. 1. | Highlight the tv clip and select a Stabilize node from the Transform tab.
At frame 1 of the sequence, you will place four tracks starting at the lower-left corner and moving counterclockwise.
| 2. | Go to frame 1 of the sequence.
| 3. | Place track1 over the lower-left + of the TV screen.
| 4. | Set the subPixelResolution to 1/256.
Because you need to make sure the elements fit together seamlessly, a more precise setting than 1/64 is used.
| 5. | Turn on the visibility for track2 through track4 at the bottom of the Parameters workspace.
| 6. | Place track2 on the lower-right +, track3 on the upper-right +, and track4 on the upper-left +.
| 7. | Turn on limitProcessing, which will make the tracking analysis go faster.
| 8. | Click the forward tracking button.
Because limitProcessing is active, the screen turns black except for the area around the four tracks.
| Creating the Composite Since the TV was shot as a blue screen, you would think that a matte process would be used to composite the skier into the TV. Normally, you would use what is known as a keyer to cut out the blue portion of the screen and replace it with a different image. In this case, the blue screen blows, and you would put yourself into a spot of bother if you tried using one. Second, the keying lesson is later in this book, and that would require my changing the order of my lessons, and that would put me into a spot of bother. So when you have a blue screen that won't key, it is best to use a rotoshape. 1. | Go back to frame 1.
| 2. | Add a RotoShape node from the Image tab.
| 3. | Click the left side of the tv clip to view it.
| 4. | Set the Res parameters in the RotoShape node to 720x308.
This sets the resolution to match the TV.
| 5. | Draw a shape just inside the perimeter of the TV screen.
The blue spill around the edges of the screen will eventually need to be removed. Now is as good a time as any.
| 6. | Double-click the tv clip and select HueCurves from the Color tab.
HueCurves allows you to perform various color corrections on isolated hues through the use of the Curve Editor. Typically, this tool is used for spill suppression.
| 7. | Find the hue of the area you want to color-correct by using the Color Picker. Click the Color Picker tab in the Node View.
| 8. | Drag over the blue color in the TV screen to sample the color.
| 9. | In the Color Picker, scroll down and expand the Values parameter.
| 10. | Note that the Hue value is 0.62.
You will use this value when suppressing the blue in the HueCurves.
| 11. | Expand the Parameters workspace so that you can see the HueCurve parameters and the Curve Editor.
| 12. | Drag the vertical scroll bar to the right of the parameters until you can see bSuppress.
| 13. | Activate bSuppress.
| 14. | Drag the knot nearest 0.6 in the Curve Editor down as close as possible to 0.
The saturation is decreased in that particular hue, turning the pure blues to gray.
| 15. | At the bottom of the Curve Editor, change Key to 0.62, the value you sampled in the Color Picker, and Value to 0.
The blue spill is gone, and you now have the necessary elements to create the composite using a KeyMix function. More on KeyMix in a moment.
| 16. | Switch from the Color Picker tab to the Node View tab.
| 17. | With the pointer over the Node workspace, select the Stabilize1 node and press the E key to extract it.
| 18. | Connect the ski_powder clip to the Stabilize1 node.
| 19. | Highlight the HueCurves1 node and select a KeyMix node from the Layer tab.
The KeyMix function mixes two images together through the specified channel of a third image. The order of connection from left to right is background, foreground, and key or matte.
| 20. | Connect Stabilize1 to the middle input, and connect RotoShape1 to the right input.
| 21. | Set KeyMix1's clipMode to Foreground so that the resolution of the composite matches that of the tv clip.
| Applying the Tracking Data The skier is composited into the TV screen, but the tracking data needs to be activated in the Stabilize node. 1. | Click the right side of Stabilize1 to edit its parameters.
| 2. | In Stabilize1, set applyTransform to Active, set inverseTransform to Match, and select 4 pt for the trackType.
| 3. | Drag through the Time Bar.
What is wrong with this picture? To start, the shape that you drew doesn't follow the motion of the TV. The rotoshape needs the tracking data applied to it as well. In addition, the skier's size and position are wrong.
| 4. | Highlight the RotoShape1 node and select another Stabilize node from the Transform tab.
| 5. | Turn on the visibility for track2 through track4 at the bottom of the Parameters workspace.
| 6. | Right-click track1 and choose Load Track.
| 7. | In the Select Track window, choose Stabilize1.track1 from the pop-up menu, and then click OK.
Stabilize1.track1 is loaded into Stabilize2.track1.
| 8. | Using the same method, load Stabilize1.track2-4 into Stabilize2.track2-4.
| 9. | Make applyTransform active, set inverseTransform to Match, and select 4 pt for the trackType.
Note For those of you using the full version of Shake, you could have just copied and pasted the Stabilize1 node using Command-C and Command-V. The trial version included with this book does not allow you to copy and paste, hence the hoops you must jump through. To position and size the skier, you will use a Viewport node and a CornerPin node.
| 10. | Go back to frame 1.
| 11. | Highlight the ski_powder clip and select a Viewport node from the Transform tab.
Viewport is like a crop, but it keeps the image information outside the frame so that you can do transformations afterward. Using a Viewport will help you to better place the ski_powder clip in conjunction with the CornerPin node that will be added in a moment.
| 12. | View and edit Viewport1.
| 13. | Adjust the outline of the Viewport1 node so that the crosshairs are in the center of the skier's chest.
| 14. | Add a CornerPin node after Viewport1, and click the left side of KeyMix1 to view the composite.
| 15. | Place the four corners of the CornerPin around the screen to form a rectangle, using the horizontal and vertical lines outside the TV screen to guide you. Changing the points in the Viewer will change the x0, y0 through x3, y3 parameter values.
The CornerPin node puts the skier into the same perspective as the TV.
Note Dragging halfway between the points of the CornerPin on the top, bottom, left, and right sides offsets the points but keeps them in proper perspective. | 16. | Click the Flipbook icon to see what you've done so far.
The shot seems to be tracked pretty well. So get ready for the final touches.
| 17. | Close the flipbook when you are finished viewing.
| Treating the Skier The composite is progressing nicely, but the image in the TV could use some scan lines and color correction. 1. | Add a Mult node after Stabilize1.
Color-correct the skier to be a bit darker and bluer.
| 2. | Adjust the R, G, B values so that the image is darker and bluer. I used the following values: R = 0.7, G = 0.8, and B = 1.2.
To add a poor man's version of television scan lines, we'll improvise by subtracting lines created with the Checker node.
| 3. | Click the Checker button on the Image tab.
Checker generates a checkerboard within the width and height of the image.
| 4. | Set the Res parameters to 720x308 to match the resolution of the tv clip.
| 5. | Click the Home button below the Viewer to make sure that you are viewing at a zoom ratio of 1:1.
An odd zoom ratio can affect the appearance of the lines.
| 6. | Change the Size to 100 and 0.
Lines, lines, and more lines...
| 7. | Insert ISub from the Layer tab after Mult1, and connect Checker1 to the right input.
ISub subtracts one image from another and works well to achieve the scan line effect.
| 8. | Click the left side of KeyMix1 to view the composite.
The lines are way too heavy, so let's mix them out a bit.
| 9. | Change the percent setting to 5.
| 10. | Make another flipbook.
To polish this, it would be nice to add some screen reflection around the edges.
| 11. | Close the flipbook.
| Adding Reflection Screen reflection can be added around the edges of the TV by using another rotoshape and an IAdd node. 1. | Click RotoShape on the Image tab and set the Res parameters to 720x308.
| 2. | Click the left side of the tv clip to view it.
| 3. | Go to frame 1 and draw a shape around the outside edge of the screen.
Your shape should look like this:
The tracking data must also be applied to this new RotoShape node.
| 4. | If you have the full version of Shake, copy and paste the Stabilize1 node and connect the RotoShape2 node to it.
If you are using the trial version of Shake, do the following:
- Highlight the RotoShape2 node and select another Stabilize node from the Transform tab.
- Turn on the visibility for track2 through track4 at the bottom of the Parameters workspace.
- Right-click track1 and choose Load Track.
- In the Select Track window, choose Stabilize1.track1 from the pop-up menu and click OK.
- Using the same method, load Stabilize1.track2-4 into Stabilize3.track2-4.
- Make applyTransform active, set inverseTransform to Match, and select 4 pt for the trackType.
To generate the edge matte that is needed to create the reflection, subtract RotoShape1 from RotoShape2.
| 5. | Add an ISub node from the Layer tab after Stabilize3, and connect Stabilize2 to the right input.
This creates an edge matte that is the difference between the two shapes.
| 6. | Select HueCurves1 and add an IAdd node from the Layer tab.
IAdd adds one image to another and will create our reflection.
| 7. | Connect Mult1 to the second input of IAdd1, and connect ISub2 to the Mask input.
Plugging in to the mask input ensures that the reflection will be added only in the areas defined by the edge matte.
| 8. | Click the left side of KeyMix1 to view it, and click the right side of IAdd1 to edit it.
Your tree should look like this:
| 9. | Set the clipMode to Foreground and adjust the slider so that you can see what the IAdd is doing. Set the percentage to 10 when you are done fiddling with it.
| 10. | Make a flipbook.
Now that is how you do a four-point track.
| 11. | Quit Shake.
| |