Passer au contenu principal

Project files — the JSON format

A project describes the images used for stereo plotting: the cameras that took them, the folders that contain them, and the exterior orientation of each image (position and attitude). It is a single text file in JSON format, with the .json extension.

A project is loaded with the Project option of the command Oxalis_ConfigureStereoProject, or with the Project button of the Oxalis panel.

A project file can be:

  • created by conversion, with the commands Oxalis_ConvertPrjt2Json (rhinoCity texturing configuration), Oxalis_ConvertEO2Json (Vexcel) or Oxalis_ConvertSummit2Json (SummitEvolution)
  • written by hand, or generated by a script from the results of an aerotriangulation or photogrammetry software

This section describes its content, to check a converted file or to write your own.

Structure

The file contains a single JSON object. Besides a few descriptive fields, it holds three lists:

  • cameras: the cameras and their interior orientation
  • directories: the folders that contain the images
  • images: one entry per image, with its file, its camera and its exterior orientation

{

"version": 1,

"datetime": "2026-10-15 09:00:00",

"author": "Survey department",

"comment": "Block 12, flight of 2026-05-04",

"EPSG": 2154,

"cameras": [ { ... }, { ... } ],

"directories": [ ".\\Images" ],

"images": [ { ... }, { ... }, { ... } ]

}

General rules

  • The file is a standard JSON file, encoded in UTF-8
  • Key names are not case-sensitive: EPSG, Epsg and epsg are equivalent
  • The order of the keys does not matter
  • Keys that are not recognized are ignored
⚠️ • An unrecognized key is ignored without any message. A misspelled key (focale_mm instead of focal_mm, for example) is therefore not reported as such: the value is simply missing, which usually leads to one of the error messages listed at the end of this section
Units

Lengths and angles can carry their unit as a suffix, separated from the name by an underscore: focal_mm, x_m, omega_dg. The suffix is what follows the last underscore of the key. Without a suffix, the default unit of the field applies.

Suffix

Unit

km

kilometer

m

meter

dm

decimeter

cm

centimeter

mm

millimeter

µm

micrometer

nm

nanometer

dg

degree

rd

radian

px

pixel (only for width and height of a camera)

The default unit depends on the field: millimeters for the camera parameters, meters for the positions of the images, degrees for the angles. An unknown suffix stops the loading with an error message.

Root keys

Key

Type

Purpose

version

integer

Version of the format. Currently 1.

datetime

text or number

Date of creation. Informational. A number is read as a Unix timestamp (seconds since 1970-01-01, UTC).

author

text

Author or software that produced the file. Informational.

comment

text

Free comment. Informational.

EPSG

integer

Coordinate system of the project, by its EPSG code.

CoordinateSystem or CoordSystem

text

Coordinate system of the project, in WKT form. Alternative to EPSG.

cameras

list

The cameras. Required.

directories

list

The folders that contain the images. Optional.

images

list

The images. Required.

Coordinate system

The positions of the images are expressed in the coordinate system of the project, declared with EPSG or CoordinateSystem. When the project is loaded, they are converted into the coordinate system of the Rhino document if two conditions are met:

  • the project declares a coordinate system
  • the Rhino document has one, defined with the command RDBSRSDefine

Otherwise, the positions are used as they are.

💡 Declaring the coordinate system of the project makes it usable in documents that use another coordinate system, without any change to the file

Cameras

Each entry of the cameras list describes the interior orientation of a camera. Several images usually share the same camera.

Key

Default unit

Purpose

id

Identifier of the camera, used to reference it from the images by name (see camera in Images).

name

Name of the camera. Informational.

type, comment

Informational.

focal

mm

Focal length. Required.

focalx, focaly

mm

Focal lengths along the width and along the height of the image, when they differ. Each one defaults to focal.

ppx, ppy

mm

Position of the principal point relative to the center of the image, ppx to the right and ppy upwards. Default: 0.

In the stereo view, a positive ppx shifts the image to the left, a positive ppy shifts it down.

width_px, height_px

pixel

Size of the image, in pixels. Required. The suffix _px can be omitted: width and height without a suffix are read in pixels.

width_mm, height_mm

mm

Physical size of the sensor. A unit suffix is required here, but any length unit can be used (width_cm, width_µm…). See Sensor size.

pixelsize

mm

Size of a pixel. Alternative to the physical size of the sensor.

rotate_90, rotate_180, rotate_270

true to rotate the image by the given angle. See Rotated images.

flip, flop

true to mirror the image horizontally (flip) or vertically (flop).

intrinsicMatrix

Matrix converting a position relative to the camera into a point on the image. See Camera matrix.

distortion

Distortion coefficients. See Distortion.

Sensor size

A camera needs both its size in pixels and its physical size. The physical size is given in one of three ways:

  • the width and the height (width_mm and height_mm)
  • only one of the two: the other is deduced from the size in pixels, the pixels being square
  • the size of a pixel (pixelsize_mm)
Rotated images

Some cameras record their images rotated relative to the orientation used for the aerotriangulation, for example the oblique heads of multi-camera systems. rotate_90, rotate_180 and rotate_270 rotate the image clockwise, by 90°, 180° or 270°, before it is used.

The sizes in pixels (width_px, height_px) are those of the image file. The physical size (width_mm, height_mm) and the principal point (ppx, ppy) are expressed in the orientation after rotation. With rotate_90 or rotate_270, width_mm therefore corresponds to height_px:

{

"name": "NAD",

"focal_mm": 89.0992,

"width_mm": 52.7804, "height_mm": 130.6952,

"width_px": 28412, "height_px": 11474,

"rotate_90": true

}

Here, the pixel size is 4.6 µm: 52.7804 mm correspond to the 11474 pixels of height_px, and 130.6952 mm to the 28412 pixels of width_px.

Camera matrix

Instead of the focal length and the principal point, a camera can be described by its matrix: the matrix that converts a position relative to the camera into a point on the image. intrinsicMatrix is a flat list, read row by row:

  • 6 values (2 × 3 matrix): [ fx, s, cx, 0, fy, cy ]
  • 9 values (3 × 3 matrix): the same, followed by 0, 0, 1

fx and fy are the focal lengths expressed in pixels (positive values), s the skew, cx and cy the position of the principal point in pixels, measured from the bottom-left corner of the image. With the keys described above, they would be:

  • fx = width_px × focalx / width_mm and fy = height_px × focaly / height_mm
  • cx = width_px × (0.5 + ppx / width_mm) and cy = height_px × (0.5 + ppy / height_mm)

The suffix _2x3 or _3x3 is optional: the size of the matrix is deduced from the number of values. focal remains required: combined with fx and fy, it gives the physical size of the sensor when width_mm and height_mm are not given.

💡 A matrix produced by another software may use another origin for the pixels (the top-left corner, for example) or another direction for the axes: are these conventions the same as above? It is worth checking before using the matrix as it is
Distortion

distortion is an object containing the coefficients of the Brown model:

  • K0 to K8: radial distortion
  • P1 to P8: tangential distortion

Missing coefficients are 0, K0 included. The coefficients are used as given, and the focal length is not modified: it is assumed to already match the coefficients. Any other key inside distortion stops the loading with an error message.

The distortion applies to the normalized coordinates u and v of a point in the camera frame (see Projection model), with r² = u² + v²:

ud = u · (1 + K0 + K1r² + K2r⁴ + …) + [2u · (P1u + P2v) + P1r²] · (1 + P3r² + P4r⁴ + …)

vd = v · (1 + K0 + K1r² + K2r⁴ + …) + [2v · (P1u + P2v) + P2r²] · (1 + P3r² + P4r⁴ + …)

r has no unit: it is expressed in units of focal length. K0 is a constant term, which acts as a scale factor; K1 applies to r², K2 to r⁴, and so on. P3, P4… weight the tangential terms.

💡 Not all software names or orders the tangential coefficients in the same way: OpenCV, for example, swaps P1 and P2 compared to the formula above. Which convention does the software that produced the calibration use? It is worth checking before copying its coefficients

"distortion": {

"K0": 0.0044111734361187566,

"K1": -0.058655309913068485,

"K2": 0.01905293513187853

}

Radial coefficients, with a constant term K0 (aerial camera)

"distortion": {

"K1": -0.281007, "K2": 0.119717, "K3": -0.031551,

"P1": -0.000399, "P2": 4e-6

}

Radial and tangential coefficients (drone camera)

Image folders

