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

WIP MLS Clipping

parent 9c3c7da4
No related branches found
No related tags found
1 merge request!71Implements #130 for optional MLS merging
Pipeline #12401 passed
...@@ -254,6 +254,10 @@ __global__ void mls_smooth_kernel(ftl::cuda::TextureObject<float4> output, HashP ...@@ -254,6 +254,10 @@ __global__ void mls_smooth_kernel(ftl::cuda::TextureObject<float4> output, HashP
if (depth >= mainCamera.params.m_sensorDepthWorldMin && depth <= mainCamera.params.m_sensorDepthWorldMax) { if (depth >= mainCamera.params.m_sensorDepthWorldMin && depth <= mainCamera.params.m_sensorDepthWorldMax) {
float3 mPos = mainCamera.pose * mainCamera.params.kinectDepthToSkeleton(x, y, depth); float3 mPos = mainCamera.pose * mainCamera.params.kinectDepthToSkeleton(x, y, depth);
if ((!(hashParams.m_flags & ftl::voxhash::kFlagClipping)) || (mPos.x > hashParams.m_minBounds.x && mPos.x < hashParams.m_maxBounds.x &&
mPos.y > hashParams.m_minBounds.y && mPos.y < hashParams.m_maxBounds.y &&
mPos.z > hashParams.m_minBounds.z && mPos.z < hashParams.m_maxBounds.z)) {
if (hashParams.m_flags & ftl::voxhash::kFlagMLS) { if (hashParams.m_flags & ftl::voxhash::kFlagMLS) {
for (uint cam2=0; cam2<numcams; ++cam2) { for (uint cam2=0; cam2<numcams; ++cam2) {
if (cam2 == cam) continue; //weights += mlsCamera(cam2, mPos, c1, wpos); if (cam2 == cam) continue; //weights += mlsCamera(cam2, mPos, c1, wpos);
...@@ -274,6 +278,7 @@ __global__ void mls_smooth_kernel(ftl::cuda::TextureObject<float4> output, HashP ...@@ -274,6 +278,7 @@ __global__ void mls_smooth_kernel(ftl::cuda::TextureObject<float4> output, HashP
} }
} }
} }
}
void ftl::cuda::mls_smooth(TextureObject<float4> &output, const HashParams &hashParams, int numcams, int cam, cudaStream_t stream) { void ftl::cuda::mls_smooth(TextureObject<float4> &output, const HashParams &hashParams, int numcams, int cam, cudaStream_t stream) {
const dim3 gridSize((output.width() + T_PER_BLOCK - 1)/T_PER_BLOCK, (output.height() + T_PER_BLOCK - 1)/T_PER_BLOCK); const dim3 gridSize((output.width() + T_PER_BLOCK - 1)/T_PER_BLOCK, (output.height() + T_PER_BLOCK - 1)/T_PER_BLOCK);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment