From 696f2697699ad2016dc0e354f8f1ef0a774b7b2e Mon Sep 17 00:00:00 2001 From: Vadim Pisarevsky Date: Tue, 5 Jan 2021 22:19:53 +0800 Subject: [PATCH 1/2] added orbbec camera intrinsic parameters for kinfu demo --- 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..a0570bdeff3 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) From 735ab6e934f0a5ef2148196b80656fc4183e3395 Mon Sep 17 00:00:00 2001 From: Vadim Pisarevsky Date: Thu, 14 Jan 2021 17:42:43 +0800 Subject: [PATCH 2/2] removed trailing whitespace --- modules/rgbd/samples/io_utils.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/rgbd/samples/io_utils.hpp b/modules/rgbd/samples/io_utils.hpp index a0570bdeff3..f0a3a1e7372 100644 --- a/modules/rgbd/samples/io_utils.hpp +++ b/modules/rgbd/samples/io_utils.hpp @@ -225,7 +225,7 @@ struct DepthSource cx = AstraParams::cx; cy = AstraParams::cy; - frameSize = AstraParams::frameSize; + frameSize = AstraParams::frameSize; } else {