CameraTracker
CameraTracker (NukeX and Nuke Studio only) is designed to provide an integrated camera tracking or matchmoving tool, allowing you to create a virtual camera whose movement matches that of your original camera. Tracking camera movement in a 2D footage enables you to add virtual 3D objects to your 2D footage.
Inputs and Controls
Connection Type |
Connection Name |
Function |
Input |
Source |
The sequence whose camera movement you want to track. |
Mask |
An optional input to use as a mask. By default, feature tracking is limited to the non-black areas of the mask. The Mask input is hidden until the Source input is connected. |
Control (UI) |
Knob (Scripting) |
Default Value |
Function |
---|---|---|---|
CameraTracker Tab |
|||
Input |
|||
Source |
sourceType |
Sequence |
Sets the type of source footage you intend to track: • Sequence - designed to track a contiguous frame sequence with minimal intervention from you. • Stills - creates a camera track from reference frame stills taken on site. These represent the minimum number of frames required to cover your subject with sufficient overlap. |
Mask |
ignore |
None |
Set the mask type to exclude areas of the sequence when tracking: • None - none of the footage is ignored. • Source Alpha - use the alpha channel of the source clip to define which areas to ignore. • Source Inverted Alpha - use the inverted alpha channel of the source clip to define which areas to ignore. • Mask Luminance - use the luminance of the Mask input to define which areas to ignore. • Mask Inverted Luminance - use the inverted luminance of the Mask input to define which areas to ignore. • Mask Alpha - use the Mask input alpha channel to define which areas to ignore. • Mask Inverted Alpha - use the inverted Mask input alpha channel to define which areas to ignore. |
Range |
trackRange |
Input |
Sets the range of frames processed by CameraTracker: • Input - the default value, sets the frame range to the length of the sequence attached to the Source input. • Global - sets the tracking frame range to the range set in the Project Settings > frame range controls. If no frame range is defined, the frame range of the first image you read in is used as the Global frame range. • Custom - sets a tracking range of frames described by the from and to fields. • Reference Frames - allows you to manually define keyframes in the sequence using the +/- buttons. You can also add keyframes to all frames or a specific frame range using the Add dropdown. This option should only be used if you have set Source to Stills. |
from |
trackStart |
Dependent on the Project Settings |
When Range is set to Custom, this control sets the first frame to track in the footage. |
to |
trackStop |
Dependent on the Project Settings |
When Range is set to Custom, this control sets the last frame to track in the footage. |
Frames |
referenceFrames |
0 |
Displays the reference frames to track and solve. Note: This control is only available when Range is set to Reference Frames. |
addReferenceFrame |
N/A |
Adds the current frame to the set of frames to track and solve. Note: This control is only available when Range is set to Reference Frames. |
|
deleteReferenceFrame |
N/A |
Removes the current frame from the set of frames to track and solve. Note: This control is only available when Range is set to Reference Frames. |
|
Add |
addReference- |
Add |
Allows you to quickly add reference frames: • Add All - Adds all frames based on the input's start and end range. Any missing frames on the input clip are skipped. • Add Range - Opens a dialog that lets you select a specific frame range to add. Note: This control is only available when Range is set to Reference Frames. |
Delete |
deleteReference- |
Delete |
Allows you to quickly remove reference frames: • Delete All - Removes all reference frames. • Delete Range - Opens a dialog that lets you select a specific frame range to remove. Note: This control is only available when Range is set to Reference Frames. |
Camera |
|||
Principal View |
principalView |
left |
Sets the principal view where features are tracked and the Mask input is applied. The secondary camera is calculated relative to this Principal View camera. This control also appears on the Settings tab. Note: Principal View is only displayed if you have set up more than one view in your Project Settings (typically, if you’re working on a stereoscopic project). |
Camera Motion |
cameraMotionLink |
Free Camera |
Sets the type of camera motion to compensate for: • Rotation Only - select this if the camera is stationary, but rotating. • Free Camera - select this if the camera is moving freely, rotating, and translating. • Linear Motion - select this if the camera motion is a straight, linear path. • Planar Motion - select this if the camera has a flat path, moving in a two-dimensional plane only. |
Lens Distortion |
lensDistotionTypeLink |
No Lens Distortion |
Specifies the type of lens distortion expected: • No Lens Distortion - treats the footage as having no distortion. Use this option if the Source footage has already been corrected to remove lens distortion. • Unknown Lens - calculates the lens distortion automatically from the sequence (in the same way as the Image Analysis tab in the LensDistortion node) and then refines the distortion in the camera solve. |
Undistort Input |
undistort |
disabled |
When enabled, the Source is undistorted based on the calculated lens. |
Focal Length |
focalLengthType |
Unknown Constant |
Sets the focal length for the camera: • Known - select this option if the focal length is available and enter a value in the Length control. • Approximate Varying - select this option if an approximate focal length is available and enter keyframed focal length values in the Length control. • Approximate Constant - select this option if an approximate focal length is available and there is no zoom, and enter a focal length value in the Length control. Note: CameraTracker attempts to refine the focal length during the solve if you select an Approximate option. • Unknown Varying - select this option if the focal length is unknown and changing. • Unknown Constant - this is the default option. Use this option if the focal length is unknown and there is no zoom. |
Length |
knownFocalLength |
50 |
Sets the focal length for approximate and known solves. You can animate this control to define a varying focal length. The units are the same as those used for the Film Back Size (mm or inches). |
Film Back Preset |
filmBackSizePresets |
Custom |
Sets the Film Back Size controls automatically, depending on which preset you choose. The default setting allows you to enter your own settings manually. Tip: You can add your own defaults by editing the ../NukeScripts/camerapresets.py file in the Nuke installation package. |
Film Back Size xy |
filmBackSize |
36,24 |
Sets the size of the camera imaging sensor. Specify the units you want to use by selecting either millimeters or inches in the Units dropdown. The units should match the units used for the Length. |
Units |
filmbackUnits |
mm |
Sets the unit of measure for the Film Back Size, either millimeters or inches. |
Analysis |
|||
Track |
trackFeatures |
N/A |
Click to begin auto-tracking using the controls specified in the Settings tab. Track defines a set of 2D feature tracks that correspond to fixed points, or features, in the scene. |
Update Track |
updateTrack |
N/A |
Click to display a frame range dialog, allowing you to retrack part of the sequence, such as when you have extended the frame range or used some of the Settings tab Tracking refinement controls. |
Clear Tracks |
clearTrack |
N/A |
Click to clear all auto-tracking data. A confirmation message needs acknowledging before the action is completed. |
Solve |
solveCamera |
N/A |
Click to begin calculating the solve using the controls specified in the Settings tab. Solve calculates the camera path and projection creating a 3D point for each 2D feature track within a minimum projection error, including auto-tracks, User Tracks, and tracks created from imported Trackers. |
Update Solve |
updateSolve |
N/A |
Click to update the solve calculation, such as when you have extended the frame range or used some of the Settings tab Solving refinement controls. Recalculating the solve is handy when you want to see how good the solve is after you’ve refined it, without permanently deleting tracks. Recalculating the solve also recalculates stereo geometry. |
Clear Solve |
resetSolve |
N/A |
Click to clear all solve data. A confirmation message needs acknowledging before the action is completed. |
Error |
solveRMSE |
N/A |
Displays the RMS (root mean square) error of your solve, in pixels. As a general rule of thumb, if your solve reports an RMS projection rate higher than 1.0 pixel, you may want to consider fine-tuning your solve or tracking data. |
per frame |
solveError |
N/A |
Displays the RMS (root mean square) error of your solve at each frame, in pixels. |
Export |
|||
[export menu] |
exportMenu |
Camera |
Determines how the track and solve data is used when you click Create: • Camera - creates a single animated camera. • Camera rig - creates an animated camera for each view in the script and a JoinViews to node to pass the animation downstream. • Scene - creates a single animated camera, a point cloud from the solved 3D points, and a Scene node. • Scene+ - creates a scene containing all the components included in the other create modes. • Point cloud - creates a point cloud from the solved 3D points. • Distortion - creates a LensDistortion node with Undistort disabled. • Undistortion - creates a LensDistortion node with Undistort enabled. • Cards - creates a 3D card for each solved frame in the sequence. Note: Creating Cards from sequences can take long time, depending on the number of frames present. |
Create |
exportButton |
N/A |
Click to create the option specified in the export dropdown. |
Link output |
linkOutput |
enabled |
When enabled, cameras and points are updated when the solve is updated. If you disable linking, the expression link between the CameraTracker and Camera nodes is disconnected. |
UserTracks Tab |
|||
User Track Views |
userTrackViews |
Dependent on the Project Settings |
You can only set up User Tracks in a maximum of two views. This control allows you to select which views correspond with the left (lx, ly) and right (rx, ry) 2D User Track location columns. This control is only displayed if you have set up more than one view in your Project Settings (typically, if you’re working on a stereoscopic project). |
[user tracks table] |
userTracks |
N/A |
Displays positional information for any User Tracks in the script. |
Add Track |
addUserTrack |
N/A |
Click to add a User Track in the center of the Viewer. |
Delete Tracks |
deleteUserTracks |
N/A |
Click to delete the current selections in the tracks list. |
Autotrack |
autotrackUserTracks |
N/A |
Click to begin auto-tracking the current selections in the tracks list. |
Update XYZ |
updateUserTrackXYZ |
N/A |
Click to recalculate the XYZ coordinates of the current selections in the tracks list. |
Import Tracks |
importUserTracks |
N/A |
Click to import previously exported User Tracks. |
Export Tracks |
exportUserTracks |
N/A |
Click to export the current selections in the tracks list. |
Import Tracker |
importTracker |
N/A |
Click to import track information from a Tracker node within the script. |
Export Tracker |
exportTracker |
N/A |
Click to export the current selections in the tracks list to a Tracker node within the script. |
AutoTracks Tab |
|||
Solve Error |
SolveRMSE |
N/A |
Displays the RMS (root mean square) error of your solve, in pixels. As a general rule of thumb, if your solve reports an RMS projection rate higher than 1.0 pixel, you may want to consider fine-tuning your solve or tracking data. |
per frame |
solveError |
N/A |
Displays the RMS (root mean square) error of your solve at each frame, in pixels. |
Curves View |
curvesView |
Dependent on the Project Settings |
Sets the view for the track curves. This control is only displayed if you have set up more than one view in your Project Settings (typically, if you’re working on a stereoscopic project). |
[track curves] |
trackCurves |
N/A |
Displays the following track and solve information in the form of curves: • num tracks - the number of tracked features at each frame. • track len - min - the minimum length of the tracks at each frame (in frames). • track len - avg - the average length of the tracks at each frame (in frames). • track len - max - the maximum length of the tracks at each frame (in frames). • Min Length - the threshold for minimum track length. You can adjust the minimum using the Min Length control. • Solve Error - displays the constant Solve Error parameter. • error min - the minimum reprojection error at each frame (in pixels). • error rms - the root mean reprojection error at each frame (in pixels). • error track - the maximum root mean reprojection error calculated over the track lifetime at each frame (in pixels). • error max - the maximum reprojection error at each frame (in pixels). • Max Track Error - displays the constant Max RMS Error parameter. You can adjust the maximum using the Max Track Error control. • Max Error - displays the Max Error threshold parameter. You can adjust the maximum using the Max Error control. |
Min Length |
minLengthThreshold |
0 |
Redefines your thresholds if you find your solve or camera output needs adjusting: • Min Length - increase the minimum length threshold to reject short tracks. You might find a lot of short tracks cropping up in long sequences with a slow camera movement. • Max Track Error - reduce this threshold to reject tracks based on RMS reprojection error. • Max Error - reduce this threshold to reject tracks with a large reprojection error in isolated frames. Note: Feature tracks that fall within the threshold limits are called inliers, and are used when you recalculate a solve instead of starting from scratch. |
Max Track Error |
maxRMSEThreshold |
0 |
|
Max Error |
maxErrorThreshold |
0 |
|
Refinement |
|||
Refine Solve |
refineSolve |
N/A |
Click to attempt to refine the solve calculation using the methods outlined in the Focal Length, Position, and Rotation controls. |
Focal Length |
refineOptions |
disabled |
When enabled, clicking Refine Solve causes CameraTracker to finess the solve calculation using an updated Focal Length. |
Position |
refineOptions |
disabled |
When enabled, clicking Refine Solve causes CameraTracker to finess the solve calculation using an updated camera position. |
Rotation |
refineOptions |
disabled |
When enabled, clicking Refine Solve causes CameraTracker to finess the solve calculation using an updated camera orientation. |
Delete Unsolved |
deleteInvalidTracks |
N/A |
Click to permanently delete tracks for which 3D points could not be calculated in the solve. |
Delete Rejected |
deleteRejectedTracks |
N/A |
Click to delete any tracks rejected by the threshold controls. |
Delete Auto-tracks |
deleteAutoTracks |
N/A |
Click to delete all auto-tracks from the script, while retaining User Track and solve data. You can use this button to reduce the size of the script once you're happy with the solve. |
Settings Tab |
|||
Features |
|||
Number of Features |
numberFeatures |
150 |
Sets the number of features to track in each frame - ideally you should use more than 100 tracks per frame. |
Detection Threshold |
featureThreshold |
0.1 |
Sets the distribution of features over the input image. Low values track features evenly on all parts of the image. |
Feature Separation |
featureSpearation |
12 |
Sets the distribution of features in relation to each other. High values spread features at even distances over the image. |
Refine Feature Locations |
refineFeatures |
disabled |
When enabled, lock detected features to local corners. CameraTracker finds the closest corner point in your footage and locks feature points to them. |
Preview Features |
previewFeatures |
disabled |
When enabled, preview the potential features available for tracking. This allows you to check that the features cover the image. If not, tweak the tracking controls before tracking. |
Tracking |
|||
Minimum Length |
minTrackLength |
3 |
Sets a threshold value for the minimum track length to reject short tracks. You might find a lot of short tracks cropping up in long sequences with a slow camera movement. |
Track Threshold |
matchThreshold |
0.69999999 |
Controls how similar features look over a number of frames. You can adjust this value to test whether a track is reliable. |
Track Smoothness |
smoothnessThreshold |
0.1 |
Sets the threshold for smooth track generation. Adjusting this value can be useful in preventing poor tracks in complex sequences. Increase the smoothness value to remove tracks that glitch over time. |
Track Consistency |
consistencyThreshold |
0 |
Sets the threshold for consistent track generation. Increase this value to ensure track motion is locally consistent. Adjust consistency to prevent poor tracks in complex sequences. |
Solving |
|||
Principal View |
principalView |
left |
Sets the principal view where features are tracked and the Mask input is applied. The secondary camera is calculated relative to this Principal View camera. This control also appears on the CameraTracker tab. Note: Principal View is only displayed if you have set up more than one view in your Project Settings (typically, if you’re working on a stereoscopic project). |
Camera Motion |
cameraMotion |
Free Camera |
Sets the type of camera motion to compensate for: • Rotation Only - select this if the camera is stationary, but rotating. • Free Camera - select this if the camera is moving freely, rotating, and translating. • Linear Motion - select this if the camera motion is a straight, linear path. • Planar Motion - select this if the camera has a flat path, moving in a two-dimensional plane only. |
Keyframe Spacing |
keyFrameSeparation |
0.30000001 |
Controls the separation between keyframes. Use a high separation to spread keyframes out in long sequences with small camera movements. Use a low separation to generate more keyframes for fast camera moves. |
Smoothness |
motionSmoothness |
0 |
Adjusts the smoothness of your camera path. Increase this value to add weighting to the camera path and create a smoother result. |
Reference Frame |
rootReferenceFrame |
0 |
When Set reference frame is enabled, specifies the first frame to use as a keyframe in the solve. This should be a frame where there is a large number of tracks distributed over the image with a good variation in depth. |
Set reference frame |
setRootFrame |
disabled |
When enabled, use the Reference Frame field to manually define how keyframes are specified in the sequence. This can be useful if you have a difficult sequence to solve. |
Stereo (These controls are only displayed if you have set up more than one view in your Project Settings, typically when working on a stereoscopic projects.) |
|||
Aligned Stereo Cameras |
alignSecondary |
enabled |
When enabled, the solve aligns secondary cameras to the principal camera position. |
Constant Interaxial Distance |
constantInterAxial |
enabled |
When enabled, a constant interaxial distance is maintained between views. |
Interaxial Distance |
interAxialDistance |
1 |
Sets a known interaxial distance for stereo views to define the scene scale. This control is only displayed if you have set up more than one view in your Project Settings (typically, if you’re working on a stereoscopic project). |
Constant Interaxial Covergence |
constantInterAxial |
enabled |
When enabled, a constant interaxial convergence is maintained between views. |
Display |
|||
Show tracks |
displayTracks |
enabled |
When enabled, the individual tracks generated during analysis are displayed in the Viewer. |
Show projected 3D point |
displayReprojected |
enabled |
When enabled, circular highlights are displayed around the reprojected points in the 2D Viewer. Hover over points to display track length and reprojection error information. |
Show key tracks only |
keyframePointsOnly |
disabled |
When enabled, only the longest tracks used to calculate the solve are displayed in the Viewer. |
Show 3D marker |
displayMarker |
disabled |
When enabled, cone shaped 3D markers are displayed on your points in the 3D Viewer. Note: When Show 3D marker is enabled, set the size of the markers using the scale controls. |
Scene Tab |
|||
[scale constraints table] |
scaleConstraints |
N/A |
Displays known distances for scale constraints against a measured distance between two solved points in the scene. |
Delete Constraints |
deleteScaleConstraints |
N/A |
Click to delete the selected scale constraints. |
Scene Transform |
|||
file_menu |
N/A |
Select to import or export a channel file: • Import chan file - import a channel file and transform the input object according to the transformation data in the channel file. Channel files contain a set of cartesian coordinates for every frame of animation in a given shot. You can create and export them using Nuke or 3D tracking software, such as 3D-Equalizer, Maya, or Boujou. • Export chan file - export the translation parameters that you’ve applied to the input object as a channel file. This is a useful method of sharing setups between artists. |
|
snap_menu |
N/A |
• Match selection position - the scene is snapped to a new position depending on the points selected. • Match selection position, orientation - the scene is snapped to a new position and orientation depending on the points selected. • Match selection position, orientation, size - the scene is snapped to a new position, orientation, and size depending on the points selected. |
|
rotation order |
rot_order |
ZXY |
Sets the order of rotation. The possible axial combinations are ZXY, XYZ, XZY, YXZ, YZX, ZXY, ZYX. |
translate xyz |
translate |
0,0,0 |
Translates the scene along the x, y, and z axes. You can also adjust translate values by clicking and dragging the handles in the 3D Viewer. |
rotate xyz |
rotate |
0,0,0 |
Rotates the scene around the x, y, and z axes. You can adjust rotate values by holding down Ctrl/Cmd and dragging in the 3D Viewer. |
scale xyz |
scale |
0,0,0 |
Scales the scene around the x, y, and z axes. You can adjust scale values by holding down Ctrl/Cmd+Shift and dragging in the 3D Viewer. Note: This control is only displayed if you've scaled the scene on individual axes. |
uniform scale |
uniform_scale |
1 |
Scales the scene simultaneously on the x, y, and z axes. |
Local matrix |
|||
specify matrix |
useMatrix |
disabled |
When enabled, specify matrix values for the object you’re transforming as an alternative to setting transform and scale values above. |
[matrix] |
local_matrix |
N/A |
The matrix displays values from the object’s transform, rotate, scale, skew, and pivot controls. Check specify matrix and copy or drag-and-drop matrix values from another object to apply those values, for example, if you wanted to align objects in a scene. |
World matrix |
|||
[matrix] |
world_matrix |
N/A |
Displays the world or absolute xyz transform of the node in world coordinates. Note: You can’t adjust the World matrix manually. |
Reset Scene Transform |
resetSceneTransform |
N/A |
Click to reset any transforms applied to the scene to the default value. |
Output Tab |
|||
Camera |
|||
Translate xyz |
camTranslate |
0,0,0 |
Sets the translate values for the virtual camera’s position. |
Rotate xyz |
camRotate |
0,0,0 |
Sets the rotation values for the virtual camera’s position. |
Focal Length |
focalLength |
0 |
Sets the focal length for the virtual camera. |
Aperture xy |
aperture |
0,0 |
Sets the aperture angle for the virtual camera. |
Window Translate xy |
windowTranslate |
0,0 |
Sets the center point offset for the camera projection. |
Window Scale xy |
windowScale |
0,0 |
Sets the relative pixel scaling value for the camera projection. |
Lens |
|||
Lens Distortion |
lensDistortionType |
No Lens Distortion |
Specifies the type of lens distortion expected: • No Lens Distortion - treats the footage as having no distortion. Use this option if the Source footage has already been corrected to remove lens distortion. • Unknown Lens - calculates the lens distortion automatically from the sequence (in the same way as the Image Analysis tab in the LensDistortion node) and then refines the distortion in the camera solve. |
Lens Type |
lensType |
Spherical |
Sets the lens type that CameraTracker should expect: Spherical or Anamorphic. |
Radial Distortion 1 |
distortion1 |
0 |
Sets the first radial distortion term. This is proportional to r^2, where r is the distance from the distortion center. |
Radial Distortion 2 |
distortion2 |
0 |
Sets the second radial distortion term, proportional to r^4. |
Distortion Center xy |
distortionCenter |
0,0 |
Sets the values for the center of the radial distortion. |
Anamorphic Squeeze |
anamorphicSqueeze |
1 |
When Lens Type is set to Anamorphic, defines anamorphic squeeze - the distortion in x is scaled by this amount. |
Asymmetry Distortion xy |
asymmetricDistortion |
0,0 |
When Lens Type is set to Anamorphic, defines asymmetric distortion to correct for slight misalignments between multiple elements in the lens. |
Undistort Input |
undistort |
disabled |
When enabled, the Source is undistorted based on the calculated lens. |
filter |
filter |
Cubic |
When Undistort Input is enabled, sets the filtering algorithm to used. This allows you to avoid problems with image quality, particularly in high contrast areas of the frame (where highly aliased, or jaggy, edges may appear if pixels are not filtered and retain their original values). • Impulse - remapped pixels carry their original values. • Cubic - remapped pixels receive some smoothing. • Keys - remapped pixels receive some smoothing, plus minor sharpening (as shown by the negative -y portions of the curve). • Simon - remapped pixels receive some smoothing, plus medium sharpening (as shown by the negative -y portions of the curve). • Rifman - remapped pixels receive some smoothing, plus significant sharpening (as shown by the negative -y portions of the curve). • Mitchell - remapped pixels receive some smoothing, plus blurring to hide pixelation. • Parzen - remapped pixels receive the greatest smoothing of all filters. • Notch - remapped pixels receive flat smoothing (which tends to hide moiré patterns). |
Card Parameters |
|||
scale xyz |
cardScale |
1,1,1 |
Equivalent value for the scale parameter on the Card node, used to produce horizontal scale in conjunction with the Radial Distortion controls. |
a (r^3) |
a |
0 |
Equivalent value for the a (r^3) control on LensDistortion tab of the Card node. Defines a cubic term that affects the radial distortion of the texture applied to the card, and the edges of the card. This allows you to distort an image projected onto a card in 3D, for example, to simulate camera lens distortion effects, such as barrel distortion. Positive values make the card rounder, negative make the corners sharper. |
b (r^2) |
b |
0 |
Equivalent value for the b (r^2) control on LensDistortion tab of the Card node. Defines a square term that affects the radial distortion of the texture applied to the card, and the edges of the card. This allows you to distort an image projected onto a card in 3D, for example, to simulate camera lens distortion effects, such as barrel distortion. Positive values make the card rounder, negative make the corners sharper. |
c (r^1) |
c |
0 |
Equivalent value for the c (r^1) control on LensDistortion tab of the Card node. Defines a linear term that affects the radial distortion of the texture applied to the card, and the edges of the card. This allows you to distort an image projected onto a card in 3D, for example, to simulate camera lens distortion effects, such as barrel distortion Positive values make the card rounder, negative make the corners sharper. |
Step-by-Step Guides
Video Tutorials