CSV exterior parameters

CSV files can be used to specify frame camera exterior parameters with a row per source image file, and column fields for filename, camera position, camera orientation and camera ID.

Fields

Field contents can be specified with a file header, or the CsvReader() fieldnames argument if using the API. Recognised field names are:

Field name(s)

Description

filename

Image file name excluding parent path, with or without extension. Case sensitive.

x, y, z

Camera position in world / ortho coordinates.

latitude, longitude, altitude

Camera position in geographic coordinates.

omega, phi, kappa

Camera orientation angles.

roll, pitch, yaw

Camera orientation angles.

camera

ID of camera interior parameters (optional).

Fields should include filename, camera position as either x, y & z or latitude, longitude & altitude, and camera orientation as either omega, phi & kappa or roll, pitch & yaw. The camera field should be included for multi-camera setups, but is otherwise optional. Other fields not in the table can be included, but will be ignored.

For example, this is a valid file with a header:

filename,x,y,z,omega,phi,kappa
3324c_2015_1004_05_0182_RGB,-55094.504,-3727407.037,5258.308,-0.349,0.298,-179.087
3324c_2015_1004_05_0184_RGB,-57710.435,-3727433.893,5256.765,0.27,-0.282,-179.028

When there is no file header (and fieldnames is not provided to CsvReader() if using the API), fields are assumed to be in the legacy simple-ortho format: filename, x, y, z, omega, phi, kappa (in that order).

Note

Conversion from (roll, pitch, yaw) camera orientation is approximate and relies on the world CRS having minimal distortion in the imaged area.

Dialect

By default the file dialect (i.e. delimiter, line terminator, quote character etc.) is automatically detected. It can also be specified with the CsvReader() dialect argument if using the API. Comma, space, semicolon, colon or tab delimiters; and windows or unix line terminators are supported. Field values can optionally be enclosed in single or double quotes. This is required with e.g. the filename or camera fields if values contain the CSV delimiter.

This example shows a valid space delimited file with a header, and camera ID values in quotes:

filename latitude longitude altitude roll pitch yaw camera other
100_0005_0018.tif 24.68027804 120.9517016 186.57 0.0 30.0 92.9 "dji fc6310r 5472 3648 brown 0.6666" ignored
100_0005_0136.tif 24.68014678 120.95166508 186.65 0.0 30.0 -175.8 "dji fc6310r 5472 3648 brown 0.6666" ignored

Angle units and .prj file

Orientation angles are assumed to be in degrees by default. The --radians option on the command line, or the CsvReader() radians argument in the API should be supplied if angles are in radians.

Optionally, the CRS of x, y, z world coordinate positions can be supplied in a sidecar .prj file (i.e. a text file containing a WKT, proj4 or EPSG string, and having the same path as the CSV file, but a .prj extension). In this case, the world / ortho CRS does not have to be supplied with the --crs command line option, or CsvReader() crs API argument.

Note

See the test data for other CSV file examples.