Post-Processing Mode
1. Live acquisitionRead images, depth, and force outputs from each captured frame.
2. Export runtimeSave sensor configuration and the reference image for offline solving.
3. Offline replayFeed raw or rectified images to the Solver and reproduce algorithm outputs.
Live acquisition
The SDK returns live data. The following example only acquires data in a loop; callers that need persistence must add their own file-writing logic:
from xensesdk import Sensor
sensor = Sensor.create("OP000064")
try:
while True:
rectify, depth = sensor.selectSensorInfo(
Sensor.OutputType.Rectify,
Sensor.OutputType.Depth,
)
finally:
sensor.release()
Export a runtime
sensor.exportRuntimeConfig("./recording")
# Generates ./recording/runtime_<sensor serial number>
Protect runtime files
The runtime contains the configuration and reference image and is encrypted. Do not edit it manually or commit it to a public repository.
Offline replay
Offline mode is suitable for regression testing and algorithm tuning.
solver = Sensor.createSolver("./recording/runtime_OP000064")
try:
depth, force = solver.selectSensorInfo(
Sensor.OutputType.Depth,
Sensor.OutputType.Force,
rectify_image=rectify_image,
)
finally:
solver.release()
In solver mode, selectSensorInfo() requires raw_image or rectify_image. For reproducible tests, preserve input frame order and record the SDK, model, and configuration versions.
More code examplesSee how to export a runtime, feed rectified images to the Solver frame by frame, and visualize inference results.
Open GitHub example ↗