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

V3 RGBD Node #1198

Open
wants to merge 51 commits into
base: v3_develop
Choose a base branch
from
Open

V3 RGBD Node #1198

wants to merge 51 commits into from

Conversation

Serafadam
Copy link
Contributor

@Serafadam Serafadam commented Dec 18, 2024

  • Host RGBD Node
  • Basalt fixes
  • Using stock TBB for Basalt
  • Added optional Kompute support for performing calculations on GPU devices with Vulkan support

@Serafadam Serafadam requested a review from moratom December 18, 2024 15:44
Copy link
Collaborator

@moratom moratom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Adam! Look forward to getting this in :)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no official package?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not yet, though I can make PR to the official repo

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can move the example to a dedicated folder

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's wait on the needed Visualizer changes so this examples start working.

So either that blocks that PR or we add the example later.

examples/cpp/HostNodes/rgbd.cpp Outdated Show resolved Hide resolved
examples/cpp/Visualizer/visualizer_rgbd.cpp Outdated Show resolved Hide resolved
tests/src/ondevice_tests/rgbd_test.cpp Outdated Show resolved Hide resolved
Comment on lines +283 to +300
auto pc = std::make_shared<PointCloudData>();
pc->setTimestamp(colorFrame->getTimestamp());
pc->setTimestampDevice(colorFrame->getTimestampDevice());
pc->setSequenceNum(colorFrame->getSequenceNum());
pc->setInstanceNum(colorFrame->getInstanceNum());
auto width = colorFrame->getWidth();
auto height = colorFrame->getHeight();
pc->setSize(width, height);

std::vector<Point3fRGB> points;
// Fill the point cloud
auto* depthData = depthFrame->getData().data();
auto* colorData = colorFrame->getData().data();
// Use GPU to compute point cloud
pimpl->computePointCloud(depthData, colorData, points);

pc->setPointsRGB(points);
pcl.send(pc);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should make sure that at width&height of the RGB frame and the Depth frame match.

Ideally also that they are aligned between each other.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Width & height are checked in initialize method. For aligment checking, we should just check frame id, right?

include/depthai/pipeline/node/host/RGBD.hpp Outdated Show resolved Hide resolved
Comment on lines +255 to +264
auto calibHandler = getParentPipeline().getDefaultDevice()->readCalibration();
auto camID = static_cast<CameraBoardSocket>(colorFrame->getInstanceNum());
auto width = colorFrame->getWidth();
auto height = colorFrame->getHeight();
auto intrinsics = calibHandler.getCameraIntrinsics(camID, width, height);
float fx = intrinsics[0][0];
float fy = intrinsics[1][1];
float cx = intrinsics[0][2];
float cy = intrinsics[1][2];
pimpl->setIntrinsics(fx, fy, cx, cy, width, height);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's get the intrinsics from the first frame instead (after rvc2_img_transformations_v2 is merged which will likely be before this PR)

Comment on lines +230 to +242
std::shared_ptr<RGBD> RGBD::build(bool autocreate, std::pair<int, int> size) {
if(!autocreate) {
return std::static_pointer_cast<RGBD>(shared_from_this());
}
auto pipeline = getParentPipeline();
auto colorCam = pipeline.create<node::Camera>()->build();
auto depth = pipeline.create<node::StereoDepth>()->build(true);
auto* out = colorCam->requestOutput(size, dai::ImgFrame::Type::RGB888i);
out->link(inColor);
out->link(depth->inputAlignTo);
depth->depth.link(inDepth);
return build();
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a warning that this API is "global" and that if used the cameras can't be used for other things.
And we can add the same warning in StereoDepth too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants