Is spatial mapping enabled for a virtual ZED X One S stereo pair

Hello,

I would like to use the spatial mapping feature for a virtual stereo pair composed of two ZED X One S cameras. After reading the documentation, I noticed it explicitly says that it is not enabled for these cameras since they are monocular and don’t generate a depth map. However, a virtual pair does generate a depth map and since this ZED camera model does have an IMU I figured it is possible to do spatial mapping for this configuration. Is this a feature that is available for this configuration?

Hi,

Yes, this works! The documentation note about Spatial Mapping refers to a single ZED X One, which is monocular. Once you calibrate two of them as a virtual stereo pair, the SDK sees a single stereo device with depth and IMU : exactly what Spatial Mapping needs.
Three steps:

  1. Mount both cameras rigidly, parallel, at a fixed baseline (they must not move relative to each other).
  2. Calibrate the pair with the Stereo Calibration Tool:
./zed_stereo_calibration --virtual --left_sn <left_serial> --right_sn <right_serial> --h_edges 12 --v_edges 9 --square_size 30.0

Guide: https://www.stereolabs.com/docs/products/cameras/zedxone/dual-camera-stereo-vision
3. Enable the feature — open the calibrated pair, then:

zed.enablePositionalTracking(); // required first
zed.enableSpatialMapping(SpatialMappingParameters());

Module reference: https://docs.stereolabs.com/docs/development/zed-sdk/modules/spatial-mapping
Tip: mapping quality follows depth quality, so a careful calibration and a baseline suited to your range make a real difference.

1 Like