LEVIATHANDocumentation

DOC 04PERCEPTION

Camera and underwater optics

The PerceptionFrame camera is LEVIATHAN's scientific camera. A single geometry pass produces every per-pixel channel, so the images, depths, normals and labels cannot disagree with each other. A physically based underwater light model forms the images from that pass.

Viewport with the Sensors menu open: Camera mode buttons RGB, Depth and Seg, FOV and range sliders, the Perception section with Output buttons, Resolution and Capture; a camera frustum drawn from the vehicle toward a wreck and a semantic preview in the monitor.
Figure 4.1 Camera controls in the Viewport. The upper section drives the live display feed; the Perception section captures a PerceptionFrame from the simulation service and shows its channels in the monitor.
Display feed versus PerceptionFrame

The live RGB, Depth and Seg modes are rendered by the Viewport's 3D view for display, using the camera's field of view and range. A PerceptionFrame is computed by the simulation service from the same camera pose. It is the scientific product, with declared units, frames, validity and identity, and it is the one exports and datasets use.

Camera geometry

The camera is a pinhole in the OpenCV optical frame: x right, y down, z forward along the optical axis. The field of view is horizontal. Intrinsics follow from the image size and that angle, with square pixels and pixel centres at integer coordinates:

fx = fy = (W/2) / tan(hfov/2)     cx = (W − 1)/2     cy = (H − 1)/2(1)

For example, a 248 × 164 frame with a 90° field of view has f = 124 px and principal point (123.5, 81.5). The camera matrix K, the distortion model and the valid range interval (0, max range) are written into every frame's calibration record.

Lens distortion

Distortion is optional and follows the Brown–Conrady model on normalised coordinates (xn, yn), with r² = xn² + yn²:

xd = xn(1 + k1r² + k2r⁴ + k3r⁶) + 2p1xnyn + p2(r² + 2xn²)(2)

The y component is symmetric. Under the opencv convention, a pixel is a distorted image point and its ray is undistort(K−1[u, v, 1]), as in OpenCV's calibration model. A legacy_v0 convention reproduces datasets made before PerceptionFrame. Inversion is iterative; motion products mark pixels outside the lens model's invertible domain as distortion undefined (see Surface correspondence).

Ground-truth channels

Range versus z-depth A camera at left looks along its optical axis. A ray to a surface point off the axis has length r, the range. Its projection onto the optical axis is z, the z-depth. The two are equal only on the axis. optical axis surface point range r along the ray z-depth along the axis z = r · cos θ, where θ is the angle between the ray and the axis.
Figure 4.2 Range and z-depth are distinct channels and are never interchanged. Range is the Euclidean distance along the pixel ray; z-depth is its component along the optical axis.
Table 4.1 PerceptionFrame geometry channels. H × W arrays, row 0 at the top. Missing values (no hit within the range limit) are null in float channels.
ChannelTypeUnits · frameMeaning
validbool—The ray hit geometry within (0, max range)
semanticuint16—Canonical class id; open water is the water class; 65535 marks exact geometry with no semantic annotation
instanceuint16—Instance id from the frame's object table; 0 for water and seabed
rangefloat64m · camera centreEuclidean distance from the camera centre to the hit along the ray
z_depthfloat64m · cameraDistance of the hit along the optical axis
normals_worldfloat64 × 3unit · NEDSurface normal, oriented toward the viewer
normals_camerafloat64 × 3unit · cameraThe same normal rotated into the camera frame

Semantic labels use a fixed marine vocabulary, which includes water, seabed, diver, plant, fish, reef, wreck, robot, ship hull, anode, bilge keel, propeller, sea-chest grating, marine growth, corrosion, defect, pipe, cable, manifold, wellhead, mine, debris, boulder, mooring and buoy. Each class has a fixed id and display colour, and common synonyms (for example rock, riser, fouling) map onto it.

Underwater image formation

