Configuration Schema
The dvrk_display stereo executable uses a JSON configuration file validated
against the dd::display_config@1.0.0 schema.
Getting Started
To create a new configuration, start with a minimal JSON file containing only
the essential fields. The camera.left.stream, and
camera.right.stream keys are required:
{
"type": "dd::display_config@1.0.0",
"name": "dvrk_display",
"sinks": ["glimage"],
"camera": {
"left": { "stream": "v4l2src device=/dev/video0" },
"right": { "stream": "v4l2src device=/dev/video1" }
}
}
Most other fields (crop dimensions, alignment shifts, color calibration, display offset, etc.) are best adjusted interactively using the Calibration Tool rather than edited by hand. The calibration tool will populate and update the remaining fields in the JSON file automatically.
Full Configuration Reference
After tuning with the calibration tool, a complete configuration file will look like:
{
"type": "dd::display_config@1.0.0",
"name": "dvrk_display",
"dvrk_console_namespace": "console",
"ros_image_publishers": ["stereo"],
"overlay_alpha": 0.7,
"preserve_size": true,
"display_horizontal_offset_px": 18,
"sinks": ["glimage"],
"unixfdsinks": [
{ "stream": "stereo" }
],
"camera": {
"size": { "width": 640, "height": 480 },
"left": {
"stream": "v4l2src device=/dev/video_v4l2_left",
"color": { "brightness": 0.0, "contrast": 1.0, "saturation": 1.0, "hue": 0.0 }
},
"right": {
"stream": "v4l2src device=/dev/video_v4l2_right ! videoflip method=rotate-180",
"color": { "brightness": 0.0, "contrast": 1.0, "saturation": 1.0, "hue": 0.0 }
},
"crop": { "width": 508, "height": 381 },
"alignment": { "horizontal_shift_px": -89, "vertical_shift_px": 0 }
}
}
Top-Level Field Reference
Field |
Type |
Description |
|---|---|---|
|
string |
Required. Must be |
|
string |
Name of the viewer instance used as the ROS node name. Default: |
|
string |
ROS namespace of the dVRK console, used to discover teleop and PSM topics for
the HUD overlay. Default: |
|
array |
List of ROS image streams to publish. Accepted values: |
|
number |
Opacity of the HUD overlay icons (0.0 = transparent, 1.0 = opaque). Default: |
|
boolean |
When |
|
integer |
Horizontal pixel offset applied symmetrically to each eye’s crop window so that
the stereo display presents content at the surgeon’s working depth. Set by the
calibration tool ( |
|
array |
Display output sinks. |
|
array |
Zero-copy shared-memory outputs via Unix file-descriptor sockets. Each entry is
an object with a mandatory |
|
string |
Deprecated shorthand. Sets a single stereo unixfd socket path. Prefer
|
|
object |
Optional picture-in-picture streams composited into the bottom of each eye. See Extra Streams below. |
camera Object
The required camera object groups all camera-related settings:
Field |
Type |
Description |
|---|---|---|
|
integer |
Required. Native frame dimensions of each camera in pixels. |
|
string |
Required. GStreamer pipeline fragment for the left camera. Must produce a
raw video pad at the resolution declared in |
|
string |
Required. GStreamer pipeline fragment for the right camera. Must match left dimensions and frame rate. |
|
object |
Per-eye color correction applied via a |
|
integer |
Size of the cropped eye region used for alignment. Defaults to |
|
integer |
Horizontal baseline shift in pixels applied symmetrically in opposite directions
to the left and right crop windows to align the stereo pair. Positive values
converge the images; negative values diverge them. Set by the calibration tool
(← / → arrow keys). Default: |
|
integer |
Vertical shift in pixels applied symmetrically to correct vertical misalignment
between the two cameras. Set by the calibration tool (↑ / ↓ arrow keys).
Default: |
Extra Streams
The optional extra_streams object composites additional video sources as a
picture-in-picture strip at the bottom of each eye. At most two extra streams
(mono or stereo pairs) are supported:
Field |
Type |
Description |
|---|---|---|
|
array of strings |
GStreamer pipeline fragments for additional mono sources. Each stream is displayed in both the left and right eye views. |
|
array of objects |
Additional stereo pairs, each with a |
|
number |
Fraction of eye height reserved for the extra-stream strip (0.01–0.99).
Default: |
Geometric Scaling & Size Preservation
GStreamer crops each eye by computing asymmetric left/right and top/bottom crop
values from camera.alignment.horizontal_shift_px,
camera.alignment.vertical_shift_px, and camera.crop.
When preserve_size is true, an additional aspect-ratio crop is applied
before videoscale upscales the result back to camera.size. This
eliminates black borders without distorting the image.
The display_horizontal_offset_px is folded into the same videocrop
element: the left eye’s crop window shifts left and the right eye’s shifts right
by the same total offset, so the mixer remains a plain side-by-side compositor
with no xpos adjustments.
Color Calibration
camera.left.color and camera.right.color inject videobalance
GStreamer elements per eye. Adjusting brightness, contrast,
saturation, and hue corrects manufacturing differences or lighting
imbalances between the two lenses. Use the Calibration Tool c key to
cycle through automatic matching modes.
Example Configurations
The package ships ready-to-use configuration files under share/:
stereo_viewer.json— GStreamer test sources with a unixfd stereo socket.stereo_v4l2_gooviz.json— V4L2 cameras with color calibration and a display offset for Gooviz displays.decklink_gooviz.json— Blackmagic Decklink capture cards with Gooviz per-eye displays.doc_stereo_simple.json/doc_stereo_complex.json— Minimal and feature-complete documentation templates.stereo_config.schema.json— Formal JSON Schema for offline validation.