Skip to main content
Version: dev-latest
Code Samples

For code samples of LUT-based image manipulation, please check out our lut-examples repository.

Stereo Lookup Table

Usage

Stereo Lookup Table - CLI Example
metrical shape stereo-lut [OPTIONS] \
--dominant <DOMINANT> \
--secondary <SECONDARY> \
<INPUT_PLEX> <ARTIFACT>
Stereo Lookup Table - Manifest Example
command = "shape-stereo-lut"
input-plex = "{{calibrate-stage.results}}"
format = "json|msgpack"
dominant = "camera_to_use_as_dominant_eye"
secondary = "camera_to_use_as_secondary_eye"
artifact = "{{auto}}"

Purpose

This command creates two pixel-wise lookup tables to produce a stereo rectified pair based on an existing calibration. Rectification occurs in a hallucinated frame with a translation at the origin of the dominant eye, but with a rotation halfway between the dominant frame and the secondary frame.

Rectification is the process of transforming a stereo pair of images into a common plane. This is useful for a ton of different applications, including feature matching and disparity estimation. Rectification is often a prerequisite for other computer vision tasks.

The Stereo LUT subcommand will create two lookup tables, one for each camera in the stereo pair. These LUTs are the same format as the ones created by the lut command, but they map the pixel-wise shift needed to move each image into that common plane. The result is a pair of rectified images!

The Stereo LUT subcommand will also output the values necessary to calculate depth from disparity values.

Examples

Create a rectification lookup table between a stereo pair

metrical shape stereo-lut --dominant ir_one --secondary ir_two \
<INPUT_PLEX> <ARTIFACT>

Arguments

[INPUT_PLEX]

The path to the input plex. This can be a MetriCal Results MCAP or a plex JSON.

[ARTIFACT]

The artifacts output location.

Options

Global Arguments

As with every command, all global arguments are supported (though not all may be used).

-a, --dominant [DOMINANT]

The dominant eye in this stereo pair. Must be a camera component specifier (UUID or component name)

-b, --secondary [SECONDARY]

The secondary eye in this stereo pair. Must be a camera component specifier (UUID or component name)

-f, --format [FORMAT]

Default: json

What serializer to use to format the output. Possible values:

  • json: Output the shape data as JSON
  • msgpack: Output the shape data as MsgPack

Output Schema

Loading ....

Raw schema file