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

Use depthThreshold in reproject

parent 88167227
No related branches found
No related tags found
1 merge request!195Renderer improvements
Pipeline #17044 passed
...@@ -215,7 +215,7 @@ __global__ void corresponding_point_kernel( ...@@ -215,7 +215,7 @@ __global__ void corresponding_point_kernel(
uint stepMask = 1 << bestStep; uint stepMask = 1 << bestStep;
if ((stepMask & badMask) || (stepMask & (badMask << 1)) || (stepMask & (badMask >> 1))) bestweight = 0.0f; if ((stepMask & badMask) || (stepMask & (badMask << 1)) || (stepMask & (badMask >> 1))) bestweight = 0.0f;
bestadjust = halfWarpBest(bestadjust, (bestweight > 0.0f) ? confidence : 0.0f); //bestadjust = halfWarpBest(bestadjust, (bestweight > 0.0f) ? confidence : 0.0f);
//Mask m(mask.tex2D(x,y)); //Mask m(mask.tex2D(x,y));
...@@ -226,8 +226,8 @@ __global__ void corresponding_point_kernel( ...@@ -226,8 +226,8 @@ __global__ void corresponding_point_kernel(
d1(x,y) = (0.4f*bestadjust) + depth1; d1(x,y) = (0.4f*bestadjust) + depth1;
//d2(bestScreen.x, bestScreen.y) = bestdepth2; //d2(bestScreen.x, bestScreen.y) = bestdepth2;
//screenOut(x,y) = bestScreen; //screenOut(x,y) = bestScreen;
//conf(x,y) = max(old,confidence); //bestweight * confidence; conf(x,y) = max(old,confidence); //bestweight * confidence;
conf(x,y) = max(old,fabs(bestadjust)); //conf(x,y) = max(old,fabs(bestadjust));
} }
//} //}
......
...@@ -72,6 +72,8 @@ bool MultiViewMLS::apply(ftl::rgbd::FrameSet &in, ftl::rgbd::FrameSet &out, cuda ...@@ -72,6 +72,8 @@ bool MultiViewMLS::apply(ftl::rgbd::FrameSet &in, ftl::rgbd::FrameSet &out, cuda
f.createTexture<float>(Channel::Confidence); f.createTexture<float>(Channel::Confidence);
f.create<GpuMat>(Channel::Screen, Format<short2>(size)); f.create<GpuMat>(Channel::Screen, Format<short2>(size));
f.createTexture<short2>(Channel::Screen); f.createTexture<short2>(Channel::Screen);
f.get<GpuMat>(Channel::Confidence).setTo(cv::Scalar(0.0f), cvstream);
} }
for (int iter=0; iter<iters; ++iter) { for (int iter=0; iter<iters; ++iter) {
...@@ -84,7 +86,7 @@ bool MultiViewMLS::apply(ftl::rgbd::FrameSet &in, ftl::rgbd::FrameSet &out, cuda ...@@ -84,7 +86,7 @@ bool MultiViewMLS::apply(ftl::rgbd::FrameSet &in, ftl::rgbd::FrameSet &out, cuda
for (size_t i=0; i<in.frames.size(); ++i) { for (size_t i=0; i<in.frames.size(); ++i) {
auto &f1 = in.frames[i]; auto &f1 = in.frames[i];
//f1.get<GpuMat>(Channel::Depth2).setTo(cv::Scalar(0.0f), cvstream); //f1.get<GpuMat>(Channel::Depth2).setTo(cv::Scalar(0.0f), cvstream);
f1.get<GpuMat>(Channel::Confidence).setTo(cv::Scalar(0.0f), cvstream); //f1.get<GpuMat>(Channel::Confidence).setTo(cv::Scalar(0.0f), cvstream);
Eigen::Vector4d d1(0.0, 0.0, 1.0, 0.0); Eigen::Vector4d d1(0.0, 0.0, 1.0, 0.0);
d1 = in.sources[i]->getPose() * d1; d1 = in.sources[i]->getPose() * d1;
......
...@@ -97,7 +97,7 @@ __global__ void reprojection_kernel( ...@@ -97,7 +97,7 @@ __global__ void reprojection_kernel(
const auto input = in.tex2D(screenPos.x, screenPos.y); //generateInput(in.tex2D((int)screenPos.x, (int)screenPos.y), params, worldPos); const auto input = in.tex2D(screenPos.x, screenPos.y); //generateInput(in.tex2D((int)screenPos.x, (int)screenPos.y), params, worldPos);
// TODO: Z checks need to interpolate between neighbors if large triangles are used // TODO: Z checks need to interpolate between neighbors if large triangles are used
float weight = ftl::cuda::weighting(fabs(camPos.z - d2), 0.02f); float weight = ftl::cuda::weighting(fabs(camPos.z - d2), params.depthThreshold);
/* Buehler C. et al. 2001. Unstructured Lumigraph Rendering. */ /* Buehler C. et al. 2001. Unstructured Lumigraph Rendering. */
/* Orts-Escolano S. et al. 2016. Holoportation: Virtual 3D teleportation in real-time. */ /* Orts-Escolano S. et al. 2016. Holoportation: Virtual 3D teleportation in real-time. */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment