From 87b70dc0a7d90b0f9056f82e59d23c595839ec50 Mon Sep 17 00:00:00 2001 From: Eran Date: Tue, 19 Mar 2024 13:06:16 +0200 Subject: [PATCH] WIP --- src/dds/rs-dds-device-proxy.cpp | 38 ++++- .../include/realdds/dds-stream-server.h | 6 +- .../realdds/include/realdds/dds-stream.h | 6 +- .../realdds/include/realdds/dds-trinsics.h | 2 + third-party/realdds/src/dds-device-impl.cpp | 18 +- third-party/realdds/src/dds-device-server.cpp | 61 ++++--- third-party/realdds/src/dds-trinsics.cpp | 2 + .../dds/dds-adapter/lrs-device-controller.cpp | 26 +-- unit-tests/dds/d405.py | 156 +++++++++--------- unit-tests/dds/d435i.py | 3 + 10 files changed, 172 insertions(+), 146 deletions(-) diff --git a/src/dds/rs-dds-device-proxy.cpp b/src/dds/rs-dds-device-proxy.cpp index 609feb31f91..8f99bb46d3f 100644 --- a/src/dds/rs-dds-device-proxy.cpp +++ b/src/dds/rs-dds-device-proxy.cpp @@ -79,7 +79,7 @@ rs2_intrinsics to_rs2_intrinsics( const realdds::video_intrinsics & intrinsics ) static rs2_video_stream to_rs2_video_stream( rs2_stream const stream_type, sid_index const & sidx, std::shared_ptr< realdds::dds_video_stream_profile > const & profile, - const realdds::video_intrinsics & intrinsics ) + const std::set< realdds::video_intrinsics > & intrinsics ) { rs2_video_stream prof; prof.type = stream_type; @@ -89,7 +89,17 @@ static rs2_video_stream to_rs2_video_stream( rs2_stream const stream_type, prof.height = profile->height(); prof.fps = profile->frequency(); prof.fmt = static_cast< rs2_format >( profile->encoding().to_rs2() ); - prof.intrinsics = to_rs2_intrinsics( intrinsics.scaled_to( profile->width(), profile->height() ) ); + + // Handle intrinsics + auto intr = std::find_if( intrinsics.begin(), + intrinsics.end(), + [profile]( const realdds::video_intrinsics & intr ) + { return profile->width() == intr.width && profile->height() == intr.height; } ); + if( intr != intrinsics.end() ) // Some profiles don't have intrinsics + { + prof.intrinsics = to_rs2_intrinsics( *intr ); + } + return prof; } @@ -412,11 +422,27 @@ void dds_device_proxy::set_video_profile_intrinsics( std::shared_ptr< stream_pro auto vsp = std::dynamic_pointer_cast< video_stream_profile >( profile ); int const w = vsp->get_width(); int const h = vsp->get_height(); - vsp->set_intrinsics( - [stream_intrinsics = stream->get_intrinsics(), w, h]() + + auto & stream_intrinsics = stream->get_intrinsics(); + if( 1 == stream_intrinsics.size() ) + { + // A single set of intrinsics will get scaled to any profile resolution + vsp->set_intrinsics( [intrinsics = *stream_intrinsics.begin(), w, h]() + { return to_rs2_intrinsics( intrinsics.scaled_to( w, h ) ); } ); + } + else + { + // When we have multiple sets of intrinsics (one per resolution), we're limited to these + auto it = std::find_if( stream_intrinsics.begin(), + stream_intrinsics.end(), + [w, h]( const realdds::video_intrinsics & intr ) + { return intr.width == w && intr.height == h; } ); + if( it != stream_intrinsics.end() ) // Some profiles don't have intrinsics { - return to_rs2_intrinsics( stream_intrinsics.scaled_to( w, h ) ); - } ); + vsp->set_intrinsics( [intr = to_rs2_intrinsics( *it )]() { return intr; } ); + } + } + } diff --git a/third-party/realdds/include/realdds/dds-stream-server.h b/third-party/realdds/include/realdds/dds-stream-server.h index 1e16bcba0f0..564b4374ad5 100644 --- a/third-party/realdds/include/realdds/dds-stream-server.h +++ b/third-party/realdds/include/realdds/dds-stream-server.h @@ -85,8 +85,8 @@ class dds_video_stream_server : public dds_stream_server void open( std::string const & topic_name, std::shared_ptr< dds_publisher > const & ) override; - void set_intrinsics( const video_intrinsics & intrinsics ) { _intrinsics = intrinsics; } - video_intrinsics const & get_intrinsics() const { return _intrinsics; } + void set_intrinsics( const std::set< video_intrinsics > & intrinsics ) { _intrinsics = intrinsics; } + const std::set< video_intrinsics > & get_intrinsics() const { return _intrinsics; } void start_streaming( const image_header & ); void stop_streaming() override; @@ -97,7 +97,7 @@ class dds_video_stream_server : public dds_stream_server private: void check_profile( std::shared_ptr< dds_stream_profile > const & ) const override; - video_intrinsics _intrinsics; + std::set< video_intrinsics > _intrinsics; image_header _image_header; }; diff --git a/third-party/realdds/include/realdds/dds-stream.h b/third-party/realdds/include/realdds/dds-stream.h index faaac267c4a..cc4571297ba 100644 --- a/third-party/realdds/include/realdds/dds-stream.h +++ b/third-party/realdds/include/realdds/dds-stream.h @@ -68,14 +68,14 @@ class dds_video_stream : public dds_stream typedef std::function< void( topics::image_msg && f ) > on_data_available_callback; void on_data_available( on_data_available_callback cb ) { _on_data_available = cb; } - void set_intrinsics( const video_intrinsics & intrinsics ) { _intrinsics = intrinsics; } - const video_intrinsics & get_intrinsics() const { return _intrinsics; } + void set_intrinsics( const std::set< video_intrinsics > & intrinsics ) { _intrinsics = intrinsics; } + const std::set< video_intrinsics > & get_intrinsics() const { return _intrinsics; } protected: void handle_data() override; bool can_start_streaming() const override { return _on_data_available != nullptr; } - video_intrinsics _intrinsics; + std::set< video_intrinsics > _intrinsics; on_data_available_callback _on_data_available = nullptr; }; diff --git a/third-party/realdds/include/realdds/dds-trinsics.h b/third-party/realdds/include/realdds/dds-trinsics.h index 9115b857aa4..4c8f25e4922 100644 --- a/third-party/realdds/include/realdds/dds-trinsics.h +++ b/third-party/realdds/include/realdds/dds-trinsics.h @@ -53,8 +53,10 @@ struct video_intrinsics distortion_parameters distortion = { distortion_model::none, { 0 } }; bool is_valid() const { return focal_length.x > 0 && focal_length.y > 0; } + bool operator<( const video_intrinsics & rhs ) const { + // Arrange the intrinsics in order of increasing resolution (width then height) return width < rhs.width || ( width == rhs.width && height < rhs.height ); } diff --git a/third-party/realdds/src/dds-device-impl.cpp b/third-party/realdds/src/dds-device-impl.cpp index b6b03ef65e6..852e97e534d 100644 --- a/third-party/realdds/src/dds-device-impl.cpp +++ b/third-party/realdds/src/dds-device-impl.cpp @@ -693,25 +693,17 @@ void dds_device::impl::on_stream_options( json const & j, eprosima::fastdds::dds { if( auto video_stream = std::dynamic_pointer_cast< dds_video_stream >( stream ) ) { - video_intrinsics intrinsics; + std::set< video_intrinsics > intrinsics; if( j_int.is_array() ) { - // Old-style intrinsics; multiple resolutions are provided, but we pick only one - // TODO remove - LOG_WARNING( "[" << debug_name() << "] stream '" << stream->name() << "' is using old-style intrinsics format" ); - auto default_profile = std::dynamic_pointer_cast< dds_video_stream_profile >( video_stream->default_profile() ); - if( ! default_profile ) - DDS_THROW( runtime_error, "no default profile available to choose proper intrinsics" ); + // Multiple resolutions are provided, likely from legacy devices from the adapter for( auto & intr : j_int ) - { - intrinsics = video_intrinsics::from_json( intr ); - if( intrinsics.width == default_profile->width() && intrinsics.height == default_profile->height() ) - break; - } + intrinsics.insert( video_intrinsics::from_json( intr ) ); } else { - intrinsics = video_intrinsics::from_json( j_int ); + // Single intrinsics that will get scaled + intrinsics.insert( video_intrinsics::from_json( j_int ) ); } video_stream->set_intrinsics( intrinsics ); } diff --git a/third-party/realdds/src/dds-device-server.cpp b/third-party/realdds/src/dds-device-server.cpp index 6f065422155..97e737a4cb0 100644 --- a/third-party/realdds/src/dds-device-server.cpp +++ b/third-party/realdds/src/dds-device-server.cpp @@ -80,26 +80,22 @@ static void on_discovery_device_header( size_t const n_streams, for( auto & ex : extr ) extrinsics_json.push_back( json::array( { ex.first.first, ex.first.second, ex.second->to_json() } ) ); - topics::flexible_msg device_header( json{ + json j_device_header{ { topics::notification::key::id, topics::notification::device_header::id }, { topics::notification::device_header::key::n_streams, n_streams }, { topics::notification::device_header::key::extrinsics, std::move( extrinsics_json ) } - } ); - auto json_string = slice( device_header.custom_data< char const >(), device_header._data.size() ); - LOG_DEBUG( "-----> JSON = " << shorten_json_string( json_string, 300 ) << " size " << json_string.length() ); - //LOG_DEBUG( "-----> CBOR size = " << json::to_cbor( device_header.json_data() ).size() ); + }; + topics::flexible_msg device_header( j_device_header ); + LOG_DEBUG( "device-header " << std::setw( 4 ) << j_device_header << " size " << device_header._data.size() ); notifications.add_discovery_notification( std::move( device_header ) ); auto device_options = json::array(); for( auto & opt : options ) device_options.push_back( std::move( opt->to_json() ) ); - topics::flexible_msg device_options_message( json { - { topics::notification::key::id, topics::notification::device_options::id }, - { topics::notification::device_options::key::options, std::move( device_options ) } - } ); - json_string = slice( device_options_message.custom_data< char const >(), device_options_message._data.size() ); - LOG_DEBUG( "-----> JSON = " << shorten_json_string( json_string, 300 ) << " size " << json_string.length() ); - //LOG_DEBUG( "-----> CBOR size = " << json::to_cbor( device_options_message.json_data() ).size() ); + json j_device_options{ { topics::notification::key::id, topics::notification::device_options::id }, + { topics::notification::device_options::key::options, std::move( device_options ) } }; + topics::flexible_msg device_options_message( j_device_options ); + LOG_DEBUG( "device-options " << std::setw( 4 ) << j_device_options << " size " << device_options_message._data.size() ); notifications.add_discovery_notification( std::move( device_options_message ) ); } @@ -110,7 +106,7 @@ static void on_discovery_stream_header( std::shared_ptr< dds_stream_server > con auto profiles = json::array(); for( auto & sp : stream->profiles() ) profiles.push_back( std::move( sp->to_json() ) ); - topics::flexible_msg stream_header_message( json{ + json j_stream_header{ { topics::notification::key::id, topics::notification::stream_header::id }, { topics::notification::stream_header::key::type, stream->type_string() }, { topics::notification::stream_header::key::name, stream->name() }, @@ -118,10 +114,10 @@ static void on_discovery_stream_header( std::shared_ptr< dds_stream_server > con { topics::notification::stream_header::key::profiles, std::move( profiles ) }, { topics::notification::stream_header::key::default_profile_index, stream->default_profile_index() }, { topics::notification::stream_header::key::metadata_enabled, stream->metadata_enabled() }, - } ); - auto json_string = slice( stream_header_message.custom_data< char const >(), stream_header_message._data.size() ); - LOG_DEBUG( "-----> JSON = " << shorten_json_string( json_string, 300 ) << " size " << json_string.length() ); - //LOG_DEBUG( "-----> CBOR size = " << json::to_cbor( stream_header_message.json_data() ).size() ); + }; + topics::flexible_msg stream_header_message( j_stream_header ); + LOG_DEBUG( stream->name() << " stream-header " << std::setw( 4 ) << j_stream_header << " size " + << stream_header_message._data.size() ); notifications.add_discovery_notification( std::move( stream_header_message ) ); json j_stream_options = json::object( { @@ -133,13 +129,33 @@ static void on_discovery_stream_header( std::shared_ptr< dds_stream_server > con for( auto & opt : stream->options() ) j_options.push_back( std::move( opt->to_json() ) ); - auto & j_intrinsics = j_stream_options[topics::notification::stream_options::key::intrinsics]; if( auto video_stream = std::dynamic_pointer_cast< dds_video_stream_server >( stream ) ) { - j_intrinsics = video_stream->get_intrinsics().to_json(); + auto & intrinsics = video_stream->get_intrinsics(); + if( intrinsics.empty() ) + { + // No intrinsics... + } + else + { + auto & j_intrinsics = j_stream_options[topics::notification::stream_options::key::intrinsics]; + if( 1 == intrinsics.size() ) + { + // Use an object with a single intrinsic + j_intrinsics = intrinsics.begin()->to_json(); + } + else + { + // Multiple intrinsics are available + j_intrinsics = json::array(); + for( auto & i : intrinsics ) + j_intrinsics.push_back( i.to_json() ); + } + } } else if( auto motion_stream = std::dynamic_pointer_cast< dds_motion_stream_server >( stream ) ) { + auto & j_intrinsics = j_stream_options[topics::notification::stream_options::key::intrinsics]; j_intrinsics = json::object( { { topics::notification::stream_options::intrinsics::key::accel, motion_stream->get_accel_intrinsics().to_json() }, @@ -152,10 +168,9 @@ static void on_discovery_stream_header( std::shared_ptr< dds_stream_server > con for( auto & filter : stream->recommended_filters() ) j_filters.push_back( filter ); - topics::flexible_msg stream_options_message( std::move( j_stream_options ) ); - json_string = slice( stream_options_message.custom_data< char const >(), stream_options_message._data.size() ); - LOG_DEBUG( "-----> JSON = " << shorten_json_string( json_string, 300 ) << " size " << json_string.length() ); - //LOG_DEBUG( "-----> CBOR size = " << json::to_cbor( stream_options_message.json_data() ).size() ); + topics::flexible_msg stream_options_message( j_stream_options ); + LOG_DEBUG( stream->name() << " stream-options " << std::setw( 4 ) << j_stream_options << " size " + << stream_options_message._data.size() ); notifications.add_discovery_notification( std::move( stream_options_message ) ); } diff --git a/third-party/realdds/src/dds-trinsics.cpp b/third-party/realdds/src/dds-trinsics.cpp index 03b202606d3..352e820cb2d 100644 --- a/third-party/realdds/src/dds-trinsics.cpp +++ b/third-party/realdds/src/dds-trinsics.cpp @@ -169,6 +169,8 @@ json video_intrinsics::to_json() const break; case distortion_model::brown: + case distortion_model::inverse_brown: + case distortion_model::modified_brown: if( ! coeffs_j.is_array() ) DDS_THROW( runtime_error, "invalid distortion coefficients: " << coeffs_j ); if( coeffs_j.size() != 5 ) diff --git a/tools/dds/dds-adapter/lrs-device-controller.cpp b/tools/dds/dds-adapter/lrs-device-controller.cpp index 691e3c239e8..b1dd9e59e0a 100644 --- a/tools/dds/dds-adapter/lrs-device-controller.cpp +++ b/tools/dds/dds-adapter/lrs-device-controller.cpp @@ -152,7 +152,7 @@ std::vector< std::shared_ptr< realdds::dds_stream_server > > lrs_device_controll { std::map< std::string, realdds::dds_stream_profiles > stream_name_to_profiles; std::map< std::string, size_t > stream_name_to_default_profile; - std::map< std::string, realdds::video_intrinsics > stream_name_to_video_intrinsics; + std::map< std::string, std::set< realdds::video_intrinsics > > stream_name_to_video_intrinsics; // Iterate over all profiles of all sensors and build appropriate dds_stream_servers for( auto & sensor : _rs_dev.query_sensors() ) @@ -194,25 +194,12 @@ std::vector< std::shared_ptr< realdds::dds_stream_server > > lrs_device_controll realdds::dds_video_encoding::from_rs2( vsp.format() ), static_cast< uint16_t >( vsp.width() ), static_cast< int16_t >( vsp.height() ) ); - if( vsp.is_default() ) + try { - try - { - auto intr = to_realdds( vsp.get_intrinsics() ); - LOG_DEBUG( "=============> " << profiles.size() << " default " << intr.to_json().dump( 4 ) ); - stream_name_to_video_intrinsics[stream_name] = intr; - } - catch( ... ) {} //Some profiles don't have intrinsics - } - else - { - try - { - auto intr = to_realdds( vsp.get_intrinsics() ); - LOG_DEBUG( "-------------> " << profiles.size() << " " << intr.to_json().dump( 4 ) ); - } - catch( ... ) {} //Some profiles don't have intrinsics + auto intr = to_realdds( vsp.get_intrinsics() ); + stream_name_to_video_intrinsics[stream_name].insert( intr ); } + catch( ... ) {} //Some profiles don't have intrinsics } else if( auto const msp = rs2::motion_stream_profile( sp ) ) { @@ -237,9 +224,8 @@ std::vector< std::shared_ptr< realdds::dds_stream_server > > lrs_device_controll { if( sp.is_default() ) stream_name_to_default_profile[stream_name] = profiles.size(); - LOG_DEBUG( stream_name << " " << profiles.size() << ": " << profile->to_string() - << ( sp.is_default() ? " default" : "" ) ); profiles.push_back( profile ); + LOG_DEBUG( stream_name << ": " << profile->to_string() ); } } ); } diff --git a/unit-tests/dds/d405.py b/unit-tests/dds/d405.py index 136ed45c163..dc6828d2369 100644 --- a/unit-tests/dds/d405.py +++ b/unit-tests/dds/d405.py @@ -271,67 +271,67 @@ def color_stream_intrinsics(): intr = dds.video_intrinsics(); intr.width = 424 intr.height = 240 - intr.principal_point_x = 210.73512268066406 - intr.principal_point_y = 118.6335678100586 - intr.focal_lenght_x = 215.58554077148438 - intr.focal_lenght_y = 214.98973083496094 - intr.distortion_model = 2 - intr.distortion_coeffs = [-0.05454780161380768,0.056755296885967255,0.0010132350726053119,0.0003381881397217512,-0.01852494664490223] + intr.principal_point.x = 210.73512268066406 + intr.principal_point.y = 118.6335678100586 + intr.focal_length.x = 215.58554077148438 + intr.focal_length.y = 214.98973083496094 + intr.distortion.model = dds.distortion_model.inverse_brown + intr.distortion.coeffs = [-0.05454780161380768,0.056755296885967255,0.0010132350726053119,0.0003381881397217512,-0.01852494664490223] intrinsics.append( intr ) intr = dds.video_intrinsics(); intr.width = 480 intr.height = 270 - intr.principal_point_x = 238.57701110839844 - intr.principal_point_y = 133.4627685546875 - intr.focal_lenght_x = 242.53375244140625 - intr.focal_lenght_y = 241.86343383789063 - intr.distortion_model = 2 - intr.distortion_coeffs = [-0.05454780161380768,0.056755296885967255,0.0010132350726053119,0.0003381881397217512,-0.01852494664490223] + intr.principal_point.x = 238.57701110839844 + intr.principal_point.y = 133.4627685546875 + intr.focal_length.x = 242.53375244140625 + intr.focal_length.y = 241.86343383789063 + intr.distortion.model = dds.distortion_model.inverse_brown + intr.distortion.coeffs = [-0.05454780161380768,0.056755296885967255,0.0010132350726053119,0.0003381881397217512,-0.01852494664490223] intrinsics.append( intr ) intr = dds.video_intrinsics(); intr.width = 640 intr.height = 480 - intr.principal_point_x = 318.1026916503906 - intr.principal_point_y = 177.95034790039063 - intr.focal_lenght_x = 323.3783264160156 - intr.focal_lenght_y = 322.4845886230469 - intr.distortion_model = 2 - intr.distortion_coeffs = [-0.05454780161380768,0.056755296885967255,0.0010132350726053119,0.0003381881397217512,-0.01852494664490223] + intr.principal_point.x = 318.1026916503906 + intr.principal_point.y = 177.95034790039063 + intr.focal_length.x = 323.3783264160156 + intr.focal_length.y = 322.4845886230469 + intr.distortion.model = dds.distortion_model.inverse_brown + intr.distortion.coeffs = [-0.05454780161380768,0.056755296885967255,0.0010132350726053119,0.0003381881397217512,-0.01852494664490223] intrinsics.append( intr ) intr = dds.video_intrinsics(); intr.width = 640 intr.height = 480 - intr.principal_point_x = 317.4702453613281 - intr.principal_point_y = 237.2671356201172 - intr.focal_lenght_x = 431.1711120605469 - intr.focal_lenght_y = 429.9794616699219 - intr.distortion_model = 2 - intr.distortion_coeffs = [-0.05454780161380768,0.056755296885967255,0.0010132350726053119,0.0003381881397217512,-0.01852494664490223] + intr.principal_point.x = 317.4702453613281 + intr.principal_point.y = 237.2671356201172 + intr.focal_length.x = 431.1711120605469 + intr.focal_length.y = 429.9794616699219 + intr.distortion.model = dds.distortion_model.inverse_brown + intr.distortion.coeffs = [-0.05454780161380768,0.056755296885967255,0.0010132350726053119,0.0003381881397217512,-0.01852494664490223] intrinsics.append( intr ) intr = dds.video_intrinsics(); intr.width = 848 intr.height = 480 - intr.principal_point_x = 421.4702453613281 - intr.principal_point_y = 237.2671356201172 - intr.focal_lenght_x = 431.17108154296875 - intr.focal_lenght_y = 429.9794616699219 - intr.distortion_model = 2 - intr.distortion_coeffs = [-0.05454780161380768,0.056755296885967255,0.0010132350726053119,0.0003381881397217512,-0.01852494664490223] + intr.principal_point.x = 421.4702453613281 + intr.principal_point.y = 237.2671356201172 + intr.focal_length.x = 431.17108154296875 + intr.focal_length.y = 429.9794616699219 + intr.distortion.model = dds.distortion_model.inverse_brown + intr.distortion.coeffs = [-0.05454780161380768,0.056755296885967255,0.0010132350726053119,0.0003381881397217512,-0.01852494664490223] intrinsics.append( intr ) intr = dds.video_intrinsics(); intr.width = 1280 intr.height = 720 - intr.principal_point_x = 636.2053833007813 - intr.principal_point_y = 355.90069580078125 - intr.focal_lenght_x = 646.7566528320313 - intr.focal_lenght_y = 644.9691772460938 - intr.distortion_model = 2 - intr.distortion_coeffs = [-0.05454780161380768,0.056755296885967255,0.0010132350726053119,0.0003381881397217512,-0.01852494664490223] + intr.principal_point.x = 636.2053833007813 + intr.principal_point.y = 355.90069580078125 + intr.focal_length.x = 646.7566528320313 + intr.focal_length.y = 644.9691772460938 + intr.distortion.model = dds.distortion_model.inverse_brown + intr.distortion.coeffs = [-0.05454780161380768,0.056755296885967255,0.0010132350726053119,0.0003381881397217512,-0.01852494664490223] intrinsics.append( intr ) return set( intrinsics ) @@ -343,67 +343,67 @@ def depth_ir_common_intrinsics(): intr = dds.video_intrinsics(); intr.width = 424 intr.height = 240 - intr.principal_point_x = 214.33639526367188 - intr.principal_point_y = 119.0371322631836 - intr.focal_lenght_x = 210.80271911621094 - intr.focal_lenght_y = 210.80271911621094 - intr.distortion_model = 4 - intr.distortion_coeffs = [0.0,0.0,0.0,0.0,0.0] + intr.principal_point.x = 214.33639526367188 + intr.principal_point.y = 119.0371322631836 + intr.focal_length.x = 210.80271911621094 + intr.focal_length.y = 210.80271911621094 + intr.distortion.model = dds.distortion_model.brown + intr.distortion.coeffs = [0.0,0.0,0.0,0.0,0.0] intrinsics.append( intr ) intr = dds.video_intrinsics(); intr.width = 480 intr.height = 270 - intr.principal_point_x = 242.6449737548828 - intr.principal_point_y = 133.9099578857422 - intr.focal_lenght_x = 238.64459228515625 - intr.focal_lenght_y = 238.64459228515625 - intr.distortion_model = 4 - intr.distortion_coeffs = [0.0,0.0,0.0,0.0,0.0] + intr.principal_point.x = 242.6449737548828 + intr.principal_point.y = 133.9099578857422 + intr.focal_length.x = 238.64459228515625 + intr.focal_length.y = 238.64459228515625 + intr.distortion.model = dds.distortion_model.brown + intr.distortion.coeffs = [0.0,0.0,0.0,0.0,0.0] intrinsics.append( intr ) intr = dds.video_intrinsics(); intr.width = 640 intr.height = 360 - intr.principal_point_x = 323.5266418457031 - intr.principal_point_y = 178.54661560058594 - intr.focal_lenght_x = 318.1927795410156 - intr.focal_lenght_y = 318.1927795410156 - intr.distortion_model = 4 - intr.distortion_coeffs = [0.0,0.0,0.0,0.0,0.0] + intr.principal_point.x = 323.5266418457031 + intr.principal_point.y = 178.54661560058594 + intr.focal_length.x = 318.1927795410156 + intr.focal_length.y = 318.1927795410156 + intr.distortion.model = dds.distortion_model.brown + intr.distortion.coeffs = [0.0,0.0,0.0,0.0,0.0] intrinsics.append( intr ) intr = dds.video_intrinsics(); intr.width = 640 intr.height = 480 - intr.principal_point_x = 324.21624755859375 - intr.principal_point_y = 238.26242065429688 - intr.focal_lenght_x = 380.41363525390625 - intr.focal_lenght_y = 380.41363525390625 - intr.distortion_model = 4 - intr.distortion_coeffs = [0.0,0.0,0.0,0.0,0.0] + intr.principal_point.x = 324.21624755859375 + intr.principal_point.y = 238.26242065429688 + intr.focal_length.x = 380.41363525390625 + intr.focal_length.y = 380.41363525390625 + intr.distortion.model = dds.distortion_model.brown + intr.distortion.coeffs = [0.0,0.0,0.0,0.0,0.0] intrinsics.append( intr ) intr = dds.video_intrinsics(); intr.width = 848 intr.height = 480 - intr.principal_point_x = 428.67279052734375 - intr.principal_point_y = 238.0742645263672 - intr.focal_lenght_x = 421.6054382324219 - intr.focal_lenght_y = 421.6054382324219 - intr.distortion_model = 4 - intr.distortion_coeffs = [0.0,0.0,0.0,0.0,0.0] + intr.principal_point.x = 428.67279052734375 + intr.principal_point.y = 238.0742645263672 + intr.focal_length.x = 421.6054382324219 + intr.focal_length.y = 421.6054382324219 + intr.distortion.model = dds.distortion_model.brown + intr.distortion.coeffs = [0.0,0.0,0.0,0.0,0.0] intrinsics.append( intr ) intr = dds.video_intrinsics(); intr.width = 1280 intr.height = 720 - intr.principal_point_x = 647.0532836914063 - intr.principal_point_y = 357.0932312011719 - intr.focal_lenght_x = 636.3855590820313 - intr.focal_lenght_y = 636.3855590820313 - intr.distortion_model = 4 - intr.distortion_coeffs = [0.0,0.0,0.0,0.0,0.0] + intr.principal_point.x = 647.0532836914063 + intr.principal_point.y = 357.0932312011719 + intr.focal_length.x = 636.3855590820313 + intr.focal_length.y = 636.3855590820313 + intr.distortion.model = dds.distortion_model.brown + intr.distortion.coeffs = [0.0,0.0,0.0,0.0,0.0] intrinsics.append( intr ) return intrinsics @@ -415,12 +415,12 @@ def depth_stream_intrinsics(): intr = dds.video_intrinsics(); intr.width = 256 intr.height = 144 - intr.principal_point_x = 135.05328369140625 - intr.principal_point_y = 69.09323120117188 - intr.focal_lenght_x = 636.3855590820313 - intr.focal_lenght_y = 636.3855590820313 - intr.distortion_model = 4 - intr.distortion_coeffs = [0.0,0.0,0.0,0.0,0.0] + intr.principal_point.x = 135.05328369140625 + intr.principal_point.y = 69.09323120117188 + intr.focal_length.x = 636.3855590820313 + intr.focal_length.y = 636.3855590820313 + intr.distortion.model = dds.distortion_model.brown + intr.distortion.coeffs = [0.0,0.0,0.0,0.0,0.0] intrinsics.append( intr ) intrinsics.extend( depth_ir_common_intrinsics() ) diff --git a/unit-tests/dds/d435i.py b/unit-tests/dds/d435i.py index eed41846253..b49569fca57 100644 --- a/unit-tests/dds/d435i.py +++ b/unit-tests/dds/d435i.py @@ -490,6 +490,9 @@ def depth_ir_common_intrinsics(): intr.principal_point.y = 357.3431396484375 intr.focal_length.x = 631.3428955078125 intr.focal_length.y = 631.3428955078125 + intr.distortion.model = dds.distortion_model.brown + intr.distortion.coeffs = [0.0,0.0,0.0,0.0,0.0] + intrinsics.append( intr ) return intrinsics