diff --git a/src/mynteye/api/config.cc b/src/mynteye/api/config.cc index 7cd5184..4d20964 100644 --- a/src/mynteye/api/config.cc +++ b/src/mynteye/api/config.cc @@ -41,6 +41,13 @@ std::shared_ptr getDefaultIntrinsics() { return res; } +std::shared_ptr getDefaultIntrinsics(const StreamRequest &request) { + auto res = getDefaultIntrinsics(); + res->resize_scale = static_cast(request.width / res->width); + res->ResizeIntrinsics(); + return res; +} + std::shared_ptr getDefaultExtrinsics() { auto res = std::make_shared(); double rotation[9] = { diff --git a/src/mynteye/api/config.h b/src/mynteye/api/config.h index 8376cdd..7768c22 100644 --- a/src/mynteye/api/config.h +++ b/src/mynteye/api/config.h @@ -20,6 +20,7 @@ MYNTEYE_BEGIN_NAMESPACE std::shared_ptr getDefaultIntrinsics(); +std::shared_ptr getDefaultIntrinsics(const StreamRequest &request); std::shared_ptr getDefaultExtrinsics(); diff --git a/src/mynteye/api/synthetic.cc b/src/mynteye/api/synthetic.cc index 851e24d..8aa83ab 100644 --- a/src/mynteye/api/synthetic.cc +++ b/src/mynteye/api/synthetic.cc @@ -66,8 +66,9 @@ void Synthetic::InitCalibInfo() { calib_default_tag_ = true; calib_model_ = CalibrationModel::PINHOLE; LOG(INFO) << "camera calib model: unknow, use default pinhole data"; - intr_left_ = getDefaultIntrinsics(); - intr_right_ = getDefaultIntrinsics(); + auto stream_request = api_->GetStreamRequest(); + intr_left_ = getDefaultIntrinsics(stream_request); + intr_right_ = getDefaultIntrinsics(stream_request); extr_ = getDefaultExtrinsics(); } }