diff --git a/components/operators/src/fusion/mvmls.cpp b/components/operators/src/fusion/mvmls.cpp index 55b992957805ec2cb6fe9d00baad4b7f5193202f..41e0a2eef1f7b2c44e9b3557c445946abe53de3d 100644 --- a/components/operators/src/fusion/mvmls.cpp +++ b/components/operators/src/fusion/mvmls.cpp @@ -526,6 +526,7 @@ bool MultiViewMLS::apply(ftl::rgbd::FrameSet &in, ftl::rgbd::FrameSet &out, cuda f.getTexture<half4>(Channel::Normals), *centroid_vert_[i], f.createTexture<float>(Channel::Depth2, ftl::rgbd::Format<float>(size)), + f.getTexture<float>(Channel::Depth), f.getLeftCamera(), stream ); diff --git a/components/operators/src/mls.cu b/components/operators/src/mls.cu index afe15d5592bc396da1abc5703c9f8c0a96b00d49..ee3ce41255e1f24d3f6066e648f26e7caa501f0e 100644 --- a/components/operators/src/mls.cu +++ b/components/operators/src/mls.cu @@ -559,6 +559,7 @@ __global__ void mls_adjust_depth_kernel( TextureObject<half4> normals_in, TextureObject<float4> centroid_in, // Virtual depth map TextureObject<float> depth_out, + TextureObject<float> depth_in, ftl::rgbd::Camera camera) { const int x = blockIdx.x*blockDim.x + threadIdx.x; @@ -568,8 +569,8 @@ __global__ void mls_adjust_depth_kernel( const float3 aX = make_float3(centroid_in(x,y)); const float3 nX = make_float3(normals_in(x,y)); - //float d0 = depth_in.tex2D(x, y); - depth_out(x,y) = aX.z; + float d0 = depth_in.tex2D(x, y); + depth_out(x,y) = d0; if (aX.z > camera.minDepth && aX.z < camera.maxDepth) { float3 X = camera.screenToCam((int)(x),(int)(y),aX.z); @@ -663,6 +664,7 @@ void ftl::cuda::mls_adjust_depth( ftl::cuda::TextureObject<half4> &normals_in, ftl::cuda::TextureObject<float4> ¢roid_in, ftl::cuda::TextureObject<float> &depth_out, + ftl::cuda::TextureObject<float> &depth_in, const ftl::rgbd::Camera &camera, cudaStream_t stream) { @@ -672,7 +674,7 @@ void ftl::cuda::mls_adjust_depth( const dim3 gridSize((depth_out.width() + THREADS_X - 1)/THREADS_X, (depth_out.height() + THREADS_Y - 1)/THREADS_Y); const dim3 blockSize(THREADS_X, THREADS_Y); - mls_adjust_depth_kernel<<<gridSize, blockSize, 0, stream>>>(normals_in, centroid_in, depth_out, camera); + mls_adjust_depth_kernel<<<gridSize, blockSize, 0, stream>>>(normals_in, centroid_in, depth_out, depth_in, camera); cudaSafeCall( cudaGetLastError() ); diff --git a/components/operators/src/smoothing.cpp b/components/operators/src/smoothing.cpp index 49ca3f4b9e76b8f7bebbd28b6b4dfa8fa1b64bb6..7391626224673e90e481750905f13191acd4755c 100644 --- a/components/operators/src/smoothing.cpp +++ b/components/operators/src/smoothing.cpp @@ -307,6 +307,7 @@ bool AggreMLS::apply(ftl::rgbd::Frame &in, ftl::rgbd::Frame &out, cudaStream_t s in.createTexture<half4>(Channel::Normals), centroid_vert_, temp_.createTexture<float>(Channel::Depth, ftl::rgbd::Format<float>(size)), + in.getTexture<float>(Channel::Depth), in.getLeftCamera(), stream ); diff --git a/components/operators/src/smoothing_cuda.hpp b/components/operators/src/smoothing_cuda.hpp index 06c6d713f81ab41e14695bcad21943be7d71e3d4..5454d91e2aea43c49ae806524a98bc0cc85ef086 100644 --- a/components/operators/src/smoothing_cuda.hpp +++ b/components/operators/src/smoothing_cuda.hpp @@ -46,6 +46,7 @@ void mls_adjust_depth( ftl::cuda::TextureObject<half4> &normals_in, ftl::cuda::TextureObject<float4> ¢roid_in, ftl::cuda::TextureObject<float> &depth_out, + ftl::cuda::TextureObject<float> &depth_in, const ftl::rgbd::Camera &camera, cudaStream_t stream);