feat(zed): export depth at neural optimal resolution
Restrict ZED depth export to neural modes and default offline MCAP conversion to the SDK-selected optimal depth size instead of camera resolution. Add a configurable --depth-size option, propagate the actual returned depth dimensions into DepthMap metadata, and emit a dedicated depth calibration topic when depth resolution differs from video. Update the batch and recording helper scripts to use the new neural-only depth mode surface and pass through depth sizing. Verification: - cmake --build build --target zed_svo_to_mcap mcap_multi_record_tester mcap_pose_record_tester -j4 - build/bin/mcap_multi_record_tester - build/bin/mcap_pose_record_tester - build/bin/zed_svo_to_mcap --input /workspaces/data/kindergarten/jump/experiment/2/2026-03-18T11-27-15/2026-03-18T11-27-15_zed4.svo2 --output /tmp/zed4_neural_optimal_test.mcap --codec h264 --encoder-device software --mcap-compression zstd --depth-mode neural --depth-size optimal --start-frame 0 --end-frame 9
This commit is contained in:
@@ -34,6 +34,7 @@ class BatchConfig:
|
||||
encoder_device: str
|
||||
mcap_compression: str
|
||||
depth_mode: str
|
||||
depth_size: str
|
||||
with_pose: bool
|
||||
pose_config: Path | None
|
||||
world_frame_id: str | None
|
||||
@@ -287,6 +288,8 @@ def command_for_job(job: ConversionJob, config: BatchConfig) -> list[str]:
|
||||
config.mcap_compression,
|
||||
"--depth-mode",
|
||||
config.depth_mode,
|
||||
"--depth-size",
|
||||
config.depth_size,
|
||||
]
|
||||
if config.with_pose:
|
||||
command.append("--with-pose")
|
||||
@@ -564,8 +567,14 @@ def run_batch(jobs: list[ConversionJob], config: BatchConfig, jobs_limit: int) -
|
||||
)
|
||||
@click.option(
|
||||
"--depth-mode",
|
||||
type=click.Choice(("neural", "quality", "performance", "ultra")),
|
||||
default="quality",
|
||||
type=click.Choice(("neural_light", "neural", "neural_plus")),
|
||||
default="neural",
|
||||
show_default=True,
|
||||
)
|
||||
@click.option(
|
||||
"--depth-size",
|
||||
type=str,
|
||||
default="optimal",
|
||||
show_default=True,
|
||||
)
|
||||
@click.option("--with-pose", is_flag=True, help="Enable per-camera positional tracking export when available.")
|
||||
@@ -615,6 +624,7 @@ def main(
|
||||
encoder_device: str,
|
||||
mcap_compression: str,
|
||||
depth_mode: str,
|
||||
depth_size: str,
|
||||
with_pose: bool,
|
||||
pose_config: Path | None,
|
||||
world_frame_id: str | None,
|
||||
@@ -638,6 +648,7 @@ def main(
|
||||
encoder_device=encoder_device,
|
||||
mcap_compression=mcap_compression,
|
||||
depth_mode=depth_mode,
|
||||
depth_size=depth_size,
|
||||
with_pose=with_pose,
|
||||
pose_config=pose_config.expanduser().resolve() if pose_config is not None else None,
|
||||
world_frame_id=world_frame_id,
|
||||
|
||||
@@ -66,10 +66,15 @@ def parse_args() -> argparse.Namespace:
|
||||
)
|
||||
parser.add_argument(
|
||||
"--depth-mode",
|
||||
choices=("neural", "quality", "performance", "ultra"),
|
||||
choices=("neural_light", "neural", "neural_plus"),
|
||||
default="neural",
|
||||
help="Depth mode passed to zed_svo_to_mcap",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--depth-size",
|
||||
default="optimal",
|
||||
help="Depth size passed to zed_svo_to_mcap (optimal|native|<width>x<height>)",
|
||||
)
|
||||
parser.add_argument("--start-frame", type=int, default=0, help="First SVO frame to convert")
|
||||
parser.add_argument("--end-frame", type=int, help="Last SVO frame to convert")
|
||||
parser.add_argument(
|
||||
@@ -289,6 +294,8 @@ def convert_svo(
|
||||
args.mcap_compression,
|
||||
"--depth-mode",
|
||||
args.depth_mode,
|
||||
"--depth-size",
|
||||
args.depth_size,
|
||||
"--start-frame",
|
||||
str(args.start_frame),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user