The Photo Camera Presets panel is composed of four main areas:
The Calibration Manager (1), where photos can be loaded ready for calibration
The Active Metadata Window (2), where photo metadata is displayed, and can be connected to the virtual camera for use during calibration.
The Camera Preset parameters (3), where camera body and lens parameters can be adjusted if required, and where the camera preset is built
The Focal Range graph (4), where calibration patterns for individual focal lengths are displayed.
The Calibration Manager displays information about the photos that are loaded for calibration:
The following buttons are also available:
- Clicking this button will display the File Browser where photos can be loaded.
- Clicking this button will display a calibration pattern which can be photographed directly on the desktop.
- Clicking this button will remove any photos loaded and reset the panel to its default state.
PFTrack supports both checkerboard and a regular grid of calibration dots (black dots against a white background). Either pattern can be used for calibration, although if a choice is possible we recommend the new calibration dots pattern as it is often able to provide more accurate detection and calibration results.
The dots pattern can be displayed full screen directly from withing the PFTrack UI (for example, to project onto a screen for image capture). To do this, click the button.
This will display a popup window showing the keyboard controls:
+ increase the pattern size,
- decrease the pattern size,
Esc Close the window.
Clicking the OK button will display the calibration pattern full-screen. To ensure a large enough number of calibration points are detected, the grids should be shot front-on, filling as much of the image area as possible:
When calibrating zoom lenses, it is recommended to shoot calibration patterns at different focal lengths over the entire focal range of the lens. For example, a 50-150mm lens could be sampled with one calibration pattern every 10mm. For focal lengths between these samples, the lens distortion model will be interpolated. Lenses with a significant change in distortion over their focal range may require more calibration patterns to be shot.
For prime lenses, a single calibration pattern will suffice.
When loading photos from the File Browser, an additional option is available where the type of calibration pattern can be selected:
The pattern type can be changed between:
- A regular grid of calibration dots
- A uniform checkerboard pattern.
Please note that PFTrack will only import photos with appropriate EXIF metadata describing the camera focal length. When photos are loaded, PFTrack will read the focal length of each photo from metadata, and automatically attempt to detect a calibration pattern in each image. Information about how successful this is will be printed to the log window:
Detecting calibration dots pattern in 8 photos.. Detected 958 calibration points in '/Volumes/Store/Media/calibration/17-55mm/DSC_7825.JPG' Detected 858 calibration points in '/Volumes/Store/Media/calibration/17-55mm/DSC_7825.JPG' Detected 648 calibration points in '/Volumes/Store/Media/calibration/17-55mm/DSC_7825.JPG' Detected 876 calibration points in '/Volumes/Store/Media/calibration/17-55mm/DSC_7825.JPG' Detected 928 calibration points in '/Volumes/Store/Media/calibration/17-55mm/DSC_7825.JPG' Detected 658 calibration points in '/Volumes/Store/Media/calibration/17-55mm/DSC_7825.JPG' Detected 773 calibration points in '/Volumes/Store/Media/calibration/17-55mm/DSC_7825.JPG' Detected 1032 calibration points in '/Volumes/Store/Media/calibration/17-55mm/DSC_7825.JPG'
The Focal Range Graph will display the focal length for each calibration pattern that has been detected:
Clicking on a focal length value will display that photo in the Cinema window. If more than one photo has been captured at a single focal length, thumbnails will be available in the bottom-left of the Cinema window where each can be selected for display.
After loading photos, the Active Metadata window will display any metadata available to use in the top-left of the PFTrack window:
Information related to the Camera Body is shown at the top (1), and Camera Lens in the middle (2).
The full list of all metadata in the media is shown in the Photo Metadata section (3). The important values that PFTrack has identified are highlighed in blue. Individual sections of the Photo Metadata list can be opened and closed using the white arrow buttons to the right of each section title.
If metadata is available to use, it must be connected to PFTrack's virtual camera in order to populate the camera preset data. This is achieved by clicking the Connect toggles next to each piece of metadata:
: When in this state, metadata is not connected and is not being used (this is the default state).
: This state indicates the metadata value is to be used as a Hint (for example, to find the best matching camera model containing sensor size information).
: This state indicated the metadata value is to be used exactly as presented.
Not all states are available for each parameter input.
Each camera preset contains information describing both the camera body and lens. These are separated out into two section of the panel:
A set of generic sensor size presets are available in PFTrack. If metadata is not available describing the sensor area, these can be selected using the Camera Make and Camera Model menus.
If metadata is available for the sensor area, it can be connected to the virtual camera in the Active Metadata window.
Please note: it is important that these values are set correctly as they will influence the size of the sensor area used to capture the image, especially when using scaled or windowed sensors.
If no sensor information is available, it can be entered manually by selecting Unknown from the Camera Make and Camera Model options and entering the data manually:
In this case, the Sensor resolution (measured in pixels) and Sensor area (measured in millimeters) should be entered. Note that these values should correspond to the full sensor size of the camera.
Once the sensor area is entered, the following two buttons can be used to select between a windowed and scaled sensor mode:
: This specifies a windowed sensor, where the actual sensor area used to capture the image is a smaller section in the centre of the sensor.
: This specifies a scaled sensor, where the data captured by the sensor is scaled to fit horizontally or vertically.
The choice of a windowed vs. scaled sensor directly affects the Image area (measured in pixels) which corresponds to the sensor area used to capture the image.
The Camera Lens panel contains the lens make, model, serial number and squeeze factor if relevant:
The Lens Type can also be selected using the following buttons:
: When this button is active, the preset will be for a Prime lens, calibrating lens distortion a single focal length.
: When this button is active, preset will be for a Zoom lens, where lens distortion can be calibrated at multiple focal lengths.
: When this button is active, a standard lens distortion model will be used.
: When this button is active, a wide-angle lens distortion model will be used.
: When this button is active, a special lens distortion model will be used that is suitable for cameras which may have already attempted to remove sone lens distortion from the photo.
When using a zoom lens, the focal range over which lens distortion can be calibrated is specified using the Fl min and Fl max values. When metadata is being used to define the camera lens type, the selection of a prime or zoom lens cannot be changed.
The Calibration panel is where lens distortion can be calibrated, and a camera preset generated.
In order to calibrate lens distortion, the following conditions must be satisfied:
- The Sensor area in the Camera Body parameters has been set.
- The Focal length value has been set for a prime lens, or the Focal range has been set for a zoom lens
- One or more calibration patterns have been detected in the source photos.
Calibration pattern will be detected automatically when loading photos, with one point at each checkerboard corner, or one point at each calibration dot.
Once calibration patters have been detected, the button can be clicked to start the calibration process. As calibration proceeds, information will be written to the log file indicating the accuracy of the distortion information represented as mean error, standard deviation, and maximum error:
DSC_7825: 'Spherical' focal length= 17.3 mm; Mean error 0.44 pix; std 0.21 pix; max 1.17 pix DSC_7826: 'Spherical' focal length= 17.3 mm; Mean error 0.44 pix; std 0.22 pix; max 1.55 pix DSC_7827: 'Spherical' focal length= 20.6 mm; Mean error 0.41 pix; std 0.19 pix; max 1.14 pix DSC_7828: 'Spherical' focal length= 24.5 mm; Mean error 0.46 pix; std 0.22 pix; max 1.78 pix DSC_7829: 'Spherical' focal length= 28.3 mm; Mean error 0.39 pix; std 0.19 pix; max 1.30 pix DSC_7830: 'Spherical' focal length= 35.6 mm; Mean error 0.37 pix; std 0.17 pix; max 0.99 pix DSC_7831: 'Spherical' focal length= 44.9 mm; Mean error 0.37 pix; std 0.17 pix; max 0.94 pix DSC_7832: 'Spherical' focal length= 55 mm; Mean error 0.41 pix; std 0.20 pix; max 1.09 pix
The calibration pattern points displayed in the Cinema window will also be coloured to indicate the accuracy of the calibration, from red to orange and green, and will undistort the source media using the calibrated lens distortion model.
Once calibrated, clicking and dragging with the left mouse button in the Focal Range Graph will display the field of view of the camera at the current focal length:
A wireframe undistorted representation of the source media will also be displayed in the Cinema window. This can be used to check how lens distortion will be interpolated between focal lengths at which it has been calibrated:
The buttons at the bottom of the Calibration panel can be used to switch various display components on or off:
- This button will toggle display of the sensor overlay information.
- This button will toggle display of the undistorted wireframe.
- This button will toggle display of the calibration points.
After lens distortion has been calibrated, controls are available to adjust image cropping if required
By default, a photo will undistort to the same resolution as the original image. This means some pixels will be lost around the boundary of the image. Adjusting the image crop size will allow these pixels to be recovered if desired.
: Selecting this button will allow the image crop area to be adjusted manually in the Cinema window by clicking and dragging on the frame boundary with the left mouse button.
: Enabling this control will ensure the original frame aspect ratio is maintained when adjusting the image crop.
: Clicking this button will reset the image crop to match the original source material resolution.
Distortion Centre: This displays the current centre of lens distortion.
Field of view: This displays the current horizontal and vertical field of view.
The following buttons can be used to fit the image crop to the undistorted image data:
: Clicking this button will fit horizontally to ensure no empty pixels are visible at the left and right-hand edges of the image.
: Clicking this button will fit to the full horizontal extents of the undistorted image.
: Clicking this button will fit vertically to ensure no empty pixels are visible at the top and bottom edges of the image.
: Clicking this button will fit to the full vertical extents of the undistorted image.
Finally, once lens distortion has been calibrated, the preset can be stored in the Preset Manager panel by clicking the button. This will display a popup window asking for a preset name. Clicking the Accept button will store the preset in the project.
Once presets have been stored, they become available for use in the Photo Input nodes.
The Preset Manager panel lists all photo camera presets that are currently available in the project:
Individual presets can be selected for export by clicking with the left mouse button, and managed using the following buttons:
: Clicking this button will export the preset as an XML file.
: Clicking this button will import a preset XML file.
: Clicking this button will remove the preset from the project.
When PFTrack launches, any preset files stored in the user's documents folder
/Users/USERNAME/Documents/The Pixel Farm/PFTrack/presets/camera (or an alternative location as specified in the Preferences window) will be automatically loaded into the project.