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

Merge branch 'bug/337/mlsdestruct' into 'master'

Resolves #337 MLS block errors

Closes #337

See merge request nicolas.pope/ftl!279
parents f7287b44 8c84c12a
No related branches found
No related tags found
1 merge request!279Resolves #337 MLS block errors
Pipeline #22469 passed
...@@ -526,6 +526,7 @@ bool MultiViewMLS::apply(ftl::rgbd::FrameSet &in, ftl::rgbd::FrameSet &out, cuda ...@@ -526,6 +526,7 @@ bool MultiViewMLS::apply(ftl::rgbd::FrameSet &in, ftl::rgbd::FrameSet &out, cuda
f.getTexture<half4>(Channel::Normals), f.getTexture<half4>(Channel::Normals),
*centroid_vert_[i], *centroid_vert_[i],
f.createTexture<float>(Channel::Depth2, ftl::rgbd::Format<float>(size)), f.createTexture<float>(Channel::Depth2, ftl::rgbd::Format<float>(size)),
f.getTexture<float>(Channel::Depth),
f.getLeftCamera(), f.getLeftCamera(),
stream stream
); );
......
...@@ -559,6 +559,7 @@ __global__ void mls_adjust_depth_kernel( ...@@ -559,6 +559,7 @@ __global__ void mls_adjust_depth_kernel(
TextureObject<half4> normals_in, TextureObject<half4> normals_in,
TextureObject<float4> centroid_in, // Virtual depth map TextureObject<float4> centroid_in, // Virtual depth map
TextureObject<float> depth_out, TextureObject<float> depth_out,
TextureObject<float> depth_in,
ftl::rgbd::Camera camera) { ftl::rgbd::Camera camera) {
const int x = blockIdx.x*blockDim.x + threadIdx.x; const int x = blockIdx.x*blockDim.x + threadIdx.x;
...@@ -568,8 +569,8 @@ __global__ void mls_adjust_depth_kernel( ...@@ -568,8 +569,8 @@ __global__ void mls_adjust_depth_kernel(
const float3 aX = make_float3(centroid_in(x,y)); const float3 aX = make_float3(centroid_in(x,y));
const float3 nX = make_float3(normals_in(x,y)); const float3 nX = make_float3(normals_in(x,y));
//float d0 = depth_in.tex2D(x, y); float d0 = depth_in.tex2D(x, y);
depth_out(x,y) = aX.z; depth_out(x,y) = d0;
if (aX.z > camera.minDepth && aX.z < camera.maxDepth) { if (aX.z > camera.minDepth && aX.z < camera.maxDepth) {
float3 X = camera.screenToCam((int)(x),(int)(y),aX.z); float3 X = camera.screenToCam((int)(x),(int)(y),aX.z);
...@@ -663,6 +664,7 @@ void ftl::cuda::mls_adjust_depth( ...@@ -663,6 +664,7 @@ void ftl::cuda::mls_adjust_depth(
ftl::cuda::TextureObject<half4> &normals_in, ftl::cuda::TextureObject<half4> &normals_in,
ftl::cuda::TextureObject<float4> &centroid_in, ftl::cuda::TextureObject<float4> &centroid_in,
ftl::cuda::TextureObject<float> &depth_out, ftl::cuda::TextureObject<float> &depth_out,
ftl::cuda::TextureObject<float> &depth_in,
const ftl::rgbd::Camera &camera, const ftl::rgbd::Camera &camera,
cudaStream_t stream) { cudaStream_t stream) {
...@@ -672,7 +674,7 @@ void ftl::cuda::mls_adjust_depth( ...@@ -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 gridSize((depth_out.width() + THREADS_X - 1)/THREADS_X, (depth_out.height() + THREADS_Y - 1)/THREADS_Y);
const dim3 blockSize(THREADS_X, 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() ); cudaSafeCall( cudaGetLastError() );
......
...@@ -307,6 +307,7 @@ bool AggreMLS::apply(ftl::rgbd::Frame &in, ftl::rgbd::Frame &out, cudaStream_t s ...@@ -307,6 +307,7 @@ bool AggreMLS::apply(ftl::rgbd::Frame &in, ftl::rgbd::Frame &out, cudaStream_t s
in.createTexture<half4>(Channel::Normals), in.createTexture<half4>(Channel::Normals),
centroid_vert_, centroid_vert_,
temp_.createTexture<float>(Channel::Depth, ftl::rgbd::Format<float>(size)), temp_.createTexture<float>(Channel::Depth, ftl::rgbd::Format<float>(size)),
in.getTexture<float>(Channel::Depth),
in.getLeftCamera(), in.getLeftCamera(),
stream stream
); );
......
...@@ -46,6 +46,7 @@ void mls_adjust_depth( ...@@ -46,6 +46,7 @@ void mls_adjust_depth(
ftl::cuda::TextureObject<half4> &normals_in, ftl::cuda::TextureObject<half4> &normals_in,
ftl::cuda::TextureObject<float4> &centroid_in, ftl::cuda::TextureObject<float4> &centroid_in,
ftl::cuda::TextureObject<float> &depth_out, ftl::cuda::TextureObject<float> &depth_out,
ftl::cuda::TextureObject<float> &depth_in,
const ftl::rgbd::Camera &camera, const ftl::rgbd::Camera &camera,
cudaStream_t stream); cudaStream_t stream);
......
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