Estimate Focal
The Estimate Focal node can be used to estimate the focal length of a camera using two or more vanishing points measured in a single frame. Estimate Focal has a single input and output. Note that if the clip contains lens distortion, that distortion must be removed before focal length estimation, otherwise the resulting value will not be accurate.
It is important to set the correct camera pixel aspect ratio in the Clip Input node, and in order to get sensible measurements of a focal length in millimetres (or and units other than pixels), the sensor size must also be set correctly.
It is not necessary to position all three vanishing points in a frame (two will suffice). Only vanishing points that have been edited (i.e. where the user has positioned lines) will be used during the calculation.
For a more information on vanishing points, see the following web page: http://en.wikipedia.org/wiki/Vanishing_point
Usage
The Estimate Focal node uses vanishing points to estimate the camera focal length. At least two vanishing points must be defined in one frame before focal length can be estimated. To define a vanishing point, identify a frame from the clip where straight lines are visible that are parallel to either the X, Y or Z axes of the scene.
Note that in order to properly define a vanishing point, the lines must not be parallel in the image.
Here is an example of a frame where all three vanishing points can be measured. White dots indicate where the user has positioned the vanishing point lines. Note that two lines have been positioned for each axis.
Correctly positioned X Axis:
Correctly positioned Y Axis:
Correctly positioned Z Axis:
Finally, an example of a BAD choice for a vanishing point. Here, the Y Axis lines are almost parallel, and therefore do not provide as accurate an estimate of the vanishing point for the Y Axis:
Controls
Camera
Focal length: The camera's focal length value at the current frame. In order to estimate different focal lengths at different frames, enable the Variable focal option.
Field of view: The horizontal and vertical field of view at the current frame, measured in degrees.
Sensor size: The camera sensor/film back width and height. Note that to obtain accurate measurements of focal length in units other than Pixels, the camera sensor size must be set correctly. The sensor size can be changed in the Clip Input node at the top of the tree.
Pixel aspect: The camera pixel aspect ratio. The pixel aspect ratio can be changed in the Clip Input node at the top of the tree.
Display
X Axis: When enabled, vanishing point lines will be displayed for the X Axis.
Y Axis: When enabled, vanishing point lines will be displayed for the Y Axis.
Z Axis: When enabled, vanishing point lines will be displayed for the Z Axis.
Show Ground: When enabled, the ground plane will be displayed
Show Horizon: When enabled, the horizon line will be displayed
Show Trackers: When enabled, solved tracker positions will be displayed.
Mouse controls
Click and drag vanishing point line
Move the line into place. holding the Shift key whilst moving the mouse cursor will display a zoom window to help positioning vertices. Holding the Control key will snap a vertex to the nearest strong edge.
Hover the mouse over a positioned point in display line
Remove the positioned point with the Delete key.
Default Keyboard Shortcuts
Keyboard shortcuts can be customised in the Preferences.
X Axis | Shift+X |
Y Axis | Shift+Y |
Z Axis | Shift+Z |
Show Ground | Control+G |
Show Horizon | Control+H |
Show Trackers | Control+T |