Skip to main content
Skip table of contents

Lens files in Pixotope

Where lens files are stored

The lens files are stored in the Synced Config files folder, where they can easily be synced across machines.

Learn more about the Synced Config files folder

How lens files are applied

Here we define the term "lens values" as values describing the lens properties Field of View (FOV), distortion, center offset, nodal offset and focus distance.

Lens files convert physical lens information (the rotation of the zoom and focus rings on the lens barrel) to calibrated lens values. The position is generated by encoder wheels, either internally within the lens, or using external lens encoder wheels.

The lens file is created by performing a lens calibration procedure.

Some tracking systems deliver all the lens values directly, which means that they have a lens file within their system (e.g. Stype, Ncam, Mo-Sys, SMT Trackman, Trackmen X-Cito). Be aware that not all lens files contain the same information. Most lens files have Field of View (FOV) values; values for distortion, center offset, nodal offset and focus distance are not always present.

Other tracking protocols such as FreeD only deliver lens encoder values, which means that a lens file is required somewhere else in the tracking pipeline to generate lens data. When using FreeD, we must apply a lens file in Pixotope in order to convert the zoom/focus encoder values in the FreeD stream into lens values.

We can also override lens values in the tracking data stream, for example, Stype, by selecting a lens file in Pixotope. By doing this, the values in the tracking stream will be replaced by values read from the lens file in Pixotope.

Tracking data may come with a nodal offset baked into the camera position e.g. Ncam. In this case, the nodal offset from the lens file must not be applied on top of that.



Pixotope lens file format

The lens file is a json file with two sections, meta and curves. The filename ends with .cts.

Meta

The meta section exists to provide general information about the lens file. The tracking server will read the following parameters.

  • distortionModel, a string naming the distortion model to set when applying the lens file.

  • encoderLimits, when present these can be used as default values for encoder limits. Within the encoderLimits object the recognized limits are ZoomEncoderOutZoomEncoderInFocusEncoderFarFocusEncoderNear. The example below has all of these limits present.

Curves

Curves contains the actual lens data. It is an array of objects that each have the keys type, header and data. Type specifies the interpolation mode, header what the numbers in the data represent and data is the actual lens data. If two curves of the same value are added, the latter overwrites the first when the file is used by the tracking server.

The data portion for each curve is encoded in pure json arrays of arrays.

[[ENCODER_A1, ENCODER_B1, VALUE1], [ENCODER_A2, ENCODER_B2, VALUE2], [ENCODER_A3, ENCODER_B3, VALUE3], ... ]

Before Pixotope 1.3 it was only possible to encode the data portion of the curve in a pseudo-csv format. It is a string with data points which are separated by semicolons (;), and values for a point are separated by commas (,). See below for an example. This format is still supported but its use is discouraged.

"ENCODER_A1,ENCODER_B1,VALUE1;ENCODER_A2,ENCODER_B2,VALUE2;ENCODER_A3,ENCODER_B3,VALUE3;..."

Encoder values in the lens file are normalized between 0.0 and 1.0, which correspond to the outer limits of the lens movement. By normalization we refer to reducing the raw encoder values to fractional position between the encoder limits. For this the lower limit is zoom-wide or focus-far, and the upper limit is zoom-tele or focus-near. As an example, focus encoder position 15 in a lens with focus far at focus encoder 5 and focus encoder near at 105 gives a normalized focus encoder value of 0.1.

Curve type can be CONSTANT, LINEAR, or BILINEAR, depending on whether they are using zero, one or two encoder values. Below is an example lens file with a mixture of curves.



JS
{
    "meta": {
        "distortionModel": "opencv",
        "encoderLimits": {
            "ZoomEncoderOut": 0,
            "ZoomEncoderIn": 65536,
            "FocusEncoderFar": 0,
            "FocusEncoderNear": 65536
        },
        "serial number": "12345678",
        "created with camera": {
            "name": "Sony HDC 2400",
            "ccd width mm": "9.6",
            "ccd height mm": "5.4"
        },
        "Notes": "Unverified nodal offset.",
        "time": "11/02/23 09:42:02",
        "creator": "Pixotope Lens File Editor"
    },
    "curves": [
        {
            "type": "CONSTANT",
            "header": "DCX",
            "data": [
                [0.01]
            ]
        },
        {
            "type": "LINEAR",
            "header": "FOCUS_ENCODER, FOCUS_DISTANCE",
            "data": [
                [0.0, 59.7408],
                [0.09524, 69.3133488],
                [0.19048, 77.234796],
                [0.28571, 87.0780072],
                [0.38095, 100.1255808],
                [0.47619, 118.7601384],
                [0.57143, 145.819368],
                [0.66667, 193.8378648],
                [0.71429, 227.10038400000002],
                [0.7619, 275.9549472],
                [0.80952, 376.1774544],
                [0.85714, 599.2386288],
                [0.90476, 864.6883392],
                [0.95238, 1332.9489216000002],
                [1.0, 3048.0]
            ]
        },
        {
            "type": "LINEAR",
            "header": "ZOOM_ENCODER, K1",
            "data": [
                [0.0, -0.0495],
                [0.00166, -0.0495],
                [0.19823, -0.1096],
                [0.34812, -0.0857],
                [0.6376, -0.0857],
                [0.7847, -0.0],
                [1.0, -0.0]
            ]
        },
        {
            "type": "LINEAR",
            "header": "ZOOM_ENCODER, NODAL_OFFSET",
            "data": [
                [0.0, 16.764],
                [0.2945, 11.43],
                [0.5449, 2.54],
                [0.7476, -6.8580000000000005],
                [1.0, -22.86]
            ]
        },
        {
            "type": "BILINEAR",
            "header": "ZOOM_ENCODER, FOCUS_ENCODER, FOVH",
            "data": [
                [0.0, 0.0, 68.04],
                [0.0, 1.0, 71.63],
                [0.0992673992674, 0.0, 51.0],
                [0.0992673992674, 1.0, 50.83],
                [0.200366300366, 0.0, 39.05],
                [0.200366300366, 1.0, 39.07],
                [0.323443223443, 0.0, 29.49],
                [0.323443223443, 1.0, 29.06],
                [0.473626373626, 0.0, 19.4],
                [0.473626373626, 1.0, 20.65],
                [0.610622710623, 0.0, 14.91],
                [0.610622710623, 1.0, 14.34],
                [0.765201465201, 0.0, 8.12],
                [0.765201465201, 1.0, 9.115407347949546],
                [1.0, 0.0, 3.88],
                [1.0, 1.0, 4.882818845174979]
            ]
        }
    ]
}


Interpolation types

  • CONSTANT

    • Encoder value not used.

  • LINEAR

    • Either the focus or zoom encoder is used.

  • BILINEAR

    • Points must form a perfect grid.

    • Focus and zoom encoder values are used.

Recognized keys

These keys (names) are recognized by CTS when reading lens files. Some parameters may be ignored by the selected lens distortion model.

  • ZOOM_ENCODER

  • FOCUS_ENCODER

  • FOVH

    • degrees

  • FOVV

    • degrees

  • FOCUS_DISTANCE

    • cm

  • K1

  • K2

  • K3

  • P1

  • P2

  • DISTORTED_FOCAL

  • PROJECTION_AREA_WIDTH

  • PROJECTION_ASPECT_RATIO

  • DCX

  • DCY

  • NODAL_OFFSET

    • cm

    • positive is in front of camera


JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.