@depz/camera-sdk-linux-arm64 0.0.0-stage → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/LICENSE +182 -0
  2. package/README.md +2 -2
  3. package/depz-engines/libdepz_engine_mnn.so +0 -0
  4. package/depz-engines/libdepz_engine_onnx.so +0 -0
  5. package/depz-engines/libdepz_engine_openvino.so +0 -0
  6. package/depz-engines/libdepz_engine_rknn.so +0 -0
  7. package/depz-engines/libdepz_engine_tensorrt.so +0 -0
  8. package/depz-engines/mnn-3.6.2/LICENSE.txt +201 -0
  9. package/depz-engines/mnn-3.6.2/libMNN.so +0 -0
  10. package/depz_node.node +0 -0
  11. package/doc/EULA +182 -0
  12. package/doc/LICENSE +202 -0
  13. package/doc/NOTICE +41 -0
  14. package/doc/c/api.md +5022 -0
  15. package/doc/c/clarity/api.md +17 -0
  16. package/doc/c/clarity/guide.md +73 -0
  17. package/doc/c/clarity/introduction.md +24 -0
  18. package/doc/c/guide.md +125 -0
  19. package/doc/c/intro.md +62 -0
  20. package/doc/c/minima/api.md +17 -0
  21. package/doc/c/minima/guide.md +83 -0
  22. package/doc/c/minima/introduction.md +26 -0
  23. package/doc/c/odin/api.md +17 -0
  24. package/doc/c/odin/guide.md +44 -0
  25. package/doc/c/odin/introduction.md +24 -0
  26. package/doc/c/odin-mini/api.md +17 -0
  27. package/doc/c/odin-mini/guide.md +44 -0
  28. package/doc/c/odin-mini/introduction.md +24 -0
  29. package/doc/c/varius/api.md +17 -0
  30. package/doc/c/varius/guide.md +83 -0
  31. package/doc/c/varius/introduction.md +70 -0
  32. package/doc/c/varius-v/api.md +17 -0
  33. package/doc/c/varius-v/guide.md +85 -0
  34. package/doc/c/varius-v/introduction.md +32 -0
  35. package/doc/cpp/api.md +1924 -0
  36. package/doc/cpp/clarity/api.md +14 -0
  37. package/doc/cpp/clarity/guide.md +73 -0
  38. package/doc/cpp/clarity/introduction.md +24 -0
  39. package/doc/cpp/guide.md +88 -0
  40. package/doc/cpp/intro.md +29 -0
  41. package/doc/cpp/minima/api.md +14 -0
  42. package/doc/cpp/minima/guide.md +83 -0
  43. package/doc/cpp/minima/introduction.md +26 -0
  44. package/doc/cpp/odin/api.md +14 -0
  45. package/doc/cpp/odin/guide.md +44 -0
  46. package/doc/cpp/odin/introduction.md +24 -0
  47. package/doc/cpp/odin-mini/api.md +14 -0
  48. package/doc/cpp/odin-mini/guide.md +44 -0
  49. package/doc/cpp/odin-mini/introduction.md +24 -0
  50. package/doc/cpp/varius/api.md +14 -0
  51. package/doc/cpp/varius/guide.md +83 -0
  52. package/doc/cpp/varius/introduction.md +70 -0
  53. package/doc/cpp/varius-v/api.md +14 -0
  54. package/doc/cpp/varius-v/guide.md +85 -0
  55. package/doc/cpp/varius-v/introduction.md +32 -0
  56. package/doc/third_party/eigen/COPYING.MPL2 +373 -0
  57. package/doc/third_party/eigen/COPYING.README +18 -0
  58. package/doc/third_party/miniz/LICENSE +22 -0
  59. package/doc/third_party/nlohmann_json/LICENSE.MIT +21 -0
  60. package/doc/third_party/opencv/SoftFloat-COPYING.txt +36 -0
  61. package/doc/third_party/opencv/dlpack-LICENSE +201 -0
  62. package/doc/third_party/opencv/features2d-LICENSE.AKAZE +26 -0
  63. package/doc/third_party/opencv/features2d-LICENSE.KAZE +26 -0
  64. package/doc/third_party/opencv/libjpeg-turbo-LICENSE.md +135 -0
  65. package/doc/third_party/opencv/libjpeg-turbo-README.ijg +260 -0
  66. package/doc/third_party/opencv/libjpeg-turbo-README.md +375 -0
  67. package/doc/third_party/opencv/mscr-chi_table_LICENSE.txt +28 -0
  68. package/doc/third_party/opencv/zlib-LICENSE +22 -0
  69. package/libdepz.so.1 +0 -0
  70. package/libdepz_depth.so.1 +0 -0
  71. package/libdepz_inference.so.1 +0 -0
  72. package/package.json +28 -4