Underwater image formation Ambient light from the sky enters the water and illuminates a surface with irradiance E. The surface reflects radiance J. Along the path to the camera, J is attenuated by transmission t, and water in the path scatters ambient light toward the camera as path radiance B. The camera receives I equals J times t plus B. AMBIENT SKY · upper hemisphere surface: ρ, E → J = ρE/π J · t,  t = exp(−βD(r) r) + B (single-scattered path radiance) camera receives I = J t + B → sensor response → display (sRGB, visualisation only)
Figure 4.3 The radiometric chain. All radiometric quantities are expressed relative to the surface irradiance Es, so they are dimensionless or in sr−1.

The model is the revised underwater image formation model of Akkaynak and Treibitz (CVPR 2018). It separates the coefficient that governs direct transmission, βD, which depends on range, from the coefficient that governs backscatter, βB. The older atmospheric dehazing model uses one coefficient for both, and that is wrong underwater.

  1. Ambient illumination. Light from the sky arrives with an upper-hemisphere radiance distribution and is attenuated with depth. The irradiance on each surface depends on its depth and its viewer-oriented normal.
  2. Clean radiance. A Lambertian surface of reflectance ρ leaves radiance J = ρEn/π. This is rgb_clean: the object as lit underwater, without the water between it and the camera.
  3. Water transport. Along the ray of length r, the direct signal keeps a fraction t = exp(−βD(r)r), and the water adds single-scattered path radiance B. The radiance at the camera is I = J·t + B. This is rgb_degraded, unclamped.
  4. Sensor response. LEVIATHAN's normalised, quantised linear camera response turns radiance into a fraction of full scale. It has exposure (an EV value or automatic), knee, bit depth, read noise, shot noise and black level. This is rgb_sensor, which is not a Bayer or RAW image. rgb_sensor_clean is the clean radiance through the same exposure, without noise.
  5. Display. rgb_display applies the sRGB transfer function for viewing only. It is never ground truth, and it has its own identity hash.
Table 4.2 PerceptionFrame radiometric channels.
ChannelUnitsMeaning
albedo—Lambertian reflectance ρ of the surface hit; its source is recorded per object
irradianceE / EsAmbient irradiance on the surface at its depth
rgb_cleansr⁻¹ (radiance / Es)Clean surface-leaving radiance J
transmission—Direct transmission t over the camera ray
path_radiancesr⁻¹Single-scattering water-path radiance B
rgb_degradedsr⁻¹Radiance at the camera, I = J·t + B
rgb_sensorfraction of full scaleCamera-response image with noise
rgb_sensor_cleanfraction of full scaleClean radiance through the same exposure, no noise
rgb_displaysRGB [0, 1]Visualisation only
background, surface_not_modeledboolThe ray looks into open water, or rises toward the sea surface without a hit
radiometric_valid, radiometric_reasonbool, uint16Whether the pixel's whole radiometric chain is modelled, and if not, why

Water types

Water is homogeneous and is specified by its beam attenuation coefficient c per colour channel, in m−1. You can pick a named type or give your own non-negative [r, g, b].

Table 4.3 Named water types: beam attenuation c in m−1 for the red, green and blue channels. The Jerlov types follow the classical oceanic (I–III) and coastal (1C–9C) classes.
TypecRcGcBTypecRcGcB
clear0.420.090.03Jerlov II0.520.120.07
coastal0.550.120.18Jerlov III0.640.160.12
turbid0.880.300.45Jerlov 1C0.780.230.24
murky1.900.901.20Jerlov 3C1.050.340.40
Jerlov I0.340.070.021Jerlov 5C1.350.480.62
Jerlov IA0.390.0830.028Jerlov 7C1.750.680.90
Jerlov IB0.440.0950.038Jerlov 9C2.300.981.35

Ambient illumination

An ambient model is required: LEVIATHAN has no default, because the choice changes every radiometric value. Two models are available. A power-cosine sky has radiance proportional to cosm of the zenith angle, and you must state the exponent m. An isotropic sky is the case m = 0.

Outputs in the application

One capture produces every output from the same camera, pose and scene, so the channels line up pixel for pixel. Figure 4.4 shows five of them from a single Pipeline capture: the camera looks down at 32° over the manifold, the flowlines and a flanged pipe section, with coastal water and an isotropic sky.

Underwater channel of the Pipeline capture: green seabed fading into a grey-green water veil toward the top, with the manifold, flowlines and pipe drawn in magenta where radiometry is invalid; the concrete pipe supports appear as dark, validly lit blocks.
Underwater RGB
Semantic channel in canonical label colours: seabed white, pipe and flowlines cyan, an anode orange, and the manifold and other structure parts in their own label colours.
Semantic labels
Instance channel: the seabed in green and the whole pipeline structure in one grey colour, because the structure is a single object.
Instance labels
Z-depth channel from 0 to 30 m: near seabed and pipe white, fading to dark grey with distance, black beyond the camera range at the top.
Z-depth
Surface normals in the camera frame: the seabed in one flat colour, the manifold top in another, and the cylindrical pipe shaded through a gradient of colours around its circumference.
Surface normals
Figure 4.4 One Pipeline capture at 992 × 656 pixels, 60° horizontal field of view, 30 m range, exposure 2 EV. Z-depth runs from 0 to 30 m with near surfaces white; normals are in the camera frame. The frame was requested from the simulation service at this size; the Viewport's capture panel offers up to 248 × 164.

The same capture also holds the Clean, Sensor and Albedo images, Range, and normals in the NED world frame. Each is selected under Output in the camera panel and shown in the camera monitor.

Magenta in the image channels marks pixels without valid radiometry. The Pipeline structure's material map establishes reflectance only for its concrete pipe supports. The pipe, manifold, anodes and markers have geometry and labels but no established reflectance, so their radiometric reason is material_unknown. This capture used Estimated reflectance for the seabed, which the frame records as unmeasured.

Radiometric validity

A pixel's radiometry is reported only where every link of the chain is modelled. Otherwise the radiometric channels hold null, never a plausible-looking value such as black, and radiometric_reason records why:

Table 4.4 Radiometric reason codes. The highest applicable code is recorded.
CodeReasonEffect
0validAll radiometric channels present
1material_unknownNo scientific reflectance: albedo, clean, underwater and sensor values are null
2interface_crossing_unsupportedThe camera-to-surface path crosses the air–water surface, which is not modelled
3above_water_unsupportedThe path or surface is in air; there is no topside illumination model

Where reflectance comes from

Scene models carry display colours and textures, which are not evidence of how a surface reflects light. Reflectance is resolved in this order:

  1. an explicit reflectance given for the object;
  2. a material from LEVIATHAN's scientific material library, through a structure material map;
  3. only if you allow it, the display palette, recorded in the frame as an unmeasured estimate.

The scientific material library holds reflectances reduced from source spectra in the ECOSTRESS spectral library, currently a set of concretes. One built-in assignment exists: the pipeline site's concrete saddles. It is declared a proxy, because the values are dry-laboratory measurements not corrected for immersion. Every other surface is unknown until reflectance is supplied.

Completeness

Every frame states whether it is complete. When something physically present cannot be represented, the frame lists it with a category and a reason, and is marked incomplete. Examples are the ego vehicle, which is drawn by a display mesh only and has no scientific geometry, and entities without semantic labels. Omission categories include unsupported geometry, unsupported semantic labels, non-metric geometry, unsupported dynamic entities, unmapped entities, and participating media, illumination effects and interfaces that are not modelled.

Capture settings and limits

Table 4.5 Capture settings and service limits.
SettingValue
In-app resolutions124 × 82, 186 × 123, 248 × 164 (the feed's aspect)
Service limitsUp to 1024 px on a side and 65,536 pixels per frame; 16 frames and 262,144 pixels per dataset request
Scene objectsSpheres, boxes, meshes, mesh assets and structures; flat or absent seabed; up to 64 objects
Seed and frame indexRoot seed and frame index; per-source random streams derive from them
ArraysIEEE-754 binary64, unrounded
Not modelled

Direct sunlight, artificial lights, the sea surface (reflection and refraction), multiple scattering, forward-scatter blur, ambient light varying along the ray, discrete suspended particles and stratified water. Pixels that depend on these are marked rather than approximated.