Skip to content

Commit

Permalink
Merge pull request #2806 from vpisarev:kinfu_demo_orbbec
Browse files Browse the repository at this point in the history
* added orbbec camera intrinsic parameters for kinfu demo

* removed trailing whitespace
  • Loading branch information
vpisarev authored Jan 21, 2021
1 parent 59a9c88 commit edc5bb7
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions modules/rgbd/samples/io_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -97,7 +110,8 @@ struct DepthSource
DEPTH_LIST,
DEPTH_KINECT2_LIST,
DEPTH_KINECT2,
DEPTH_REALSENSE
DEPTH_REALSENSE,
DEPTH_ASTRA
};

DepthSource(int cam) : DepthSource("", cam) {}
Expand All @@ -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
{
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit edc5bb7

Please sign in to comment.