directories lists the folders that contain the images. Each image refers to one of them by its index, 0 for the first. A folder is either:

  • absolute: "E:\\Survey\\Images" or "E:/Survey/Images"
  • relative to the folder of the project file: ".\\Images", "..\\2026_TIF\\202625"

In JSON, the backslash must be doubled. The slash / can be used instead, without doubling.

The full path of an image is built as follows:

  • the path of the image (path) is appended to its folder (directory)
  • if the result is a relative path, it is taken relative to the folder of the project file

An absolute path in path is used as it is, and the folder is then ignored. Without directories, each path is either absolute or relative to the folder of the project file.

💡 With relative folders, the project file and its images can be moved or copied together to another disk or computer, without editing the file

Images

Key

Default unit

Purpose

path

Path of the image file, relative to its folder. Required.

directory

Index of the folder in directories (0 for the first), or the folder itself, as text.

camera

Index of the camera in cameras (0 for the first), or its id, as text. Can be omitted when the project has a single camera.

id, comment

Informational.

x, y, z

m

Position of the projection center, in the coordinate system of the project. Required, unless latitude and longitude are used.

altitude

m

Same as z.

latitude (lat), longitude (lon, long)

degree

Geographic position, in place of x and y. See Geographic positions.

omega, phi, kappa

degree

Orientation, photogrammetric angles.

yaw, pitch, roll

degree

Orientation, drone gimbal angles.

orientation

Order in which the three angles are composed. See Orientation.

rotationMatrix

Rotation matrix, 9 values read row by row. Replaces the angles.

reverseRotation

true when the angles or the matrix describe the rotation from the project to the camera.

Geographic positions

latitude and longitude, in decimal degrees, replace x and y; z (or altitude) gives the height, in meters. The project must then declare a geographic coordinate system, usually "EPSG": 4326 (WGS 84), and the Rhino document must have a projected coordinate system, so that the positions are converted.

Orientation

The orientation of an image is given in one of three ways:

  • the photogrammetric angles omega, phi and kappa
  • the drone gimbal angles yaw, pitch and roll
  • a rotation matrix, rotationMatrix

All three describe the rotation from the camera frame to the frame of the project. In the camera frame, x points to the right of the image, y to its top, and the camera looks along −z.

Omega, phi, kappa. The rotation is R = Rx(ω) · Ry(φ) · Rz(κ), where Rx, Ry and Rz are the rotations about the X, Y and Z axes of the project. This is the classical convention of aerotriangulation.

Yaw, pitch, roll. These angles follow the convention of drone gimbals:

  • yaw: heading of the camera, measured clockwise from north
  • pitch: 0 when the camera looks at the horizon, −90 when it looks straight down
  • roll: rotation about the viewing axis

When the camera looks straight down, yaw and roll are not independent: yaw 93.76, roll 180 and yaw −86.24, roll 0 describe the same orientation. Both forms are found in drone files.

Order of the rotations. orientation gives, as three letters, the order in which the rotations are composed: "OPK" or "YPR", or any other order of the same letters ("KPO", "RPY"…). Case is ignored. Without this key, the order is OPK when omega, phi and kappa are all present, YPR otherwise.

Rotation matrix. rotationMatrix contains the 9 values of the matrix from the camera frame to the frame of the project, row by row. It takes precedence over the angles.

Reverse rotation. Some software export the opposite rotation, from the frame of the project to the camera. "reverseRotation": true takes this into account, for the angles as for the matrix.

Projection model

The following steps describe how a ground point (x, y, z) is projected onto an image. They link the keys of the cameras and of the images, and help to check a file written by hand:

  • position relative to the camera: (x′, y′, z′) = RT · (x − xC, y − yC, z − zC), where (xC, yC, zC) is the position of the image and R its rotation (see Orientation), RT being its transpose, that is its inverse
  • normalized coordinates: u = x′ / z′ and v = y′ / z′
  • distortion: u and v become ud and vd (see Distortion)
  • coordinates on the image, from 0 to 1: a = 0.5 + (ppx + f · ud + γ · f · vd) / width_mm and b = 0.5 + (ppy + ρ · f · vd) / height_mm, where f is the opposite of the focal length (f = −focalx), ρ = focaly / focalx, and γ is the skew (0 unless given by intrinsicMatrix)
  • rotation and mirroring of the image (rotate_…, flip, flop), then conversion to pixels: s = width_px × a and t = height_px × b

(s, t) are the coordinates of the point in pixels, from the bottom-left corner of the image.

Error messages

Loading stops at the first error, with one of the following messages:

Message

Cause

Missing mandatory "width" and/or "height".

A camera has no size in pixels.

Missing mandatory "focal".

A camera has no focal length.

Unsupported unit "…".

Unknown length suffix.

Unsupported angle type "…".

Angle suffix other than dg or rd.

The only rotation supported are 90, 180 and 270.

rotate_ followed by another value.

Invalid matrix size. Use a 2x3, 3x3 or 4x4 matrix.

intrinsicMatrix with a wrong number of values.

Unexpected key "…" for "distortion"

Key other than Kn or Pn in distortion.

Missing position.

Image without complete position.

Missing orientation.

Image without three angles of the same family, and without a matrix.

Invalid matrix size. Use a 3x3 matrix.

rotationMatrix without 9 values.

Invalid/Missing camera.

Camera index out of range, unknown id, or no camera given while the project has several.

Orientation should use Omega,Phi,Kappa or Yaw,Pitch,Roll

Invalid value of orientation.

A JSON syntax error (missing comma, unclosed quote…) also stops the loading.

Examples

Aerial survey: photogrammetric angles, projected coordinates

Two cameras of a multi-camera system: the nadir camera, recorded rotated, and an oblique camera with its distortion. The images are in a folder given relative to the project file.

{

"version": 1,

"comment": "Dortmund, nadir and oblique",

"EPSG": 25832,

"cameras": [

{

"name": "NAD",

"focal_mm": 89.0992,

"width_mm": 52.7804, "height_mm": 130.6952,

"ppx_mm": 0, "ppy_mm": 0,

"width_px": 28412, "height_px": 11474,

"rotate_90": true

},

{

"name": "110",

"focal_mm": 88.989,

"width_mm": 53.3968, "height_mm": 40.0568,

"ppx_mm": 0.095, "ppy_mm": -0.07,

"width_px": 11608, "height_px": 8708,

"distortion": {

"K0": 0.0044111734361187566,

"K1": -0.058655309913068485,

"K2": 0.01905293513187853

}

}

],

"directories": [ "..\\00_Stereobilder" ],

"images": [

{

"path": "NAD\\017_069_NAD006798.tif",

"directory": 0, "camera": 0,

"x": 393266.30457, "y": 5707872.00697, "z": 1531.49487,

"omega_dg": -0.00845893506179,

"phi_dg": -0.0951323003953,

"kappa_dg": 89.8549682172

},

{

"path": "110\\019_070_110006356.tif",

"directory": 0, "camera": 1,

"x": 394712.48947, "y": 5707871.4091, "z": 1526.06679,

"omega_dg": -0.0115292453435,

"phi_dg": 42.10726329,

"kappa_dg": 89.9418300295

}

]

}

Drone survey: gimbal angles, geographic coordinates

A single camera, so camera is omitted in the images. The positions are given in latitude and longitude (WGS 84) and converted into the coordinate system of the Rhino document.

{

"version": 1,

"comment": "Gondrecourt",

"EPSG": 4326,

"cameras": [

{

"name": "Img11",

"focal_mm": 8.8,

"ppx_mm": -0.023791447674972533,

"ppy_mm": 0.019709521670742282,

"width_mm": 13.032680394331475,

"height_mm": 8.688453596220983,

"width_px": 5472, "height_px": 3648,

"distortion": {

"K1": -0.281007, "K2": 0.119717, "K3": -0.031551,

"P1": -0.000399, "P2": 4e-6

}

}

],

"directories": [ "E:/Survey/Gondrecourt/images" ],

"images": [

{

"directory": 0,

"path": "DJI_0001.JPG",

"latitude": 48.514159459, "longitude": 5.506744329,

"z": 379.704,

"orientation": "YPR",

"yaw": 93.76, "pitch": -90, "roll": 180

},

{

"directory": 0,

"path": "DJI_0002.JPG",

"latitude": 48.51404021, "longitude": 5.504449914,

"z": 378.716,

"yaw": -5.32, "pitch": -45, "roll": 0

}

]

}