package/doc/cpp/api.md ADDED
@@ -0,0 +1,1924 @@
1
+ <!-- SPDX-License-Identifier: Apache-2.0 -->
2
+ <!-- GENERATED from the headers in include/depz/. Do not edit. -->
3
+ # API reference
4
+
5
+ Generated from the public header `depz/depz.hpp` (`include/depz/`), the
6
+ header-only C++17 wrapper over the C API: its declarations and doc-comments. Edit
7
+ the doc-comments in the header, not this file.
8
+
9
+ ## Contents
10
+
11
+ - **Errors**: [`ErrorCode`](#errorcode), [`code_name`](#code_name), [`DepzError`](#depzerror)
12
+ - **The records: the C structs under the reference's names**: [`CaptureMode`](#capturemode), [`SourceInfo`](#sourceinfo), [`FrameTiming`](#frametiming), [`PipelineInfo`](#pipelineinfo), [`PipelineMetrics`](#pipelinemetrics), [`Control`](#control), [`RecalibrationConfig`](#recalibrationconfig), [`RecalibrationStatus`](#recalibrationstatus), [`RecalibrationEvent`](#recalibrationevent), [`RecordingStatus`](#recordingstatus), [`RecordingResult`](#recordingresult), [`EngineInfo`](#engineinfo), [`ModelVariantInfo`](#modelvariantinfo), [`PipelineConfig`](#pipelineconfig), [`ReplayOptions`](#replayoptions), [`pipeline_config`](#pipeline_config), [`replay_options`](#replay_options), [`recalibration_config`](#recalibration_config)
13
+ - **Base: depz/depz.h**: [`version`](#version), [`host_clock_ns`](#host_clock_ns), [`Context`](#context), [`Calibration`](#calibration), [`CameraInfo`](#camerainfo), [`CameraStatus`](#camerastatus), [`scan_cameras`](#scan_cameras), [`find_camera`](#find_camera), [`Frame`](#frame), [`board_info`](#board_info), [`Source`](#source), [`StageHandle`](#stagehandle), [`Recording`](#recording), [`CameraModel`](#cameramodel), [`camera_model_of_serial`](#camera_model_of_serial), [`camera_model_of_pid`](#camera_model_of_pid), [`camera_model_of_sku`](#camera_model_of_sku), [`ControlSet`](#controlset), [`Recalibration`](#recalibration), [`Pipeline`](#pipeline)
14
+ - **Inference: depz/inference.h**: [`Inference`](#inference), [`EngineOutputs`](#engineoutputs), [`EngineSession`](#enginesession), [`ModelInfo`](#modelinfo), [`list_models`](#list_models), [`is_model_cached`](#is_model_cached), [`download_model`](#download_model), [`describe_engines`](#describe_engines), [`ModelSupport`](#modelsupport), [`model_support`](#model_support), [`InputSizes`](#inputsizes), [`model_input_sizes`](#model_input_sizes), [`model_files`](#model_files), [`ModelDefault`](#modeldefault), [`model_default`](#model_default), [`EngineSlug`](#engineslug), [`parse_engine_slug`](#parse_engine_slug)
15
+ - **Depth: depz/depth.h**: [`make_depth_stage`](#make_depth_stage)
16
+ - **Extensions**: [`FrameSource`](#framesource), [`make_source`](#make_source), [`mkv_source`](#mkv_source), [`StageGeometry`](#stagegeometry), [`Stage`](#stage), [`make_stage`](#make_stage), [`EngineModel`](#enginemodel), [`Engine`](#engine), [`register_engine`](#register_engine), [`unregister_engine`](#unregister_engine), [`Model`](#model), [`make_inference`](#make_inference)
17
+
18
+ ## Conventions
19
+
20
+ DEPZ Camera SDK - the C++ wrapper of the C API (header only).
21
+
22
+ Over depz/depz.h, depz/inference.h and depz/depth.h: RAII handles (a handle
23
+ releases its reference when it goes), failures as one exception type,
24
+ DepzError(code, message, details), with ErrorCode - the reference's model
25
+ (Python depz_camera_sdk.DepzError, ErrorCode; c_api.md section 6) - and
26
+ base classes for the extensions (Python: FrameSource, Stage,
27
+ InferenceEngine, DepthInferenceBase; c_api.md section 12).
28
+
29
+ C++17 or later. Only what a program calls is linked: a program that uses
30
+ only the base needs only libdepz.
31
+
32
+ ## Errors
33
+
34
+ ### ErrorCode
35
+
36
+ ```cpp
37
+ enum class ErrorCode : depz_status {
38
+ OK = DEPZ_OK,
39
+ /* BEGIN errors.json */
40
+ ABORTED = DEPZ_E_ABORTED,
41
+ DOWNLOAD_FAILED = DEPZ_E_DOWNLOAD_FAILED,
42
+ LEGACY_CAMERA = DEPZ_E_LEGACY_CAMERA,
43
+ INVALID_SERIAL = DEPZ_E_INVALID_SERIAL,
44
+ UNRECOGNISED_CAMERA = DEPZ_E_UNRECOGNISED_CAMERA,
45
+ CAMERA_NOT_FOUND = DEPZ_E_CAMERA_NOT_FOUND,
46
+ CAMERA_BUSY = DEPZ_E_CAMERA_BUSY,
47
+ CAMERA_PERMISSION_DENIED = DEPZ_E_CAMERA_PERMISSION_DENIED,
48
+ NO_CALIBRATION = DEPZ_E_NO_CALIBRATION,
49
+ UNSUPPORTED_SCHEME = DEPZ_E_UNSUPPORTED_SCHEME,
50
+ UNKNOWN_CAMERA_FAMILY = DEPZ_E_UNKNOWN_CAMERA_FAMILY,
51
+ USB_BANDWIDTH = DEPZ_E_USB_BANDWIDTH,
52
+ NO_FRAMES = DEPZ_E_NO_FRAMES,
53
+ CAPTURE_STOPPED = DEPZ_E_CAPTURE_STOPPED,
54
+ RECORDING_NEEDS_MIGRATION = DEPZ_E_RECORDING_NEEDS_MIGRATION,
55
+ RECALIBRATION_DEFERRED = DEPZ_E_RECALIBRATION_DEFERRED,
56
+ MODEL_NEEDS_STEREO = DEPZ_E_MODEL_NEEDS_STEREO,
57
+ RECORDING_UNSUPPORTED = DEPZ_E_RECORDING_UNSUPPORTED,
58
+ MODEL_NOT_OFFERED = DEPZ_E_MODEL_NOT_OFFERED,
59
+ MODE_NOT_OFFERED = DEPZ_E_MODE_NOT_OFFERED,
60
+ CALIBRATION_MALFORMED = DEPZ_E_CALIBRATION_MALFORMED,
61
+ CALIBRATION_WEB = DEPZ_E_CALIBRATION_WEB,
62
+ FLASH_DEVICE = DEPZ_E_FLASH_DEVICE,
63
+ FIRMWARE_IMAGE = DEPZ_E_FIRMWARE_IMAGE,
64
+ FLASH_ABORTED = DEPZ_E_FLASH_ABORTED,
65
+ UNAVAILABLE = DEPZ_E_UNAVAILABLE,
66
+ UNSUPPORTED_PLATFORM = DEPZ_E_UNSUPPORTED_PLATFORM,
67
+ INVALID_ARGUMENT = DEPZ_E_INVALID_ARGUMENT,
68
+ NOT_FOUND = DEPZ_E_NOT_FOUND,
69
+ IO_ERROR = DEPZ_E_IO_ERROR,
70
+ TIMEOUT = DEPZ_E_TIMEOUT,
71
+ INTERNAL = DEPZ_E_INTERNAL,
72
+ INVALID_STATE = DEPZ_E_INVALID_STATE,
73
+ BUSY = DEPZ_E_BUSY,
74
+ NOT_IMPLEMENTED = DEPZ_E_NOT_IMPLEMENTED,
75
+ UNSUPPORTED_VERSION = DEPZ_E_UNSUPPORTED_VERSION,
76
+ END_OF_STREAM = DEPZ_E_END_OF_STREAM,
77
+ ENGINE_BUILD_FAILED = DEPZ_E_ENGINE_BUILD_FAILED,
78
+ INVALID_DATA = DEPZ_E_INVALID_DATA,
79
+ CALIBRATION_FAILED = DEPZ_E_CALIBRATION_FAILED,
80
+ ENGINE_WRONG_DEVICE = DEPZ_E_ENGINE_WRONG_DEVICE,
81
+ ENGINE_DEVICE_LOST = DEPZ_E_ENGINE_DEVICE_LOST
82
+ /* END errors.json */
83
+ };
84
+ ```
85
+
86
+ The error codes: the C status values; the names of contracts/errors.json
87
+ upper-cased, as Python's ErrorCode members. GENERATED by
88
+ scripts/export_contracts.py (the block between the markers).
89
+
90
+ ### code_name
91
+
92
+ ```cpp
93
+ inline const char *code_name(ErrorCode c) noexcept;
94
+ ```
95
+
96
+ The code's name as in errors.json ("camera_busy").
97
+
98
+ ### DepzError
99
+
100
+ ```cpp
101
+ class DepzError : public std::runtime_error {
102
+ // (no public data members)
103
+ };
104
+ ```
105
+
106
+ The one exception of the SDK: code, message (short English, for logs) and
107
+ details (a JSON object).
108
+
109
+ #### DepzError.DepzError
110
+
111
+ ```cpp
112
+ DepzError(ErrorCode code, const std::string &message, std::string details = "{}");
113
+ ```
114
+
115
+ #### DepzError.code
116
+
117
+ ```cpp
118
+ ErrorCode code() const noexcept;
119
+ ```
120
+
121
+ #### DepzError.message
122
+
123
+ ```cpp
124
+ std::string message() const;
125
+ ```
126
+
127
+ #### DepzError.details
128
+
129
+ ```cpp
130
+ const std::string &details() const noexcept;
131
+ ```
132
+
133
+ #### DepzError.last
134
+
135
+ ```cpp
136
+ static DepzError last(depz_status s);
137
+ ```
138
+
139
+ The failure of the last call on this thread that returned s.
140
+
141
+ ## The records: the C structs under the reference's names
142
+
143
+ (contracts/sdk/bindings/cpp_map.json: each alias's Python class)
144
+
145
+ ### CaptureMode
146
+
147
+ ```cpp
148
+ using CaptureMode = depz_mode_t;
149
+ ```
150
+
151
+ ### SourceInfo
152
+
153
+ ```cpp
154
+ using SourceInfo = depz_source_info_t;
155
+ ```
156
+
157
+ ### FrameTiming
158
+
159
+ ```cpp
160
+ using FrameTiming = depz_frame_timing_t;
161
+ ```
162
+
163
+ ### PipelineInfo
164
+
165
+ ```cpp
166
+ using PipelineInfo = depz_pipeline_info_t;
167
+ ```
168
+
169
+ ### PipelineMetrics
170
+
171
+ ```cpp
172
+ using PipelineMetrics = depz_pipeline_metrics_t;
173
+ ```
174
+
175
+ ### Control
176
+
177
+ ```cpp
178
+ using Control = depz_control_t;
179
+ ```
180
+
181
+ ### RecalibrationConfig
182
+
183
+ ```cpp
184
+ using RecalibrationConfig = depz_recal_config_t;
185
+ ```
186
+
187
+ ### RecalibrationStatus
188
+
189
+ ```cpp
190
+ using RecalibrationStatus = depz_recal_status_t;
191
+ ```
192
+
193
+ ### RecalibrationEvent
194
+
195
+ ```cpp
196
+ using RecalibrationEvent = depz_recal_event_t;
197
+ ```
198
+
199
+ ### RecordingStatus
200
+
201
+ ```cpp
202
+ using RecordingStatus = depz_recording_status_t;
203
+ ```
204
+
205
+ ### RecordingResult
206
+
207
+ ```cpp
208
+ using RecordingResult = depz_recording_result_t;
209
+ ```
210
+
211
+ ### EngineInfo
212
+
213
+ ```cpp
214
+ using EngineInfo = depz_engine_info_t;
215
+ ```
216
+
217
+ ### ModelVariantInfo
218
+
219
+ ```cpp
220
+ using ModelVariantInfo = depz_model_variant_t;
221
+ ```
222
+
223
+ ### PipelineConfig
224
+
225
+ ```cpp
226
+ using PipelineConfig = depz_pipeline_config_t;
227
+ ```
228
+
229
+ ### ReplayOptions
230
+
231
+ ```cpp
232
+ using ReplayOptions = depz_replay_options_t;
233
+ ```
234
+
235
+ ### pipeline_config
236
+
237
+ ```cpp
238
+ inline PipelineConfig pipeline_config();
239
+ ```
240
+
241
+ The option records with every default set (their C \*\_init).
242
+
243
+ ### replay_options
244
+
245
+ ```cpp
246
+ inline ReplayOptions replay_options();
247
+ ```
248
+
249
+ See [`pipeline_config`](#pipeline_config).
250
+
251
+ ### recalibration_config
252
+
253
+ ```cpp
254
+ inline RecalibrationConfig recalibration_config();
255
+ ```
256
+
257
+ See [`pipeline_config`](#pipeline_config).
258
+
259
+ ## Base: depz/depz.h
260
+
261
+ ### version
262
+
263
+ ```cpp
264
+ inline const char *version() noexcept;
265
+ ```
266
+
267
+ ### host_clock_ns
268
+
269
+ ```cpp
270
+ inline int64_t host_clock_ns() noexcept;
271
+ ```
272
+
273
+ ### Context
274
+
275
+ ```cpp
276
+ class Context : public detail::Handle<depz_context, depz_context_release> {
277
+ // (no public data members)
278
+ };
279
+ ```
280
+
281
+ #### Context.create
282
+
283
+ ```cpp
284
+ static Context create(const depz_config_t *cfg = nullptr);
285
+ ```
286
+
287
+ cfg nullptr: the defaults (depz_config_init).
288
+
289
+ ### Calibration
290
+
291
+ ```cpp
292
+ class Calibration : public detail::Handle<depz_calibration, depz_calibration_release> {
293
+ // (no public data members)
294
+ };
295
+ ```
296
+
297
+ A calibration: a value; every change makes a new one (Python: Calibration).
298
+
299
+ #### Calibration.from_json
300
+
301
+ ```cpp
302
+ static Calibration from_json(const std::string &json);
303
+ ```
304
+
305
+ #### Calibration.info
306
+
307
+ ```cpp
308
+ depz_calibration_info_t info() const;
309
+ ```
310
+
311
+ #### Calibration.is_stereo
312
+
313
+ ```cpp
314
+ bool is_stereo() const;
315
+ ```
316
+
317
+ #### Calibration.baseline_m
318
+
319
+ ```cpp
320
+ double baseline_m() const;
321
+ ```
322
+
323
+ 0 for a mono calibration.
324
+
325
+ #### Calibration.lens_model
326
+
327
+ ```cpp
328
+ std::string lens_model() const;
329
+ ```
330
+
331
+ "opencv5", "opencv8", "kb4", "eucm", "splined" (Python: LensModel's value).
332
+
333
+ #### Calibration.image_width
334
+
335
+ ```cpp
336
+ int32_t image_width() const;
337
+ ```
338
+
339
+ #### Calibration.image_height
340
+
341
+ ```cpp
342
+ int32_t image_height() const;
343
+ ```
344
+
345
+ #### Calibration.to_json
346
+
347
+ ```cpp
348
+ std::string to_json() const;
349
+ ```
350
+
351
+ The SDK calibration JSON (contracts/calibration/sdk_json.md).
352
+
353
+ #### Calibration.rescaled
354
+
355
+ ```cpp
356
+ Calibration rescaled(int32_t width, int32_t height) const;
357
+ ```
358
+
359
+ #### Calibration.controls
360
+
361
+ ```cpp
362
+ std::vector<depz_control_t> controls() const;
363
+ ```
364
+
365
+ #### Calibration.control_enum_member
366
+
367
+ ```cpp
368
+ depz_enum_member_t control_enum_member(const char *name, size_t i) const;
369
+ ```
370
+
371
+ #### Calibration.with_control
372
+
373
+ ```cpp
374
+ Calibration with_control(const char *name, double value) const;
375
+ ```
376
+
377
+ ```cpp
378
+ Calibration with_control(const char *name, const char *value) const;
379
+ ```
380
+
381
+ #### Calibration.with_canvas
382
+
383
+ ```cpp
384
+ Calibration with_canvas(const depz_canvas_options_t &opt) const;
385
+ ```
386
+
387
+ #### Calibration.canvas_layout
388
+
389
+ ```cpp
390
+ depz_canvas_layout_t canvas_layout() const;
391
+ ```
392
+
393
+ #### Calibration.canvas_projection
394
+
395
+ ```cpp
396
+ bool canvas_projection(depz_eye eye, double out[12]) const;
397
+ ```
398
+
399
+ The eye's canvas projection (3 x 4, row major); false for a latitude-longitude canvas.
400
+
401
+ #### Calibration.canvas_map
402
+
403
+ ```cpp
404
+ void canvas_map(depz_eye eye, std::vector<int16_t> &xy, std::vector<uint16_t> &index) const;
405
+ ```
406
+
407
+ The fixed-point maps of an eye: xy (2 per pixel), index (1 per pixel).
408
+
409
+ #### Calibration.rectify
410
+
411
+ ```cpp
412
+ void rectify(depz_eye eye, const depz_image_t &raw, void *out, int32_t out_stride_bytes) const;
413
+ ```
414
+
415
+ #### Calibration.disparity_to_depth
416
+
417
+ ```cpp
418
+ void disparity_to_depth(const float *disparity, int32_t width, int32_t height, float *depth) const;
419
+ ```
420
+
421
+ #### Calibration.depth_to_point_cloud
422
+
423
+ ```cpp
424
+ void depth_to_point_cloud(const float *depth, int32_t width, int32_t height, float *points) const;
425
+ ```
426
+
427
+ ### CameraInfo
428
+
429
+ ```cpp
430
+ class CameraInfo : public detail::Handle<depz_camera, depz_camera_release> {
431
+ // (no public data members)
432
+ };
433
+ ```
434
+
435
+ A resolved camera: identity, capture modes, calibration; holds no device open.
436
+ Python: CameraInfo.
437
+
438
+ #### CameraInfo.info
439
+
440
+ ```cpp
441
+ depz_camera_info_t info() const;
442
+ ```
443
+
444
+ #### CameraInfo.serial
445
+
446
+ ```cpp
447
+ std::string serial() const;
448
+ ```
449
+
450
+ #### CameraInfo.name
451
+
452
+ ```cpp
453
+ std::string name() const;
454
+ ```
455
+
456
+ #### CameraInfo.camera_family
457
+
458
+ ```cpp
459
+ std::string camera_family() const;
460
+ ```
461
+
462
+ "varius", "minima", "clarity", "odin", "odin_mini".
463
+
464
+ #### CameraInfo.eye_rotation_deg
465
+
466
+ ```cpp
467
+ int32_t eye_rotation_deg() const;
468
+ ```
469
+
470
+ 0, 90, -90 (a Varius V: the SDK turns its eyes).
471
+
472
+ #### CameraInfo.is_stereo
473
+
474
+ ```cpp
475
+ bool is_stereo() const;
476
+ ```
477
+
478
+ #### CameraInfo.modes
479
+
480
+ ```cpp
481
+ std::vector<CaptureMode> modes() const;
482
+ ```
483
+
484
+ The capture modes the SDK offers, the default one marked (is_default).
485
+
486
+ #### CameraInfo.mode
487
+
488
+ ```cpp
489
+ CaptureMode mode() const;
490
+ ```
491
+
492
+ The default capture mode.
493
+
494
+ #### CameraInfo.base_calibration
495
+
496
+ ```cpp
497
+ Calibration base_calibration() const;
498
+ ```
499
+
500
+ The calibration stored in the camera.
501
+
502
+ #### CameraInfo.source
503
+
504
+ ```cpp
505
+ Source source(const char *mode_slug = nullptr, int32_t eye_w = 0, int32_t eye_h = 0) const;
506
+ ```
507
+
508
+ Its live source (Python: CameraSource(camera_info, mode=...)). mode_slug nullptr: the
509
+ default mode; eye_w, eye_h 0, 0: the camera's rule. Opens nothing.
510
+
511
+ ### CameraStatus
512
+
513
+ ```cpp
514
+ struct CameraStatus {
515
+ std::string serial; /* "" for a unit that shows none */
516
+ std::string name;
517
+ depz_camera_state state = DEPZ_CAMERA_UNUSABLE;
518
+ ErrorCode code = ErrorCode::OK; /* OK for a usable camera, else why not */
519
+ std::string message; /* the code's name, for logs */
520
+ std::optional<CameraInfo> camera; /* the resolved camera when usable */
521
+ };
522
+ ```
523
+
524
+ One attached camera and what it can be used for. Python: CameraStatus (camera, code,
525
+ message).
526
+
527
+ #### CameraStatus.usable
528
+
529
+ ```cpp
530
+ bool usable() const noexcept;
531
+ ```
532
+
533
+ ### scan_cameras
534
+
535
+ ```cpp
536
+ inline std::vector<CameraStatus> scan_cameras(const Context &ctx);
537
+ ```
538
+
539
+ Every attached DEPZ camera, in the order the system lists them; each one resolved (with
540
+ the closed part: its flash read). Python: scan_cameras().
541
+
542
+ ### find_camera
543
+
544
+ ```cpp
545
+ inline CameraInfo find_camera(const Context &ctx, const std::string &serial = "");
546
+ ```
547
+
548
+ The attached camera with this serial (letter case ignored), freshly resolved; "" the
549
+ first usable one. None: DepzError(CAMERA_NOT_FOUND). Python: find_camera().
550
+
551
+ ### Frame
552
+
553
+ ```cpp
554
+ class Frame {
555
+ // (no public data members)
556
+ };
557
+ ```
558
+
559
+ A frame: copying it takes one more reference.
560
+
561
+ #### Frame.Frame
562
+
563
+ ```cpp
564
+ explicit Frame(depz_frame *f) noexcept;
565
+ ```
566
+
567
+ takes the reference
568
+
569
+ #### Frame.borrow
570
+
571
+ ```cpp
572
+ static Frame borrow(depz_frame *f) noexcept;
573
+ ```
574
+
575
+ #### Frame.get
576
+
577
+ ```cpp
578
+ depz_frame *get() const noexcept;
579
+ ```
580
+
581
+ #### Frame.info
582
+
583
+ ```cpp
584
+ depz_frame_info_t info() const;
585
+ ```
586
+
587
+ #### Frame.timing
588
+
589
+ ```cpp
590
+ FrameTiming timing() const;
591
+ ```
592
+
593
+ #### Frame.has_image
594
+
595
+ ```cpp
596
+ bool has_image(depz_image_kind kind) const noexcept;
597
+ ```
598
+
599
+ #### Frame.image
600
+
601
+ ```cpp
602
+ depz_image_t image(depz_image_kind kind) const;
603
+ ```
604
+
605
+ Valid while this frame (or a copy) lives.
606
+
607
+ #### Frame.put_image
608
+
609
+ ```cpp
610
+ void put_image(depz_image_kind kind, const depz_image_t &img);
611
+ ```
612
+
613
+ Only inside a stage's process (depz_frame_put_image).
614
+
615
+ ### board_info
616
+
617
+ ```cpp
618
+ inline depz_board_info_t board_info();
619
+ ```
620
+
621
+ ### Source
622
+
623
+ ```cpp
624
+ class Source : public detail::Handle<depz_source, depz_source_release> {
625
+ // (no public data members)
626
+ };
627
+ ```
628
+
629
+ #### Source.open
630
+
631
+ ```cpp
632
+ void open();
633
+ ```
634
+
635
+ #### Source.grab
636
+
637
+ ```cpp
638
+ Frame grab(int32_t timeout_ms);
639
+ ```
640
+
641
+ #### Source.close
642
+
643
+ ```cpp
644
+ void close();
645
+ ```
646
+
647
+ #### Source.info
648
+
649
+ ```cpp
650
+ SourceInfo info() const;
651
+ ```
652
+
653
+ #### Source.recording_tracks_json
654
+
655
+ ```cpp
656
+ std::string recording_tracks_json() const;
657
+ ```
658
+
659
+ A recording's tracks ({title: [[pts_us, packet], ...]}; "{}" before open) and the
660
+ camera.json it carries. Python: MkvSource.recording_tracks(), embedded_camera_info.
661
+
662
+ #### Source.embedded_camera_info_json
663
+
664
+ ```cpp
665
+ std::string embedded_camera_info_json() const;
666
+ ```
667
+
668
+ #### Source.recorded_camera_controls_json
669
+
670
+ ```cpp
671
+ std::string recorded_camera_controls_json() const;
672
+ ```
673
+
674
+ A recording's camera controls and pipeline settings at its position, as JSON
675
+ ("{}" before the first packet). Python: MkvSource.recorded_camera_controls,
676
+ recorded_pipeline.
677
+
678
+ #### Source.recorded_pipeline_json
679
+
680
+ ```cpp
681
+ std::string recorded_pipeline_json() const;
682
+ ```
683
+
684
+ #### Source.replay_info
685
+
686
+ ```cpp
687
+ depz_replay_info_t replay_info() const;
688
+ ```
689
+
690
+ A recording's replay, asked without a grab (Python: MkvSource.frame_count, ...).
691
+
692
+ #### Source.base_calibration
693
+
694
+ ```cpp
695
+ Calibration base_calibration() const;
696
+ ```
697
+
698
+ None (an empty handle) when the source has none (DEPZ_E_UNAVAILABLE).
699
+
700
+ #### Source.active_calibration
701
+
702
+ ```cpp
703
+ Calibration active_calibration() const;
704
+ ```
705
+
706
+ #### Source.pause
707
+
708
+ ```cpp
709
+ void pause();
710
+ ```
711
+
712
+ Replay control (Python: MkvSource.pause, resume, seek_relative_us, step_one_forward / \_backward).
713
+
714
+ #### Source.resume
715
+
716
+ ```cpp
717
+ void resume();
718
+ ```
719
+
720
+ #### Source.seek_us
721
+
722
+ ```cpp
723
+ void seek_us(int64_t pts_us);
724
+ ```
725
+
726
+ #### Source.seek_frame
727
+
728
+ ```cpp
729
+ void seek_frame(int64_t frame);
730
+ ```
731
+
732
+ #### Source.step
733
+
734
+ ```cpp
735
+ void step(int32_t direction);
736
+ ```
737
+
738
+ #### Source.set_loop
739
+
740
+ ```cpp
741
+ void set_loop(bool loop);
742
+ ```
743
+
744
+ #### Source.list_camera_controls
745
+
746
+ ```cpp
747
+ std::vector<Control> list_camera_controls() const;
748
+ ```
749
+
750
+ Its camera controls (Python: CameraSource.list_camera_controls, camera_controls
751
+ get / set): depz_source_controls\_\*.
752
+
753
+ #### Source.camera_control
754
+
755
+ ```cpp
756
+ Control camera_control(const std::string &name) const;
757
+ ```
758
+
759
+ #### Source.set_camera_control
760
+
761
+ ```cpp
762
+ void set_camera_control(const std::string &name, double value);
763
+ ```
764
+
765
+ #### Source.set_initial_controls_json
766
+
767
+ ```cpp
768
+ void set_initial_controls_json(const std::string &values_json);
769
+ ```
770
+
771
+ values_json {name: value}: applied at every open (Python: CameraSource(initial_controls=...)).
772
+
773
+ #### Source.set_exposure_poll_ns
774
+
775
+ ```cpp
776
+ void set_exposure_poll_ns(int64_t poll_ns);
777
+ ```
778
+
779
+ How often the capture reads the timing controls back, ns; 0: only at the open
780
+ (Python: CameraSource(exposure_poll_s=...)).
781
+
782
+ #### Source.set_base_calibration
783
+
784
+ ```cpp
785
+ void set_base_calibration(const Calibration &cal, bool has_correction_store);
786
+ ```
787
+
788
+ A live camera's base calibration in place of the camera's own (an empty Calibration:
789
+ the camera's own again); has_correction_store only with the camera's own calibration.
790
+
791
+ ### StageHandle
792
+
793
+ ```cpp
794
+ class StageHandle : public detail::Handle<depz_stage, depz_stage_release> {
795
+ // (no public data members)
796
+ };
797
+ ```
798
+
799
+ #### StageHandle.info
800
+
801
+ ```cpp
802
+ std::string info() const;
803
+ ```
804
+
805
+ ### Recording
806
+
807
+ ```cpp
808
+ class Recording {
809
+ // (no public data members)
810
+ };
811
+ ```
812
+
813
+ A pipeline's recording (c_api.md section 9a). Python: pipeline.recording, the
814
+ Recording handle. A view: valid while its Pipeline is.
815
+
816
+ #### Recording.Recording
817
+
818
+ ```cpp
819
+ explicit Recording(depz_pipeline *p);
820
+ ```
821
+
822
+ #### Recording.start
823
+
824
+ ```cpp
825
+ void start(const std::string &path, const char *camera_controls_json = nullptr);
826
+ ```
827
+
828
+ camera_controls_json nullptr: as the camera reports them.
829
+
830
+ #### Recording.stop
831
+
832
+ ```cpp
833
+ RecordingResult stop();
834
+ ```
835
+
836
+ #### Recording.pause
837
+
838
+ ```cpp
839
+ void pause();
840
+ ```
841
+
842
+ #### Recording.resume
843
+
844
+ ```cpp
845
+ void resume();
846
+ ```
847
+
848
+ #### Recording.status
849
+
850
+ ```cpp
851
+ RecordingStatus status();
852
+ ```
853
+
854
+ Idle: all zero (Python: None).
855
+
856
+ #### Recording.capture_still
857
+
858
+ ```cpp
859
+ RecordingResult capture_still(const std::string &path, int32_t timeout_ms = 2000);
860
+ ```
861
+
862
+ ### CameraModel
863
+
864
+ ```cpp
865
+ struct CameraModel {
866
+ depz_camera_model_t record{};
867
+ std::vector<std::string> former_skus;
868
+ };
869
+ ```
870
+
871
+ The catalog's camera models (Python: CameraModel, camera_model_of_serial / \_of_pid /
872
+ \_of_sku). Each lookup: false when the catalog has no such model.
873
+
874
+ ### camera_model_of_serial
875
+
876
+ ```cpp
877
+ inline bool camera_model_of_serial(const char *serial, CameraModel &out);
878
+ ```
879
+
880
+ ### camera_model_of_pid
881
+
882
+ ```cpp
883
+ inline bool camera_model_of_pid(const char *pid, CameraModel &out);
884
+ ```
885
+
886
+ ### camera_model_of_sku
887
+
888
+ ```cpp
889
+ inline bool camera_model_of_sku(const char *sku, CameraModel &out);
890
+ ```
891
+
892
+ ### ControlSet
893
+
894
+ ```cpp
895
+ class ControlSet {
896
+ // (no public data members)
897
+ };
898
+ ```
899
+
900
+ The controls of one owner (a scope; a filter's slug or a stage's name with it). Python:
901
+ ControlSet. A view: valid while its Pipeline is.
902
+
903
+ #### ControlSet.ControlSet
904
+
905
+ ```cpp
906
+ ControlSet(depz_pipeline *p, depz_scope scope, std::string owner = "");
907
+ ```
908
+
909
+ #### ControlSet.scope
910
+
911
+ ```cpp
912
+ depz_scope scope() const noexcept;
913
+ ```
914
+
915
+ #### ControlSet.list
916
+
917
+ ```cpp
918
+ std::vector<Control> list() const;
919
+ ```
920
+
921
+ #### ControlSet.get
922
+
923
+ ```cpp
924
+ Control get(const std::string &name) const;
925
+ ```
926
+
927
+ #### ControlSet.enum_values
928
+
929
+ ```cpp
930
+ std::vector<depz_enum_member_t> enum_values(const std::string &name) const;
931
+ ```
932
+
933
+ The members of an enum control (Python: Control.enum_values).
934
+
935
+ #### ControlSet.set
936
+
937
+ ```cpp
938
+ void set(const std::string &name, double value);
939
+ ```
940
+
941
+ Coerced (clamped, snapped): get() gives the value in force.
942
+
943
+ ```cpp
944
+ void set(const std::string &name, const std::string &value);
945
+ ```
946
+
947
+ An enum of words ("continuous").
948
+
949
+ ```cpp
950
+ void set(const std::string &name, const char *value);
951
+ ```
952
+
953
+ #### ControlSet.reset
954
+
955
+ ```cpp
956
+ std::vector<std::string> reset();
957
+ ```
958
+
959
+ Every control of the set back to its default. The names not applied (Python:
960
+ reset() -> list[str]); empty when all were.
961
+
962
+ ### Recalibration
963
+
964
+ ```cpp
965
+ class Recalibration {
966
+ // (no public data members)
967
+ };
968
+ ```
969
+
970
+ A pipeline's recalibration (c_api.md; Python: pipeline.recalibration). A view: valid while
971
+ its Pipeline is.
972
+
973
+ #### Recalibration.Recalibration
974
+
975
+ ```cpp
976
+ explicit Recalibration(depz_pipeline *p);
977
+ ```
978
+
979
+ #### Recalibration.status
980
+
981
+ ```cpp
982
+ RecalibrationStatus status() const;
983
+ ```
984
+
985
+ #### Recalibration.unverified_reason
986
+
987
+ ```cpp
988
+ std::string unverified_reason(uint32_t term) const;
989
+ ```
990
+
991
+ Why one unverified term (a DEPZ_TERM\_\* bit) could not be vouched for; "" when checked.
992
+
993
+ #### Recalibration.configure
994
+
995
+ ```cpp
996
+ void configure(const RecalibrationConfig &cfg);
997
+ ```
998
+
999
+ Changes the settings while the pipeline runs.
1000
+
1001
+ #### Recalibration.trigger
1002
+
1003
+ ```cpp
1004
+ bool trigger(int32_t wait_ms = 0);
1005
+ ```
1006
+
1007
+ Recalibrates now; wait_ms 0: returns at once. True when a correction was applied.
1008
+
1009
+ #### Recalibration.reset_correction
1010
+
1011
+ ```cpp
1012
+ void reset_correction(int32_t wait_ms = 0);
1013
+ ```
1014
+
1015
+ Back to the camera's base calibration; forgets the stored correction.
1016
+
1017
+ #### Recalibration.set_reference_distance
1018
+
1019
+ ```cpp
1020
+ void set_reference_distance(double true_m, double measured_m, int32_t wait_ms = 0);
1021
+ ```
1022
+
1023
+ A point the pipeline gives at measured_m metres is true_m metres away.
1024
+
1025
+ #### Recalibration.history
1026
+
1027
+ ```cpp
1028
+ std::vector<RecalibrationEvent> history(double since_s = 0.0) const;
1029
+ ```
1030
+
1031
+ This run's changes at or after since_s (wall clock, seconds since the epoch).
1032
+
1033
+ ### Pipeline
1034
+
1035
+ ```cpp
1036
+ class Pipeline : public detail::Handle<depz_pipeline, depz_pipeline_release> {
1037
+ // (no public data members)
1038
+ };
1039
+ ```
1040
+
1041
+ #### Pipeline.create
1042
+
1043
+ ```cpp
1044
+ static Pipeline create(const Source &source, const std::vector<const StageHandle *> &stages, const depz_pipeline_config_t *cfg = nullptr);
1045
+ ```
1046
+
1047
+ cfg nullptr: the defaults (depz_pipeline_config_init).
1048
+
1049
+ #### Pipeline.start
1050
+
1051
+ ```cpp
1052
+ void start(depz_progress_fn progress = nullptr, void *user = nullptr);
1053
+ ```
1054
+
1055
+ #### Pipeline.next
1056
+
1057
+ ```cpp
1058
+ Frame next(int32_t timeout_ms);
1059
+ ```
1060
+
1061
+ The next frame; nothing within timeout_ms: DepzError(ErrorCode::TIMEOUT); the end of a
1062
+ finite source: DepzError(ErrorCode::END_OF_STREAM).
1063
+
1064
+ #### Pipeline.request_photo
1065
+
1066
+ ```cpp
1067
+ void request_photo();
1068
+ ```
1069
+
1070
+ Photo mode: the stages run on the next frame, the photo (depz_pipeline_request_photo).
1071
+
1072
+ #### Pipeline.wait_photo
1073
+
1074
+ ```cpp
1075
+ Frame wait_photo(int32_t timeout_ms);
1076
+ ```
1077
+
1078
+ The photo, the previews before it dropped; nothing within timeout_ms:
1079
+ DepzError(ErrorCode::TIMEOUT); the end of a finite source: DepzError(ErrorCode::END_OF_STREAM).
1080
+
1081
+ #### Pipeline.stop
1082
+
1083
+ ```cpp
1084
+ void stop();
1085
+ ```
1086
+
1087
+ #### Pipeline.reset_camera_source
1088
+
1089
+ ```cpp
1090
+ bool reset_camera_source(int32_t timeout_ms = -1);
1091
+ ```
1092
+
1093
+ The live source closed and opened again in place; false: nothing done (not running, not live).
1094
+
1095
+ #### Pipeline.info
1096
+
1097
+ ```cpp
1098
+ PipelineInfo info();
1099
+ ```
1100
+
1101
+ #### Pipeline.metrics
1102
+
1103
+ ```cpp
1104
+ PipelineMetrics metrics();
1105
+ ```
1106
+
1107
+ #### Pipeline.source_info
1108
+
1109
+ ```cpp
1110
+ SourceInfo source_info();
1111
+ ```
1112
+
1113
+ What its source is (Python: pipeline.source.info).
1114
+
1115
+ #### Pipeline.last_error
1116
+
1117
+ ```cpp
1118
+ std::optional<DepzError> last_error();
1119
+ ```
1120
+
1121
+ The last problem of the running pipeline (a stage that failed, no frames); none: empty.
1122
+
1123
+ #### Pipeline.active_calibration
1124
+
1125
+ ```cpp
1126
+ Calibration active_calibration();
1127
+ ```
1128
+
1129
+ The calibration in force now, with its correction: a snapshot.
1130
+
1131
+ #### Pipeline.set_calibration
1132
+
1133
+ ```cpp
1134
+ void set_calibration(const Calibration &cal);
1135
+ ```
1136
+
1137
+ Rectify with cal from now on; recalibration corrects it from then on (Python:
1138
+ Pipeline.set_calibration).
1139
+
1140
+ #### Pipeline.apply_correction
1141
+
1142
+ ```cpp
1143
+ void apply_correction(double pitch, double roll, double yaw, double ty);
1144
+ ```
1145
+
1146
+ Correct the source's calibration by a correction, radians; absolute against it (Python:
1147
+ Pipeline.apply_correction). Stereo only.
1148
+
1149
+ #### Pipeline.controls
1150
+
1151
+ ```cpp
1152
+ ControlSet controls(depz_scope scope, const std::string &owner = "");
1153
+ ```
1154
+
1155
+ The controls of one owner: DEPZ_SCOPE\_\*, with a filter's slug or a stage's name.
1156
+
1157
+ #### Pipeline.recalibration
1158
+
1159
+ ```cpp
1160
+ Recalibration recalibration();
1161
+ ```
1162
+
1163
+ #### Pipeline.set_stream_enabled
1164
+
1165
+ ```cpp
1166
+ void set_stream_enabled(uint32_t stream, bool enabled, bool cascade = false);
1167
+ ```
1168
+
1169
+ One stream on or off (Python: set_stream_enabled). On switches on what it needs;
1170
+ off is refused while a stream that stays on needs it (DepzError INVALID_ARGUMENT)
1171
+ unless cascade, which switches those off too.
1172
+
1173
+ #### Pipeline.recording
1174
+
1175
+ ```cpp
1176
+ Recording recording();
1177
+ ```
1178
+
1179
+ The pipeline's recording (Python: pipeline.recording).
1180
+
1181
+ #### Pipeline.replay_pause
1182
+
1183
+ ```cpp
1184
+ void replay_pause();
1185
+ ```
1186
+
1187
+ The pipeline's replay (Python: pipeline.replay); a live source: DepzError INVALID_ARGUMENT.
1188
+
1189
+ #### Pipeline.replay_resume
1190
+
1191
+ ```cpp
1192
+ void replay_resume();
1193
+ ```
1194
+
1195
+ #### Pipeline.replay_seek_us
1196
+
1197
+ ```cpp
1198
+ void replay_seek_us(int64_t pts_us);
1199
+ ```
1200
+
1201
+ #### Pipeline.replay_seek_frame
1202
+
1203
+ ```cpp
1204
+ void replay_seek_frame(int64_t frame);
1205
+ ```
1206
+
1207
+ #### Pipeline.replay_step
1208
+
1209
+ ```cpp
1210
+ void replay_step(int32_t direction);
1211
+ ```
1212
+
1213
+ #### Pipeline.replay_status
1214
+
1215
+ ```cpp
1216
+ depz_replay_status_t replay_status();
1217
+ ```
1218
+
1219
+ ## Inference: depz/inference.h
1220
+
1221
+ ### Inference
1222
+
1223
+ ```cpp
1224
+ class Inference : public detail::Handle<depz_inference, depz_inference_release> {
1225
+ // (no public data members)
1226
+ };
1227
+ ```
1228
+
1229
+ #### Inference.create
1230
+
1231
+ ```cpp
1232
+ static Inference create(const Context &ctx, const char *slug, const char *variant, const char *engine = nullptr, int32_t in_w = 0, int32_t in_h = 0, depz_progress_fn progress = nullptr, void *user = nullptr);
1233
+ ```
1234
+
1235
+ #### Inference.info
1236
+
1237
+ ```cpp
1238
+ depz_inference_info_t info() const;
1239
+ ```
1240
+
1241
+ #### Inference.infer
1242
+
1243
+ ```cpp
1244
+ void infer(const depz_image_t &left, const depz_image_t *right, float *out, int32_t out_stride_bytes);
1245
+ ```
1246
+
1247
+ #### Inference.warmup
1248
+
1249
+ ```cpp
1250
+ void warmup();
1251
+ ```
1252
+
1253
+ #### Inference.set_intrinsics
1254
+
1255
+ ```cpp
1256
+ void set_intrinsics(double fx, double fy, double cx, double cy);
1257
+ ```
1258
+
1259
+ #### Inference.control_set
1260
+
1261
+ ```cpp
1262
+ void control_set(const char *name, double value);
1263
+ ```
1264
+
1265
+ ```cpp
1266
+ void control_set(const char *name, const char *value);
1267
+ ```
1268
+
1269
+ ### EngineOutputs
1270
+
1271
+ ```cpp
1272
+ class EngineOutputs : public detail::Handle<depz_engine_outputs, depz_engine_outputs_release> {
1273
+ // (no public data members)
1274
+ };
1275
+ ```
1276
+
1277
+ The outputs of one EngineSession::run_outputs, in the library's memory: each tensor's data is
1278
+ valid while this lives.
1279
+
1280
+ #### EngineOutputs.size
1281
+
1282
+ ```cpp
1283
+ size_t size() const;
1284
+ ```
1285
+
1286
+ #### EngineOutputs.at
1287
+
1288
+ ```cpp
1289
+ depz_tensor_t at(size_t i) const;
1290
+ ```
1291
+
1292
+ ### EngineSession
1293
+
1294
+ ```cpp
1295
+ class EngineSession : public detail::Handle<depz_engine_session, depz_engine_session_release> {
1296
+ // (no public data members)
1297
+ };
1298
+ ```
1299
+
1300
+ #### EngineSession.open
1301
+
1302
+ ```cpp
1303
+ static EngineSession open(const char *engine, const char *model_path);
1304
+ ```
1305
+
1306
+ #### EngineSession.inputs
1307
+
1308
+ ```cpp
1309
+ std::vector<depz_tensor_t> inputs() const;
1310
+ ```
1311
+
1312
+ #### EngineSession.outputs
1313
+
1314
+ ```cpp
1315
+ std::vector<depz_tensor_t> outputs() const;
1316
+ ```
1317
+
1318
+ #### EngineSession.run
1319
+
1320
+ ```cpp
1321
+ void run(const std::vector<depz_tensor_t> &inputs, std::vector<depz_tensor_t> &outputs);
1322
+ ```
1323
+
1324
+ #### EngineSession.run_outputs
1325
+
1326
+ ```cpp
1327
+ EngineOutputs run_outputs(const std::vector<depz_tensor_t> &inputs);
1328
+ ```
1329
+
1330
+ One run whose outputs the library allocates, of the shapes the run gives.
1331
+
1332
+ ### ModelInfo
1333
+
1334
+ ```cpp
1335
+ struct ModelInfo {
1336
+ std::string slug;
1337
+ std::string label;
1338
+ bool neural = false;
1339
+ bool mono = false;
1340
+ bool outputs_depth = false;
1341
+ double max_disparity_px = 0; /* 0: no fixed ceiling, or not known */
1342
+ bool disparity_offset_verified = false;
1343
+ bool consistency_check = false;
1344
+ std::vector<ModelVariantInfo> variants;
1345
+ };
1346
+ ```
1347
+
1348
+ One model family of the catalog with its variants. Python: ModelInfo.
1349
+
1350
+ ### list_models
1351
+
1352
+ ```cpp
1353
+ inline std::vector<ModelInfo> list_models(const Context &ctx);
1354
+ ```
1355
+
1356
+ The catalog's models (contracts/models.json). Python: list_models().
1357
+
1358
+ ### is_model_cached
1359
+
1360
+ ```cpp
1361
+ inline bool is_model_cached(const Context &ctx, const char *slug, const char *variant, const char *engine = nullptr, int32_t in_w = 0, int32_t in_h = 0);
1362
+ ```
1363
+
1364
+ Offline preparation (not needed before Inference::create, which downloads what it lacks):
1365
+ whether the files Inference::create would use for a model, an engine (nullptr: the
1366
+ default rule's) and a size (0, 0: the variant's) are in the cache. Python: is_model_cached().
1367
+
1368
+ ### download_model
1369
+
1370
+ ```cpp
1371
+ inline std::vector<std::string> download_model(const Context &ctx, const char *slug, const char *variant, const char *engine = nullptr, int32_t in_w = 0, int32_t in_h = 0, depz_progress_fn progress = nullptr, void *user = nullptr);
1372
+ ```
1373
+
1374
+ Offline preparation: downloads (and checks) those files; blocks. progress: the "download"
1375
+ bytes, a nonzero return cancels (ErrorCode::ABORTED). Returns the files' absolute paths
1376
+ under the cache root, the entry point first (none for a classical matcher;
1377
+ depz_model_files). Python: download_model().
1378
+
1379
+ ### describe_engines
1380
+
1381
+ ```cpp
1382
+ inline std::vector<EngineInfo> describe_engines(const Context &ctx);
1383
+ ```
1384
+
1385
+ Every engine the SDK knows, in the manifest's order, and whether this host runs it: a
1386
+ snapshot. Python: describe_engines().
1387
+
1388
+ ### ModelSupport
1389
+
1390
+ ```cpp
1391
+ using ModelSupport = depz_model_support_t;
1392
+ ```
1393
+
1394
+ Whether an engine may run a model at a size (in_w, in_h; 0, 0: the variant's own), with the
1395
+ precision and the region rules (Python: model_support()). variant nullptr: the family's rules.
1396
+
1397
+ ### model_support
1398
+
1399
+ ```cpp
1400
+ inline ModelSupport model_support(const Context &ctx, const char *slug, const char *variant, const char *engine, int32_t in_w = 0, int32_t in_h = 0);
1401
+ ```
1402
+
1403
+ See [`ModelSupport`](#modelsupport).
1404
+
1405
+ ### InputSizes
1406
+
1407
+ ```cpp
1408
+ using InputSizes = depz_input_sizes_t;
1409
+ ```
1410
+
1411
+ Which input sizes Inference::create takes for a model on an engine (nullptr: the default
1412
+ rule's): kind DEPZ_INPUT_SIZE_ANY or \_LISTED and the sizes, (h, w). Python:
1413
+ input_size_support().
1414
+
1415
+ ### model_input_sizes
1416
+
1417
+ ```cpp
1418
+ inline InputSizes model_input_sizes(const Context &ctx, const char *slug, const char *engine = nullptr);
1419
+ ```
1420
+
1421
+ See [`InputSizes`](#inputsizes).
1422
+
1423
+ ### model_files
1424
+
1425
+ ```cpp
1426
+ inline std::vector<std::string> model_files(const Context &ctx, const char *slug, const char *variant, const char *engine = nullptr, int32_t in_w = 0, int32_t in_h = 0);
1427
+ ```
1428
+
1429
+ The files download_model fetches (and Inference::create runs) for the same arguments,
1430
+ without fetching anything: absolute paths under the cache root, the entry point first (none
1431
+ for a classical matcher). Python: download_model()'s value.
1432
+
1433
+ ### ModelDefault
1434
+
1435
+ ```cpp
1436
+ using ModelDefault = depz_model_default_t;
1437
+ ```
1438
+
1439
+ The model to run on an engine when nobody chooses one, on this host (a recommendation; the
1440
+ SDK never applies it): has_default 0 when there is none. Python: default_model().
1441
+
1442
+ ### model_default
1443
+
1444
+ ```cpp
1445
+ inline ModelDefault model_default(const Context &ctx, const char *engine);
1446
+ ```
1447
+
1448
+ See [`ModelDefault`](#modeldefault).
1449
+
1450
+ ### EngineSlug
1451
+
1452
+ ```cpp
1453
+ struct EngineSlug {
1454
+ std::string kind, device_or_ep;
1455
+ };
1456
+ ```
1457
+
1458
+ An engine slug's two parts ("openvino-GPU.0": "openvino", "GPU.0"); a malformed slug:
1459
+ DepzError(INVALID_ARGUMENT). Python: parse_engine_slug().
1460
+
1461
+ ### parse_engine_slug
1462
+
1463
+ ```cpp
1464
+ inline EngineSlug parse_engine_slug(const char *slug);
1465
+ ```
1466
+
1467
+ See [`EngineSlug`](#engineslug).
1468
+
1469
+ ## Depth: depz/depth.h
1470
+
1471
+ ### make_depth_stage
1472
+
1473
+ ```cpp
1474
+ inline StageHandle make_depth_stage(const Inference &inf);
1475
+ ```
1476
+
1477
+ ## Extensions
1478
+
1479
+ ### FrameSource
1480
+
1481
+ ```cpp
1482
+ class FrameSource {
1483
+ std::vector<Control> listed_camera_controls_; /* The library's: the last camera_controls(), for the vtable's count / at. */
1484
+ };
1485
+ ```
1486
+
1487
+ An own frame source. Python: FrameSource.
1488
+
1489
+ #### FrameSource.open
1490
+
1491
+ ```cpp
1492
+ virtual void open(depz_source_info_t &info) = 0;
1493
+ ```
1494
+
1495
+ Opens it and describes it (struct_size is set).
1496
+
1497
+ #### FrameSource.grab
1498
+
1499
+ ```cpp
1500
+ virtual bool grab(int32_t timeout_ms, depz_image_t &image, int64_t &pts_us) = 0;
1501
+ ```
1502
+
1503
+ One picture (BGR8, both eyes side by side for stereo) valid until the next
1504
+ call; false: nothing within timeout_ms.
1505
+
1506
+ #### FrameSource.close
1507
+
1508
+ ```cpp
1509
+ virtual void close();
1510
+ ```
1511
+
1512
+ #### FrameSource.records
1513
+
1514
+ ```cpp
1515
+ virtual bool records() const;
1516
+ ```
1517
+
1518
+ A source that gives the camera's own bytes and its anchors, so that a pipeline on it
1519
+ can record it (Python: RawFrame.payload, t0_monotonic_ns / t0_utc_ns): true, and
1520
+ payload / t0 below are its vtable's. Asked once, by make_source.
1521
+
1522
+ #### FrameSource.payload
1523
+
1524
+ ```cpp
1525
+ virtual void payload(const void *&data, size_t &size);
1526
+ ```
1527
+
1528
+ The bytes of the frame the last grab gave, format info.fourcc; valid until the next
1529
+ grab or close.
1530
+
1531
+ #### FrameSource.t0
1532
+
1533
+ ```cpp
1534
+ virtual void t0(depz_source_anchors_t &out);
1535
+ ```
1536
+
1537
+ The anchors of pts_us = 0: set has_t0_monotonic / has_t0_utc for what is known.
1538
+
1539
+ #### FrameSource.calibration
1540
+
1541
+ ```cpp
1542
+ virtual Calibration calibration();
1543
+ ```
1544
+
1545
+ The calibration in force (Python: FrameSource.active_calibration), asked after the
1546
+ open and after every grab: a new one when it changed, else an empty Calibration
1547
+ (unchanged).
1548
+
1549
+ #### FrameSource.lists_camera_controls
1550
+
1551
+ ```cpp
1552
+ virtual bool lists_camera_controls() const;
1553
+ ```
1554
+
1555
+ Its camera controls (Python: FrameSource.list_camera_controls): true, and
1556
+ camera_controls / camera_control_members below are its vtable's list. Asked once, by
1557
+ make_source.
1558
+
1559
+ #### FrameSource.camera_controls
1560
+
1561
+ ```cpp
1562
+ virtual std::vector<Control> camera_controls();
1563
+ ```
1564
+
1565
+ The controls with their values now (has_value 0: unknown; struct_size is set by the
1566
+ library).
1567
+
1568
+ #### FrameSource.camera_control_members
1569
+
1570
+ ```cpp
1571
+ virtual std::vector<depz_enum_member_t> camera_control_members(const std::string &name);
1572
+ ```
1573
+
1574
+ An enum control's members (enum_count of them).
1575
+
1576
+ #### FrameSource.has_camera_control_handle
1577
+
1578
+ ```cpp
1579
+ virtual bool has_camera_control_handle() const;
1580
+ ```
1581
+
1582
+ A control handle (Python: FrameSource.camera_controls not None): true, and
1583
+ camera_control_get / camera_control_set below are its vtable's. Asked once, by
1584
+ make_source.
1585
+
1586
+ #### FrameSource.camera_control_get
1587
+
1588
+ ```cpp
1589
+ virtual std::optional<double> camera_control_get(const std::string &name);
1590
+ ```
1591
+
1592
+ The handle's read of one control; none: not readable.
1593
+
1594
+ #### FrameSource.camera_control_set
1595
+
1596
+ ```cpp
1597
+ virtual bool camera_control_set(const std::string &name, double value);
1598
+ ```
1599
+
1600
+ The value as given; false: the camera refused it.
1601
+
1602
+ ### make_source
1603
+
1604
+ ```cpp
1605
+ inline Source make_source(const Context &ctx, std::unique_ptr<FrameSource> impl);
1606
+ ```
1607
+
1608
+ ### mkv_source
1609
+
1610
+ ```cpp
1611
+ inline Source mkv_source(const Context &ctx, const std::string &path, const depz_replay_options_t *opt = nullptr);
1612
+ ```
1613
+
1614
+ A recording (schema 6) as a source; opt nullptr: the defaults (realtime, paced).
1615
+ Python: MkvSource(path, ...).
1616
+
1617
+ ### StageGeometry
1618
+
1619
+ ```cpp
1620
+ using StageGeometry = depz_stage_geometry_t;
1621
+ ```
1622
+
1623
+ ### Stage
1624
+
1625
+ ```cpp
1626
+ class Stage {
1627
+ // (no public data members)
1628
+ };
1629
+ ```
1630
+
1631
+ An own pipeline stage. Python: Stage (name, streams, prepare(geometry),
1632
+ process(frame), controls(), info()).
1633
+
1634
+ #### Stage.name
1635
+
1636
+ ```cpp
1637
+ virtual std::string name() const = 0;
1638
+ ```
1639
+
1640
+ #### Stage.streams
1641
+
1642
+ ```cpp
1643
+ virtual uint32_t streams() const;
1644
+ ```
1645
+
1646
+ DEPZ_STREAM\_\* bits it adds.
1647
+
1648
+ #### Stage.prepare
1649
+
1650
+ ```cpp
1651
+ virtual void prepare(const StageGeometry &);
1652
+ ```
1653
+
1654
+ #### Stage.process
1655
+
1656
+ ```cpp
1657
+ virtual void process(Frame &frame) = 0;
1658
+ ```
1659
+
1660
+ Reads frame.image(...), adds with frame.put_image(...).
1661
+
1662
+ #### Stage.controls
1663
+
1664
+ ```cpp
1665
+ virtual std::vector<depz_control_t> controls() const;
1666
+ ```
1667
+
1668
+ #### Stage.set_control
1669
+
1670
+ ```cpp
1671
+ virtual void set_control(const std::string &name, double);
1672
+ ```
1673
+
1674
+ #### Stage.info
1675
+
1676
+ ```cpp
1677
+ virtual std::string info() const;
1678
+ ```
1679
+
1680
+ A JSON object.
1681
+
1682
+ #### Stage.reset
1683
+
1684
+ ```cpp
1685
+ virtual void reset();
1686
+ ```
1687
+
1688
+ The frames lost their continuity (a replay's seek): forget per-frame state.
1689
+
1690
+ ### make_stage
1691
+
1692
+ ```cpp
1693
+ inline StageHandle make_stage(std::unique_ptr<Stage> impl);
1694
+ ```
1695
+
1696
+ ### EngineModel
1697
+
1698
+ ```cpp
1699
+ class EngineModel {
1700
+ // (no public data members)
1701
+ };
1702
+ ```
1703
+
1704
+ A model file loaded on an own engine. Python: InferenceEngine (one model).
1705
+
1706
+ #### EngineModel.inputs
1707
+
1708
+ ```cpp
1709
+ virtual std::vector<depz_tensor_t> inputs() const;
1710
+ ```
1711
+
1712
+ The inputs' types and shapes (data NULL), in declared order.
1713
+
1714
+ #### EngineModel.outputs
1715
+
1716
+ ```cpp
1717
+ virtual std::vector<depz_tensor_t> outputs() const;
1718
+ ```
1719
+
1720
+ The outputs' types and shapes (data NULL; -1: free until a run), in declared order.
1721
+
1722
+ #### EngineModel.run
1723
+
1724
+ ```cpp
1725
+ virtual void run(const depz_tensor_t *inputs, size_t n_inputs, depz_tensor_t *outputs, size_t n_outputs) = 0;
1726
+ ```
1727
+
1728
+ ### Engine
1729
+
1730
+ ```cpp
1731
+ class Engine {
1732
+ // (no public data members)
1733
+ };
1734
+ ```
1735
+
1736
+ An own engine. Python: InferenceEngine.
1737
+
1738
+ #### Engine.slug
1739
+
1740
+ ```cpp
1741
+ virtual std::string slug() const = 0;
1742
+ ```
1743
+
1744
+ #### Engine.kind
1745
+
1746
+ ```cpp
1747
+ virtual std::string kind() const;
1748
+ ```
1749
+
1750
+ #### Engine.precisions
1751
+
1752
+ ```cpp
1753
+ virtual std::string precisions() const;
1754
+ ```
1755
+
1756
+ #### Engine.available
1757
+
1758
+ ```cpp
1759
+ virtual bool available() const;
1760
+ ```
1761
+
1762
+ #### Engine.open
1763
+
1764
+ ```cpp
1765
+ virtual std::unique_ptr<EngineModel> open(const std::string &model_path) = 0;
1766
+ ```
1767
+
1768
+ ### register_engine
1769
+
1770
+ ```cpp
1771
+ inline void register_engine(std::unique_ptr<Engine> impl);
1772
+ ```
1773
+
1774
+ ### unregister_engine
1775
+
1776
+ ```cpp
1777
+ inline void unregister_engine(const std::string &slug);
1778
+ ```
1779
+
1780
+ ### Model
1781
+
1782
+ ```cpp
1783
+ class Model {
1784
+ // (no public data members)
1785
+ };
1786
+ ```
1787
+
1788
+ An own depth model. Python: DepthInferenceBase.
1789
+
1790
+ #### Model.slug
1791
+
1792
+ ```cpp
1793
+ virtual std::string slug() const = 0;
1794
+ ```
1795
+
1796
+ #### Model.variant
1797
+
1798
+ ```cpp
1799
+ virtual std::string variant() const;
1800
+ ```
1801
+
1802
+ #### Model.engine
1803
+
1804
+ ```cpp
1805
+ virtual std::string engine() const;
1806
+ ```
1807
+
1808
+ #### Model.label
1809
+
1810
+ ```cpp
1811
+ virtual std::string label() const;
1812
+ ```
1813
+
1814
+ Its display name; "": the default rule (depz_inference_info_t.label). Python: label.
1815
+
1816
+ #### Model.input_width
1817
+
1818
+ ```cpp
1819
+ virtual int32_t input_width() const;
1820
+ ```
1821
+
1822
+ 0, 0: any size.
1823
+
1824
+ #### Model.input_height
1825
+
1826
+ ```cpp
1827
+ virtual int32_t input_height() const;
1828
+ ```
1829
+
1830
+ #### Model.mono
1831
+
1832
+ ```cpp
1833
+ virtual bool mono() const;
1834
+ ```
1835
+
1836
+ #### Model.outputs_depth
1837
+
1838
+ ```cpp
1839
+ virtual bool outputs_depth() const;
1840
+ ```
1841
+
1842
+ #### Model.max_disparity_px
1843
+
1844
+ ```cpp
1845
+ virtual double max_disparity_px() const;
1846
+ ```
1847
+
1848
+ The disparity ceiling, input pixels; 0: none or not known (a slug of the catalog takes the
1849
+ catalog's).
1850
+
1851
+ #### Model.warmup
1852
+
1853
+ ```cpp
1854
+ virtual void warmup();
1855
+ ```
1856
+
1857
+ #### Model.set_intrinsics
1858
+
1859
+ ```cpp
1860
+ virtual void set_intrinsics(double, double, double, double);
1861
+ ```
1862
+
1863
+ #### Model.infer
1864
+
1865
+ ```cpp
1866
+ virtual void infer(const depz_image_t &left, const depz_image_t *right, float *out, int32_t out_stride_bytes) = 0;
1867
+ ```
1868
+
1869
+ right nullptr for a mono model; out: F32 of left's size.
1870
+
1871
+ #### Model.max_concurrent_runs
1872
+
1873
+ ```cpp
1874
+ virtual int32_t max_concurrent_runs() const;
1875
+ ```
1876
+
1877
+ The runs its engine computes at once (depz_model_vtable_t.max_concurrent_runs; 0: 1).
1878
+ With asynchronous runs, the depth stage's parallel_runs (default pipeline_depth: + 1).
1879
+
1880
+ #### Model.asynchronous
1881
+
1882
+ ```cpp
1883
+ virtual bool asynchronous() const;
1884
+ ```
1885
+
1886
+ #### Model.submit
1887
+
1888
+ ```cpp
1889
+ virtual std::unique_ptr<Run> submit(const depz_image_t &, const depz_image_t *);
1890
+ ```
1891
+
1892
+ On the pipeline's worker: queue the run and return (left / right: the library's copies,
1893
+ valid until the run ends).
1894
+
1895
+ #### Model.wait
1896
+
1897
+ ```cpp
1898
+ virtual bool wait(Run &, int32_t);
1899
+ ```
1900
+
1901
+ On the library's run thread: true when done, false not yet (within timeout_ms); an
1902
+ exception fails the run (the library then cancels it).
1903
+
1904
+ #### Model.complete
1905
+
1906
+ ```cpp
1907
+ virtual void complete(Run &, float *, int32_t);
1908
+ ```
1909
+
1910
+ After wait gave true, on the same thread: the map as infer writes it.
1911
+
1912
+ #### Model.cancel
1913
+
1914
+ ```cpp
1915
+ virtual void cancel(Run &) noexcept;
1916
+ ```
1917
+
1918
+ The run's frame was dropped, or its wait failed: no complete follows.
1919
+
1920
+ ### make_inference
1921
+
1922
+ ```cpp
1923
+ inline Inference make_inference(const Context &ctx, std::unique_ptr<Model> impl);
1924
+ ```