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

Remove use of depth entirely

parent ad318846
No related branches found
No related tags found
1 merge request!158Implements #228 adaptive MLS and smoothing channel
Pipeline #16138 passed
This commit is part of merge request !158. Comments created here will be created in the context of that merge request.
......@@ -24,7 +24,7 @@ __global__ void smooth_chan_kernel(
// A distance has already been found
if (smoothing_out(x,y) < 1.0f) return;
float mindist = 50.0f;
float mindist = 100.0f;
const uchar4 c0 = colour_in.tex2D(ix, iy);
//const float d0 = depth_in.tex2D(ix, iy);
......@@ -46,13 +46,13 @@ __global__ void smooth_chan_kernel(
}
}
smoothing_out(x,y) = min(mindist / 50.0f, 1.0f);
smoothing_out(x,y) = min(mindist / 100.0f, 1.0f);
}
}
void ftl::cuda::smooth_channel(
ftl::cuda::TextureObject<uchar4> &colour_in,
ftl::cuda::TextureObject<float> &depth_in,
//ftl::cuda::TextureObject<float> &depth_in,
ftl::cuda::TextureObject<float> &smoothing_out,
const ftl::rgbd::Camera &camera,
float alpha,
......
......@@ -85,7 +85,7 @@ bool SmoothChannel::apply(ftl::rgbd::Frame &in, ftl::rgbd::Frame &out, ftl::rgbd
// Reduce to nearest
ftl::cuda::smooth_channel(
in.createTexture<uchar4>(Channel::Colour),
in.createTexture<float>(Channel::Depth),
//in.createTexture<float>(Channel::Depth),
out.createTexture<float>(Channel::Smoothing),
s->parameters(),
threshold,
......@@ -103,11 +103,11 @@ bool SmoothChannel::apply(ftl::rgbd::Frame &in, ftl::rgbd::Frame &out, ftl::rgbd
// Downscale images for next pass
cv::cuda::resize(in.get<GpuMat>(Channel::Colour), temp_[i].create<GpuMat>(Channel::Colour), cv::Size(width, height), 0.0, 0.0, cv::INTER_LINEAR);
cv::cuda::resize(in.get<GpuMat>(Channel::Depth), temp_[i].create<GpuMat>(Channel::Depth), cv::Size(width, height), 0.0, 0.0, cv::INTER_NEAREST);
//cv::cuda::resize(in.get<GpuMat>(Channel::Depth), temp_[i].create<GpuMat>(Channel::Depth), cv::Size(width, height), 0.0, 0.0, cv::INTER_NEAREST);
ftl::cuda::smooth_channel(
temp_[i].createTexture<uchar4>(Channel::Colour),
temp_[i].createTexture<float>(Channel::Depth),
//temp_[i].createTexture<float>(Channel::Depth),
out.getTexture<float>(Channel::Smoothing),
scaledCam,
threshold,
......
......@@ -31,7 +31,7 @@ void colour_mls_smooth(
void smooth_channel(
ftl::cuda::TextureObject<uchar4> &colour_in,
ftl::cuda::TextureObject<float> &depth_in,
//ftl::cuda::TextureObject<float> &depth_in,
ftl::cuda::TextureObject<float> &smoothing_out,
const ftl::rgbd::Camera &camera,
float alpha,
......
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