VFX I

38.1 Camera Tracker in Nuke


This guide will walk you through the basic setup of the Camera Tracker in NukeX

 

mm1_convert_write_node_v2

Preparing Footage

If your footage is a video file such as MP4, it’s recommended to convert to image sequence first

Image sequences are reliable, the conversion is fast

mm1_convert_write_prop_full
Write JPEG Sequence

Copy the name of the source footage and add .####.jpg

Set the JPEG quality to 1

Unless you’re dealing with a grainy low-light shot, JPEG is ok for tracking

mm1_project-setting_part_v2

Project Settings

Edit menu > Project Settings or Hotkey S

Before we start, confirm your Project Settings

Size and range follow your footage, frame rate your global project settings


mm1_ct_node_full

Camera Tracker

Add the Camera Tracker node

NukeX required

mm1_ct_prop_main_top_v2b
Tracker Setup

Range: Global is the range of Project Settings
Use Custom if you don’t want to track the entire range

More frames will take longer but often give better results because we get more information

Lens Distortion: Set to Unknown Lens and tick Undistort Input

Film Back Preset: This is important to set correctly. Google Image Sensor Size of your camera, a smartphone camera is just a few millimeters

I shot on Canon 5D MarkIII

mm1_ct_prop_settings_top_v2
Refining Settings

Open the Settings tab

Tick Preview Features

Number of Features: I pushed them up

Detection Threshold: If too many features are in clouds or other areas making little sense, bring the value up and monitor

mm1_ct_prop_track
Track

Hit Track to start tracking, this may take a while

mm1_track_result_450
Track Result

Our result shows enough long tracks

If you expected more or different features, first re-visit the Number of Features and Detection Threshold and track again

Or you could also add UserTracks

mm1_ct_prop_solve_part
Solve

Next, hit Solve to start the camera solving

mm1_solve_result_450
Solve Result

The result shows the track trails indicating length and quality

green (good)
orange (maybe)
red (rejected)

mm1_solve_result_detail_450-crop
Solve Result Detail

Detail information of individual tracks by hovering over one

mm1_solve_result_scene_error
Error Value

Error under 1 is great

Between 1 and 2, I will continue and test closely

Over 2, not good, definitely visit Improving Solve section further below


mm1_solve_result_scene_create

Export Scene+

Tick Link output, Select Scene+ and Create the scene

mm1_scene_default_s_full
3D Scene

We get a basic setup with the 3 nodes every Nuke 3D scene needs: Scene, ScanlineRender and Camera

In addition, we also get: PointCloud and LensDistortion

Camera and LensDistortion are linked to CameraTracker node

mm1_3d_view_450
Navigate the Scene

Connect the Scene node to the Viewer, should automatically switch to 3D view, else use TAB key to toggle or View Selection drop-down

If you’re lost, select Camera, hit hotkey F in viewer

Most important hotkeys are:

MMB (or Alt+LMB): Translate Viewer perspective
Wheel (or Alt+MMB): Zoom Viewer perspective
Ctrl+LMB (or Alt+RMB): Rotate Viewer perspective

List of all Nuke Hotkeys > 3D Viewer


Improving Solve

Adjusting AutoTracks can improve the overall Solve Error value. Based on track length or error values, you can specify which tracks contribute and which should be rejected


mm1_autotracks_prop_1-length_v2
Min Length

Open AutoTracks tab

Check your current Solve Error

Select pair track len – min and Min Length

Use Min Length slider to cut off values, while monitoring result

mm1_autotracks_result_1
Monitor Result

While moving the Min Length slider to cut-off values, the rejected tracks turn red

mm1_autotracks_prop_2-max-track_v3
Max Track Error

Select pair error – rms and Max Track Error

Use Max Track Error slider to cut off values

Again, monitor which tracks turn red and will be rejected

mm1_autotracks_prop_3-maxerror_v2
Max Error

Select pair error – max and Max Error

Use Max Error slider to cut off values

Monitor which tracks turn red

mm1_autotracks_result_2
Monitor Result

A lot of tracks turned red, do we need any of these urgently? Did we cut-off too many?

Shuffle through the clip and double-check that enough green tracks are left at all times

mm1_autotracks_prop_delete-only
Delete Rejected

To trash all red tracks for good, use both Delete Unsolved and Delete Rejected

mm1_autotracks_result_final
Monitor Result

The immediate effect: All red tracks are gone

mm1_autotracks_prop_error-only
Solve Error Value

Check the Solve Error value: Down to 1.22

Hopefully, this helped to improve your track