Skip to content

Commit c1abf8e

Browse files
authored
Stability improvement and bugfixes (#87)
- Fixed several critical bugs including incorrect VGA resolution mapping, `memcpy` buffer overflow in data mux, and `sprintf` buffer safety issues - Replaced static buffer counters with per-instance variables to fix multi-instance issues - Added latency query handlers to prevent crashes during pipeline queries - Added SDK version compile-time check to catch version mismatches early - Added support for new SDK features (GEN_3 positional tracking, NEURAL_LIGHT depth mode, custom YOLO models) - Added runtime SVO recording control (`svo-recording-enable`, `svo-recording-filename`, `svo-recording-compression`, related to #78) - Added `output-rectified-image` property for ZED X One to support custom optics without calibration (related to #71) - Added test script (`.ci/test.sh`) with fast, extensive, and benchmark modes - Fixed floating-point math issues (`abs()`→`fabsf()`) and AEC_AGC enum handling - Improved code formatting consistency and fixed documentation typos
1 parent ddeb5c9 commit c1abf8e

File tree

10 files changed

+3345
-879
lines changed

10 files changed

+3345
-879
lines changed

.ci/test.sh

Lines changed: 2132 additions & 0 deletions
Large diffs are not rendered by default.

CMakeLists.txt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,18 @@ if(NOT CMAKE_CXX_STANDARD)
1616
set(CMAKE_CXX_STANDARD 14)
1717
endif()
1818

19-
add_definitions(-Werror=return-type)
19+
if(NOT WIN32)
20+
add_definitions(-Werror=return-type
21+
-Wfatal-errors
22+
-Wno-deprecated-declarations
23+
-Werror=overflow
24+
-Werror=uninitialized
25+
-Werror=delete-incomplete
26+
-Werror=shadow
27+
-Werror=array-bounds
28+
-Werror=vla
29+
-Walloc-zero)
30+
endif()
2031

2132
set(CMAKE_SHARED_MODULE_PREFIX "lib")
2233
set(CMAKE_SHARED_LIBRARY_PREFIX "lib")

README.md

Lines changed: 49 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ GStreamer package for ZED Cameras. The package is composed of several elements:
4040

4141
### Windows installation
4242

43-
* Install the latest ZED SDK v5.1 from the [official download page](https://www.stereolabs.com/developers/release/5.1) [Optional to compile the `zedsrc` element to acquire data from a ZED camera device]
43+
* Install the latest ZED SDK from the [official download page](https://www.stereolabs.com/developers/release/5.1) [Optional to compile the `zedsrc` element to acquire data from a ZED camera device]
4444
* Install [Git](https://git-scm.com/) or download a ZIP archive
4545
* Install [CMake](https://cmake.org/)
4646
* Install a [GStreamer distribution (**both `runtime` and `development` installers**)](https://gstreamer.freedesktop.org/download/).
@@ -61,7 +61,7 @@ GStreamer package for ZED Cameras. The package is composed of several elements:
6161

6262
#### Install prerequisites
6363

64-
* Install the latest ZED SDK v5.0-EA from the [official download page](https://www.stereolabs.com/developers/release/5.0)
64+
* Install the latest ZED SDK from the [official download page](https://www.stereolabs.com/developers/release/5.1)
6565

6666
* Update the list of `apt` available packages
6767

@@ -79,7 +79,7 @@ GStreamer package for ZED Cameras. The package is composed of several elements:
7979

8080
`$ sudo apt install libgstreamer1.0-0 gstreamer1.0-libav libgstrtspserver-1.0-0 gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio libgstreamer1.0-dev libgstrtspserver-1.0-dev libgstreamer-plugins-base1.0-0 libgstreamer-plugins-base1.0-dev libgstreamer-plugins-good1.0-0 libgstreamer-plugins-good1.0-dev libgstreamer-plugins-bad1.0-0 libgstreamer-plugins-bad1.0-dev`
8181

82-
* [Optional] Install OpenCV to build the `zedodverlay` filter
82+
* [Optional] Install OpenCV to build the `zedodoverlay` filter
8383

8484
`$ sudo apt install libopencv-dev libopencv-contrib-dev`
8585

@@ -292,11 +292,12 @@ Most of the properties follow the same name as the C++ API. Except that `_` is r
292292
depth-mode : Depth Mode
293293
flags: readable, writable
294294
Enum "GstZedsrcDepthMode" Default: 0, "NONE"
295-
(5): NEURAL_PLUS - More accurate Neural disparity estimation, Requires AI module.
296-
(4): NEURAL - End to End Neural disparity estimation, requires AI module
297-
(3): ULTRA - Computation mode favorising edges and sharpness. Requires more GPU memory and computation power.
298-
(2): QUALITY - Computation mode designed for challenging areas with untextured surfaces.
299-
(1): PERFORMANCE - Computation mode optimized for speed.
295+
(6): NEURAL_PLUS - More accurate Neural disparity estimation, Requires AI module.
296+
(5): NEURAL - End to End Neural disparity estimation, requires AI module
297+
(4): NEURAL_LIGHT - End to End Neural disparity estimation (light), requires AI module
298+
(3): ULTRA - [DEPRECATED] Computation mode favorising edges and sharpness. Requires more GPU memory and computation power.
299+
(2): QUALITY - [DEPRECATED] Computation mode designed for challenging areas with untextured surfaces.
300+
(1): PERFORMANCE - [DEPRECATED] Computation mode optimized for speed.
300301
(0): NONE - This mode does not compute any depth map. Only rectified stereo images will be available.
301302
depth-stabilization : Enable depth stabilization
302303
flags: readable, writable
@@ -383,10 +384,10 @@ Most of the properties follow the same name as the C++ API. Except that `_` is r
383384
Float. Range: 0 - 100 Default: 50
384385
od-detection-filter-mode: Object Detection Filter Mode
385386
flags: readable, writable
386-
Enum "GstZedSrcOdFilterMode" Default: 2, "(null)"
387-
(1): (null) - SDK will not apply any preprocessing to the detected objects
388-
(1): (null) - SDK will remove objects that are in the same 3D position as an already tracked object (independant of class ID)
389-
(2): (null) - SDK will remove objects that are in the same 3D position as an already tracked object of the same class ID.
387+
Enum "GstZedSrcOdFilterMode" Default: 2, "NMS3D_PER_CLASS"
388+
(0): NONE - SDK will not apply any preprocessing to the detected objects
389+
(1): NMS3D - SDK will remove objects that are in the same 3D position as an already tracked object (independant of class ID)
390+
(2): NMS3D_PER_CLASS - SDK will remove objects that are in the same 3D position as an already tracked object of the same class ID.
390391
od-detection-model : Object Detection Model
391392
flags: readable, writable
392393
Enum "GstZedSrcOdModel" Default: 1, "Object Detection Multi class MEDIUM"
@@ -395,6 +396,16 @@ Most of the properties follow the same name as the C++ API. Except that `_` is r
395396
(2): Object Detection Multi class ACCURATE - Any objects, bounding box based, more accurate but slower than the base model
396397
(3): Person Head FAST - Bounding Box detector specialized in person heads, particularly well suited for crowded environments, the person localization is also improved
397398
(4): Person Head ACCURATE - Bounding Box detector specialized in person heads, particularly well suited for crowded environments, the person localization is also improved, more accurate but slower than the base model
399+
(6): Custom YOLO-like Box Objects - For internal inference using your own custom YOLO-like model. Requires od-custom-onnx-file property to be set.
400+
od-custom-onnx-file : Path to custom ONNX file for Custom YOLO-like detection model
401+
flags: readable, writable
402+
String. Default: ""
403+
od-custom-onnx-dynamic-input-shape-w: Dynamic input shape width for custom ONNX model
404+
flags: readable, writable
405+
Integer. Range: 128 - 4096 Default: 512
406+
od-custom-onnx-dynamic-input-shape-h: Dynamic input shape height for custom ONNX model
407+
flags: readable, writable
408+
Integer. Range: 128 - 4096 Default: 512
398409
od-enable-tracking : Set to TRUE to enable tracking for the detected objects
399410
flags: readable, writable
400411
Boolean. Default: true
@@ -418,16 +429,17 @@ Most of the properties follow the same name as the C++ API. Except that `_` is r
418429
Float. Range: -1 - 65535 Default: -1
419430
positional-tracking-mode: Positional tracking mode
420431
flags: readable, writable
421-
Enum "GstZedsrcPtMode" Default: 1, "GEN_2"
422-
(0): GEN_1 - Generation 1
423-
(1): GEN_2 - Generation 2
432+
Enum "GstZedsrcPtMode" Default: 0, "GEN_1"
433+
(0): GEN_1 - Generation 1 (default, fast and stable, requires depth)
434+
(1): GEN_2 - Generation 2 (deprecated)
435+
(2): GEN_3 - Generation 3 (fast and accurate, works even without depth)
424436
roi : Enable region of interest filtering
425437
flags: readable, writable
426438
Boolean. Default: false
427439
roi-h : Region of interest height (-1 to not set ROI)
428440
flags: readable, writable
429441
Integer. Range: -1 - 1242 Default: -1
430-
roi-w : Region of intererst width (-1 to not set ROI)
442+
roi-w : Region of interest width (-1 to not set ROI)
431443
flags: readable, writable
432444
Integer. Range: -1 - 2208 Default: -1
433445
roi-x : Region of interest top left 'X' coordinate (-1 to not set ROI)
@@ -459,6 +471,20 @@ Most of the properties follow the same name as the C++ API. Except that `_` is r
459471
svo-file-path : Input from SVO file
460472
flags: readable, writable
461473
String. Default: ""
474+
svo-recording-compression: Compression mode for SVO recording
475+
flags: readable, writable
476+
Enum "GstZedsrcSvoCompression" Default: 2, "H265"
477+
(0): LOSSLESS - Lossless (PNG/ZSTD, CPU)
478+
(1): H264 - H264 (GPU)
479+
(2): H265 - H265/HEVC (GPU)
480+
(3): H264_LOSSLESS - H264 Lossless (GPU)
481+
(4): H265_LOSSLESS - H265 Lossless (GPU)
482+
svo-recording-enable: Start/stop SVO recording at runtime (requires svo-recording-filename to be set)
483+
flags: readable, writable
484+
Boolean. Default: false
485+
svo-recording-filename: Output filename for SVO recording (.svo2 extension recommended)
486+
flags: readable, writable
487+
String. Default: ""
462488
texture-confidence-threshold: Specify the Texture Confidence Threshold
463489
flags: readable, writable
464490
Integer. Range: 0 - 100 Default: 100
@@ -569,6 +595,9 @@ Most of the properties follow the same name as the C++ API. Except that `_` is r
569595
opencv-calibration-file: Optional OpenCV Calibration File
570596
flags: readable, writable
571597
String. Default: ""
598+
output-rectified-image: Enable image rectification (disable for custom optics without calibration)
599+
flags: readable, writable
600+
Boolean. Default: true
572601
parent : The parent of the object
573602
flags: readable, writable, 0x2000
574603
Object of type "GstObject"
@@ -654,7 +683,7 @@ Most of the properties follow the same name as the C++ API. Except that `_` is r
654683
## Metadata
655684
656685
The `zedsrc` element add metadata to the video stream containing information about the original frame size,
657-
the camera position and orientatio, the sensors data and the object and skeleton detected by the Object Detection
686+
the camera position and orientation, the sensors data and the object and skeleton detected by the Object Detection
658687
module.
659688
The `zeddatacsvsink` and `zedodoverlay` elements demonstrate how to handle, respectively, the sensors data and the
660689
detected object data.
@@ -666,8 +695,8 @@ The GstZedSrcMeta is subdivided in four sub-structures:
666695
667696
* `ZedInfo`: info about camera model, stream type and original stream size
668697
* `ZedPose`: position and orientation of the camera if positional tracking is enabled
669-
* `ZedSensors`: sensors data (only ZED-Mini and ZED2)
670-
* `ZedObjectData`: detected object information (only ZED2)
698+
* `ZedSensors`: sensors data (all camera models with IMU support, i.e. all except the original ZED)
699+
* `ZedObjectData`: detected object information (requires AI module, i.e. ZED 2 or newer)
671700
672701
More details about the sub-structures are available in the [`gstzedmeta.h` file](./gst-zed-meta/gstzedmeta.h)
673702
@@ -823,7 +852,7 @@ More details about the sub-structures are available in the [`gstzedmeta.h` file]
823852
824853
## RTSP Server *[Available only for Linux]*
825854
826-
An application to start an RTSP server from a text pipeline (using the same sintax of the CLI command [`gst-launch-1.0`](https://gstreamer.freedesktop.org/documentation/tools/gst-launch.html)) is provided.
855+
An application to start an RTSP server from a text pipeline (using the same syntax of the CLI command [`gst-launch-1.0`](https://gstreamer.freedesktop.org/documentation/tools/gst-launch.html)) is provided.
827856
828857
Usage:
829858

0 commit comments

Comments
 (0)