From edc5bb71e5cadc00f1ae1beef8a919b5a2943399 Mon Sep 17 00:00:00 2001 From: Vadim Pisarevsky Date: Thu, 21 Jan 2021 15:38:19 +0800 Subject: [PATCH] Merge pull request #2806 from vpisarev:kinfu_demo_orbbec * added orbbec camera intrinsic parameters for kinfu demo * removed trailing whitespace --- modules/rgbd/samples/io_utils.hpp | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/modules/rgbd/samples/io_utils.hpp b/modules/rgbd/samples/io_utils.hpp index c96d6c5345d..f0a3a1e7372 100644 --- a/modules/rgbd/samples/io_utils.hpp +++ b/modules/rgbd/samples/io_utils.hpp @@ -89,6 +89,19 @@ static const float k2 = -0.34f; static const float k3 = 0.12f; }; // namespace Kinect2Params +namespace AstraParams +{ +static const Size frameSize = Size(640, 480); +// approximate values, no guarantee to be correct +static const float fx = 535.4f; +static const float fy = 539.2f; +static const float cx = 320.1f; +static const float cy = 247.6f; +static const float k1 = 0.0f; +static const float k2 = 0.0f; +static const float k3 = 0.0f; +}; // namespace Kinect2Params + struct DepthSource { public: @@ -97,7 +110,8 @@ struct DepthSource DEPTH_LIST, DEPTH_KINECT2_LIST, DEPTH_KINECT2, - DEPTH_REALSENSE + DEPTH_REALSENSE, + DEPTH_ASTRA }; DepthSource(int cam) : DepthSource("", cam) {} @@ -116,7 +130,10 @@ struct DepthSource vc = VideoCapture(VideoCaptureAPIs::CAP_OPENNI2 + cam); if (vc.isOpened()) { - sourceType = Type::DEPTH_KINECT2; + if(cam == 20) + sourceType = Type::DEPTH_ASTRA; + else + sourceType = Type::DEPTH_KINECT2; } else { @@ -201,6 +218,15 @@ struct DepthSource frameSize = Kinect2Params::frameSize; } + else if (sourceType == Type::DEPTH_ASTRA) + { + fx = AstraParams::fx; + fy = AstraParams::fy; + cx = AstraParams::cx; + cy = AstraParams::cy; + + frameSize = AstraParams::frameSize; + } else { if (sourceType == Type::DEPTH_REALSENSE)