After Effects tutorial: Remove moving objects from video

How to seamlessly remove a multitude of moving objects from a piece of footage with camera movement.

Intro


In this tutorial, Sri Lankan VFX artist Buwaneka Saranga will teach you how to seamlessly remove a multitude of objects from a moving piece of footage by removing all of the cars from the shot (above and right).

This isn’t like clone stamping an object out and matching the slight camera shake of a static shot – a moving shot has a change in angle and perspective.

The technique used in this tutorial involves camera projection. You may already know how to do a camera projection in After Effects, but for you to be able to do the kind in this particular case, you need to download and install a script called Projection by Ben Rollason.

Achieving the same effect without this script would be very tedious and expression-heavy.

The footage I’m using is an aerial shot of a highway with lots of traffic, and we’re going to learn how to remove all the traffic.

The final shot is to be used in a forthcoming short film by Neumann Films.

Time to complete

2 hours

Software needed

Adobe After Effects CS6 or later, BR_Projection script for Adobe After Effects

Step 1

STEP 1

We’ll be using After Effects CS’s 3D Camera Tracker. If you’re using an older version of AE, you can use third-party matchmoving software such as Pixel Farm etc etc SynthEyes, and then import the tracked camera into After Effects.

Hit Cmd/Ctrl + I to import your footage, and drag it to a new composition. Right- click on your footage layer and select Track Camera.


Step 2

STEP 2

The tracked points will be displayed as coloured crosses.

Advertisement. Article continues below

Step 3

STEP 3

Select a group of crosses and make sure your target (the red circle) looks flat so that it matches up with an existing flat surface of the footage. I selected three points that gives me a target that’s aligning with the highway.


Step 4

STEP 4

Once you’ve selected your points, right-click and select Create Solid and Camera.


Step 5

STEP 5

After Effects ‘solves’ how the camera moves in 3D space and creates a 3D camera from the tracking data. A 3D solid is also created, which is fitted to the selected tracked points.

Advertisement. Article continues below

Step 6

STEP 6

We need to scale and orient the 3D solid so that it lines up with our highway. Hit W to access the Rotate tool, and rotate the solid on every axis until it lines up perfectly. Then hit V to access the Move tool to position it over the surface. 

Apply a Grid effect to have more precision in matching the solid with the underlying highway.


Step 7

STEP 7

Since the camera in my footage moves, the tracked solid gets cut off at the edge of the frame later in the clip – and more detail appears out of the distance. Therefore, before using a camera projection, I needed to pick a frame with the most detail in the distance but where the solid is still visible.

In this case, frame 46 provided the best detail without obscuring the solid.


Step 8

STEP 8

Select Window > BR_projection.jsxbin (assuming you’ve installed it).

Advertisement. Article continues below

Step 9

STEP 9

The Projection script’s UI panel will open. Select your footage layer from the Selected Layer to Project drop-down list, then select the 3D solid on the Timeline and click on the Go button. 


Step 10

STEP 10

Our 3D solid gets pre-composed automatically, and a layer marker is added to show us on which frame the projection was created.


Step 11

STEP 11

Open the pre-comp by double-clicking on it. You’re presented with a distorted image of our highway, which is exactly what we want.

If you want to get nerdy, you could say that technically we should called this ‘undistorted’, because it doesn’t have the perspective distortion caused by the lens – but that’s just being pedantic.

Advertisement. Article continues below

Step 12

STEP 12

Select the Clone Stamp tool (Cmd/Ctrl + B), and double click on the pre-comp. The Layer Viewer opens.

Make sure the Current Time Indicator is at 0 seconds. If not, hit the Home key to get to the beginning of your timeline. Begin to clone stamp out the cars just like you would do in Photoshop.

Hold Cmd/Ctrl and the click and drag left-right to increase or decrease the brush size. Once you let go of Cmd/Ctrl, and drag left-right, you can control the hardness of the brush.


Step 13

STEP 13

Try to clone stamp as much as you can in one go. Each mouse click will create a new Clone Stamp stroke – and the higher the number of strokes, the slower your RAM previews will be. Create too many and eventually your project file will be slower and laggy.


Step 14

STEP 14

As you can see in the screenshot (right), our clone stamped layer is obscuring the bridge beneath it. To overcome this we can either use the Linear Wipe effect or draw a subtractive mask using the Pen tool.

In this case we’ll draw a mask. Give it a feather of 2 pixels.

Advertisement. Article continues below

Step 15

STEP 15

Click on the stopwatch besides Mask Path on the timeline, and move a few frames back and adjust the mask, so the mask will animate in changing frames.


Step 16

STEP 16

Another thing we need to correct for is the distortion that gets introduced due to the nature of the projection.

To fix this broken edge, we’re going to use the Transform effect (Effects > Distort > Transform). Apply it at the layer marker, where the projected layer lines up with the footage, and set key frames on Position and Skew. Move back to the beginning of the timeline and adjust the skew and vertical position until the broken edge matches up. 


Step 17

STEP 17

To fix distortion, the following effects can be used: Transform, Corner Pin, Mesh Warp, Bezier Warp and CC Slant. 

Another cool trick is to apply a Fast Blur effect and blur the projected layer to match the footage when the camera is farther away, but gradually reduce the blur when the camera comes closer. Continue this workflow to remove any object from your footage.

Advertisement. Article continues below