@@ -178,7 +178,7 @@ typedef enum {
178
178
// #define DEFAULT_PROP_RIGHT_DEPTH FALSE
179
179
180
180
// RUNTIME
181
- #define DEFAULT_PROP_CONFIDENCE_THRESH 80
181
+ #define DEFAULT_PROP_CONFIDENCE_THRESH 50
182
182
#define DEFAULT_PROP_TEXTURE_CONF_THRESH 100
183
183
#define DEFAULT_PROP_3D_REF_FRAME static_cast <gint>(sl::REFERENCE_FRAME::WORLD)
184
184
#define DEFAULT_PROP_SENSING_MODE static_cast <gint>(sl::SENSING_MODE::STANDARD)
@@ -447,6 +447,9 @@ static GType gst_zedsrc_depth_mode_get_type (void)
447
447
448
448
if (!zedsrc_depth_mode_type) {
449
449
static GEnumValue pattern_types[] = {
450
+ { static_cast <gint>(sl::DEPTH_MODE::NEURAL),
451
+ " End to End Neural disparity estimation, requires AI module" ,
452
+ " NEURAL" },
450
453
{ static_cast <gint>(sl::DEPTH_MODE::ULTRA),
451
454
" Computation mode favorising edges and sharpness. Requires more GPU memory and computation power." ,
452
455
" ULTRA" },
@@ -1732,27 +1735,23 @@ static gboolean gst_zedsrc_start( GstBaseSrc * bsrc )
1732
1735
GST_INFO (" * LED_STATUS: %s" , (src->led_status ?" ON" :" OFF" ));
1733
1736
// <---- Camera Controls
1734
1737
1735
- // ----> Set runtime parameters
1738
+ // ----> Runtime parameters
1736
1739
GST_INFO (" CAMERA RUNTIME PARAMETERS" );
1737
1740
if ( src->depth_mode ==static_cast <gint>(sl::DEPTH_MODE::NONE)
1738
1741
&& !src->pos_tracking )
1739
1742
{
1740
- src-> zedRtParams . enable_depth = false ;
1743
+ GST_INFO ( " * Depth calculation: ON " ) ;
1741
1744
}
1742
1745
else
1743
1746
{
1744
- src-> zedRtParams . enable_depth = true ;
1747
+ GST_INFO ( " * Depth calculation: OFF " ) ;
1745
1748
}
1746
- GST_INFO (" * Depth calculation: %s" , (src->zedRtParams .enable_depth ?" ON" :" OFF" ));
1747
- src->zedRtParams .confidence_threshold = src->confidence_threshold ;
1748
- GST_INFO (" * Depth Confidence threshold: %d" , src->zedRtParams .confidence_threshold );
1749
- src->zedRtParams .texture_confidence_threshold = src->texture_confidence_threshold ;
1750
- GST_INFO (" * Depth Texture Confidence threshold: %d" , src->zedRtParams .texture_confidence_threshold );
1751
- src->zedRtParams .measure3D_reference_frame = static_cast <sl::REFERENCE_FRAME>(src->measure3D_reference_frame );
1752
- GST_INFO (" * 3D Reference Frame: %s" , sl::toString (src->zedRtParams .measure3D_reference_frame ).c_str ());
1753
- src->zedRtParams .sensing_mode = static_cast <sl::SENSING_MODE>(src->sensing_mode );
1754
- GST_INFO (" * Sensing Mode: %s" , sl::toString (src->zedRtParams .sensing_mode ).c_str ());
1755
- // <---- Set runtime parameters
1749
+
1750
+ GST_INFO (" * Depth Confidence threshold: %d" , src->confidence_threshold );
1751
+ GST_INFO (" * Depth Texture Confidence threshold: %d" , src->texture_confidence_threshold );
1752
+ GST_INFO (" * 3D Reference Frame: %s" , sl::toString ((sl::COORDINATE_SYSTEM)src->measure3D_reference_frame ).c_str ());
1753
+ GST_INFO (" * Sensing Mode: %s" , sl::toString ((sl::SENSING_MODE)src->sensing_mode ).c_str ());
1754
+ // <---- Runtime parameters
1756
1755
1757
1756
// ----> Positional tracking
1758
1757
GST_INFO (" POSITIONAL TRACKING PARAMETERS" );
@@ -1931,8 +1930,27 @@ static GstFlowReturn gst_zedsrc_fill( GstPushSrc * psrc, GstBuffer * buf )
1931
1930
src->is_started = TRUE ;
1932
1931
}
1933
1932
1933
+ // ----> Set runtime parameters
1934
+ sl::RuntimeParameters zedRtParams; // runtime parameters
1935
+
1936
+ GST_INFO (" CAMERA RUNTIME PARAMETERS" );
1937
+ if ( src->depth_mode ==static_cast <gint>(sl::DEPTH_MODE::NONE) && !src->pos_tracking )
1938
+ {
1939
+ zedRtParams.enable_depth = false ;
1940
+ }
1941
+ else
1942
+ {
1943
+ zedRtParams.enable_depth = true ;
1944
+ }
1945
+ zedRtParams.confidence_threshold = src->confidence_threshold ;
1946
+ zedRtParams.texture_confidence_threshold = src->texture_confidence_threshold ;
1947
+ zedRtParams.measure3D_reference_frame = static_cast <sl::REFERENCE_FRAME>(src->measure3D_reference_frame );
1948
+ zedRtParams.sensing_mode = static_cast <sl::SENSING_MODE>(src->sensing_mode );
1949
+ zedRtParams.remove_saturated_areas = true ;
1950
+ // <---- Set runtime parameters
1951
+
1934
1952
// ----> ZED grab
1935
- ret = src->zed .grab (src-> zedRtParams );
1953
+ ret = src->zed .grab (zedRtParams);
1936
1954
1937
1955
if ( ret!=sl::ERROR_CODE::SUCCESS )
1938
1956
{
@@ -1981,12 +1999,14 @@ static GstFlowReturn gst_zedsrc_fill( GstPushSrc * psrc, GstBuffer * buf )
1981
1999
ret = src->zed .retrieveMeasure (depth_data, sl::MEASURE::DEPTH, sl::MEM::CPU );
1982
2000
#else
1983
2001
ret = src->zed .retrieveMeasure (depth_data, sl::MEASURE::DEPTH_U16_MM, sl::MEM::CPU );
2002
+ // depth_data.write( "test_depth_16.png" );
1984
2003
#endif
1985
2004
}
1986
2005
else if (src->stream_type == GST_ZEDSRC_LEFT_DEPTH)
1987
2006
{
1988
2007
ret = src->zed .retrieveImage (left_img, sl::VIEW::LEFT, sl::MEM::CPU );
1989
2008
ret = src->zed .retrieveMeasure (depth_data, sl::MEASURE::DEPTH, sl::MEM::CPU );
2009
+ // depth_data.write( "test_depth_32.png" );
1990
2010
}
1991
2011
1992
2012
if ( ret!=sl::ERROR_CODE::SUCCESS )
@@ -2034,6 +2054,8 @@ static GstFlowReturn gst_zedsrc_fill( GstPushSrc * psrc, GstBuffer * buf )
2034
2054
2035
2055
for (unsigned long i = 0 ; i < minfo.size /8 ; i++) {
2036
2056
*(gst_data++) = static_cast <uint32_t >(*(depthDataPtr++));
2057
+
2058
+ // printf( "#%lu: %u / %g %u \n", i, *(gst_data-1), *(depthDataPtr-1), static_cast<uint32_t>(*(depthDataPtr-1)));
2037
2059
}
2038
2060
}
2039
2061
else
0 commit comments