Skip to content
Snippets Groups Projects
Commit c50cfc32 authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Output depth in recon raycast mode

parent 24069150
No related branches found
No related tags found
No related merge requests found
Pipeline #11455 passed
...@@ -18,6 +18,8 @@ public: ...@@ -18,6 +18,8 @@ public:
hash_render_ = value("hash_renderer", false); hash_render_ = value("hash_renderer", false);
} }
bool isIntegerDepth() const { return hash_render_; }
~CUDARayCastSDF(void) { ~CUDARayCastSDF(void) {
destroy(); destroy();
} }
......
...@@ -26,6 +26,7 @@ VirtualSource::VirtualSource(ftl::rgbd::Source *host) ...@@ -26,6 +26,7 @@ VirtualSource::VirtualSource(ftl::rgbd::Source *host)
rgb_ = cv::Mat(cv::Size(params_.width,params_.height), CV_8UC3); rgb_ = cv::Mat(cv::Size(params_.width,params_.height), CV_8UC3);
idepth_ = cv::Mat(cv::Size(params_.width,params_.height), CV_32SC1); idepth_ = cv::Mat(cv::Size(params_.width,params_.height), CV_32SC1);
depth_ = cv::Mat(cv::Size(params_.width,params_.height), CV_32FC1);
} }
VirtualSource::~VirtualSource() { VirtualSource::~VirtualSource() {
...@@ -52,8 +53,12 @@ bool VirtualSource::grab() { ...@@ -52,8 +53,12 @@ bool VirtualSource::grab() {
rays_->render(scene_->getHashData(), scene_->getHashParams(), params, host_->getPose()); rays_->render(scene_->getHashData(), scene_->getHashParams(), params, host_->getPose());
//unique_lock<mutex> lk(mutex_); //unique_lock<mutex> lk(mutex_);
rays_->getRayCastData().download((int*)idepth_.data, (uchar3*)rgb_.data, rays_->getRayCastParams()); if (rays_->isIntegerDepth()) {
idepth_.convertTo(depth_, CV_32FC1, 1.0f / 100.0f); rays_->getRayCastData().download((int*)idepth_.data, (uchar3*)rgb_.data, rays_->getRayCastParams());
idepth_.convertTo(depth_, CV_32FC1, 1.0f / 100.0f);
} else {
rays_->getRayCastData().download((int*)depth_.data, (uchar3*)rgb_.data, rays_->getRayCastParams());
}
} }
return true; return true;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment