Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added orbbec camera intrinsic parameters for kinfu demo #2806

Merged
merged 2 commits into from
Jan 21, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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