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

Experiment with post align filtering

parent ba827213
No related branches found
No related tags found
1 merge request!158Implements #228 adaptive MLS and smoothing channel
......@@ -248,14 +248,18 @@ static void run(ftl::Configurable *root) {
bool busy = false;
// Create the source depth map filters
auto *filters = ftl::config::create<ftl::Filters>(root, "filters");
filters->create<ftl::filters::ColourChannels>("colour");
filters->create<ftl::filters::DepthSmoother>("hfnoise");
filters->create<ftl::filters::MLSSmoother>("mls");
auto *prefilter = ftl::config::create<ftl::Filters>(root, "pre_filters");
prefilter->create<ftl::filters::ColourChannels>("colour");
prefilter->create<ftl::filters::DepthSmoother>("hfnoise");
prefilter->create<ftl::filters::MLSSmoother>("mls");
auto *postfilter = ftl::config::create<ftl::Filters>(root, "post_filters");
postfilter->create<ftl::filters::DepthSmoother>("hfnoise");
postfilter->create<ftl::filters::MLSSmoother>("mls");
group->setLatency(4);
group->setName("ReconGroup");
group->sync([splat,virt,&busy,&slave,&scene_A,&scene_B,&align,controls,filters](ftl::rgbd::FrameSet &fs) -> bool {
group->sync([splat,virt,&busy,&slave,&scene_A,&scene_B,&align,controls,prefilter,postfilter](ftl::rgbd::FrameSet &fs) -> bool {
//cudaSetDevice(scene->getCUDADevice());
//if (slave.isPaused()) return true;
......@@ -270,7 +274,7 @@ static void run(ftl::Configurable *root) {
// Swap the entire frameset to allow rapid return
fs.swapTo(scene_A);
ftl::pool.push([&scene_B,&scene_A,&busy,&slave,&align, filters](int id) {
ftl::pool.push([&scene_B,&scene_A,&busy,&slave,&align, prefilter, postfilter](int id) {
//cudaSetDevice(scene->getCUDADevice());
// TODO: Release frameset here...
//cudaSafeCall(cudaStreamSynchronize(scene->getIntegrationStream()));
......@@ -281,13 +285,20 @@ static void run(ftl::Configurable *root) {
for (int i=0; i<scene_A.frames.size(); ++i) {
auto &f = scene_A.frames[i];
auto s = scene_A.sources[i];
filters->filter(f, s, 0);
prefilter->filter(f, s, 0);
}
// Send all frames to GPU, block until done?
//scene_A.upload(Channel::Colour + Channel::Depth); // TODO: (Nick) Add scene stream.
align->process(scene_A);
// Apply post-filters to all frames
/*for (int i=0; i<scene_A.frames.size(); ++i) {
auto &f = scene_A.frames[i];
auto s = scene_A.sources[i];
postfilter->filter(f, s, 0);
}*/
// TODO: To use second GPU, could do a download, swap, device change,
// then upload to other device. Or some direct device-2-device copy.
scene_A.swapTo(scene_B);
......
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