Comments (3)
I'm having problems when performing Color to Depth and Depth to Color transformations using new align filter added in 1.10.5 release. It looks like it doesn't take into account lens distortion. However, when using CoordinateTransformHelper::transformationDepthFrameToColorCamera, the result of the transformation is correct. The thing is that I would like to be able to transform images captured from both geometries and CoordinateTransformHelper only supports D2C. Is there a way to perform a C2D transformation without getting weird distoritons or is it intended to be added in the future?
This is how I'm using align filter:
std::shared_ptr<ob::Align> align = std::make_shared<ob::Align>(OB_STREAM_DEPTH); // Wait up to 100ms for a frameset auto frameset = pipeline->waitForFrames(100); // Check if a fameset has been grabbed and if it has color and depth frames in it if (frameset != nullptr && frameset->colorFrame() != nullptr && frameset->depthFrame() != nullptr) { std::shared_ptr<ob::Frame> alignedFrame; try { alignedFrame = align->process(frameset); } catch (ob::Error& e) { // Handle the exception } auto alignedFrameSet = alignedFrame->as<ob::FrameSet>(); auto colorFrame = alignedFrameSet->colorFrame(); auto depthFrame = alignedFrameSet->depthFrame(); // Check if there are color and depth frames inside the frameset grabbed if (colorFrame != nullptr && depthFrame != nullptr) { // Save color and depth data into a CameraFrame std::shared_ptr<CameraFrame> frame = std::make_shared<CameraFrame>(); cv::Mat colorMat(colorFrame->height(), colorFrame->width(), CV_8UC4, colorFrame->data(), cv::Mat::AUTO_STEP); cv::cvtColor(colorMat, frame->color, cv::COLOR_BGRA2RGBA); cv::imwrite("ColorImage", colorMat); cv::Mat depthMat(depthFrame->height(), depthFrame->width(), CV_16U, depthFrame->data(), cv::Mat::AUTO_STEP); cv::imwrite("DepthImage", depthMat); } }
This is how im using CoordinateTransformHelper:
// Wait up to 100ms for a frameset auto frameset = pipeline->waitForFrames(100); // Check if a fameset has been grabbed and if it has color and depth frames in it if (frameset != nullptr && frameset->colorFrame() != nullptr && frameset->depthFrame() != nullptr) { auto colorFrame = frameset->colorFrame(); auto depthFrame = frameset->depthFrame(); // Check if there are color and depth frames inside the frameset grabbed if (colorFrame != nullptr && depthFrame != nullptr) { // Temporary depth to color transformation since align doesn't seem to take into account lens distortion std::shared_ptr<ob::VideoFrame> transDepthFrame = (ob::CoordinateTransformHelper::transformationDepthFrameToColorCamera(device, depthFrame, colorFrame->width(), colorFrame->height()))->as<ob::VideoFrame>(); if (transDepthFrame != nullptr) { // Save color and depth data into a CameraFrame std::shared_ptr<CameraFrame> frame = std::make_shared<CameraFrame>(); cv::Mat colorMat(colorFrame->height(), colorFrame->width(), CV_8UC4, colorFrame->data(), cv::Mat::AUTO_STEP); cv::cvtColor(colorMat, frame->color, cv::COLOR_BGRA2RGBA); cv::imwrite("ColorImage", colorMat); cv::Mat depthMat(transDepthFrame->height(), transDepthFrame->width(), CV_16U, transDepthFrame->data(), cv::Mat::AUTO_STEP); cv::imwrite("DepthImage", depthMat); } } }
What type of device are you using? The Align Filter currently only supports Gemini 330 series devices. It will support all devices in the future.
from orbbecsdk.
In future versions, the interface will be unified, and there will be a single interface to implement both D2C and C2D functionality,all Device use the Align Filter.
from orbbecsdk.
Thanks for the response! I'm using Femtobolt I guess I'll just have to wait ; )
from orbbecsdk.
Related Issues (20)
- Found a usb port without interface url HOT 2
- How to increase FrameBuffer size? HOT 5
- Running multiple Bolts synchronized with external trigger HOT 1
- Failed to load depth engine plugin HOT 4
- Get depth frame failed HOT 2
- Difference between DepthFrame in OrbbecViewer and my own app
- Different Stream types on ARM vs x86 architectures HOT 1
- API for network discovery / listing Femto Mega devices? HOT 3
- How to obtain camera temperature? HOT 1
- 加载深度引擎插件失败,初始化深度引擎失败。 HOT 4
- pyorbbecsdk.OBError: No required type sensor found! sensorType: OB_SENSOR_IR_LEFT HOT 3
- Maximum working temperature HOT 1
- "Depth engine create and initialize failed" after I changed AlignMode to software HOT 2
- save RGBD video data to disk in 30 FPS HOT 2
- Ubuntu 20.04 can not view point-cloud using orbbec viewer HOT 3
- when saving RGBD D2C-aligned data to disk, the data size is huge HOT 1
- Disable log file HOT 1
- SDK unable to see gemini E HOT 3
- WSL2 and Ubuntu 20.04 - Femto Bolt --- libEGL warning: failed to open /dev/dri/renderD128: Permission denied
- Femto bolt 多设备同步录制问题
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from orbbecsdk.