ST-Maps in PFTrack 2016
The Pixel Farm have been pioneers in making lens distortion data available for VFX pipelines. For years, the PFBarrel plugin for compositing applications has provided the ability to use PFTrack’s leading lens distortion models in third party software.
However, with the wide range of compositing software packages and the various lens distortion models they support growing, a beneficial alternative was needed. That’s why we have introduced the option to export the lens distortion model as a sequence of ST-Maps; an easy and portable way to apply PFTrack’s lens distortion results in a software agnostic way.
– Solve Your Lens Distortion the Usual Way
– Export the Deformation ST-Maps
– Working With Proxies
– Using ST-Maps in Nuke
01. So What Are ST-Maps?
The image above shows an example ST-Map. The colours in the red and green channel describe the way the individual pixels are warped to apply or remove lens distortion from an image.
02. How Does It Work?
Solve Your Lens Distortion The Usual Way
You can solve your lens distortion the same way as you always have in PFTrack, either explicitly in an Undistort node, during the camera solve in the Camera Solver, Survey Solver or Photo Survey node, or by using a lens preset. The resulting lens distortion model will be piped down the tree into an Export node.
Exporting the Deformation ST-Maps
In the Export node you can find the new Distortion Export tab. From here you can export ST-Maps for both undistortion and redistortion. Both, the undistortion and redistortion will be formed of a sequence of the same length as the input clip; one ST-Map for each frame. Click Export ST-Maps to write the ST-Map clips to disk.
Working With Proxies
You can use ST-Maps even if you use proxies for tracking. ST-Maps store normalised pixel coordinates, so they will still sample from the correct location in the image after scaling them up or down. For example, if you are tracking half resolution proxies, you will have to double the size of the resulting ST-Maps to use them with the original plates.
03. Using the ST-Maps to Undistort and Redistort Your Plates
Most compositing applications provide ways to read ST-Maps and apply the encoded transformation, thus letting you undistort and redistort your plate using PFTrack’s lens distortion model. Below is an illustration of how to use ST-Maps in Nuke.
Using ST-Maps in Nuke
Use an STMap node to undistort or redistort your original clip. In the example tree above, STMap1 is used to undistort the original footage, using the undistort ST-Maps exported from PFTrack. The output is then connected to STMap2 and lens distortion reapplied using the redistort ST-Maps from PFTrack. The result will be identical to the original input clip.
In the STMap node, make sure to set UV channels to rgb, so that the correct channels will be read.