diff --git a/applications/reconstruct/src/integrators.cu b/applications/reconstruct/src/integrators.cu index f907b6024b579dd2c102bd9b467d1728bdc077f6..bc0baee89860f82dce69eb8af4d8e4f3a24c0ce5 100644 --- a/applications/reconstruct/src/integrators.cu +++ b/applications/reconstruct/src/integrators.cu @@ -228,13 +228,13 @@ __global__ void integrateMLSKernel(HashData hashData, HashParams hashParams, int // For this voxel in hash, get its screen position and check it is on screen if (screenPos.x+u < width && screenPos.y+v < height) { //on screen float depth = tex2D<float>(camera.depth, screenPos.x+u, screenPos.y+v); - float4 normal = tex2D<float4>(camera.normal, screenPos.x+u, screenPos.y+v); + //float4 normal = tex2D<float4>(camera.normal, screenPos.x+u, screenPos.y+v); float3 worldPos = camera.pose * camera.params.kinectDepthToSkeleton(screenPos.x+u, screenPos.y+v, depth); float weight = spatialWeighting(length(pfb - worldPos)); wpos += weight*worldPos; - wnorm += weight*make_float3(normal); + //wnorm += weight*make_float3(normal); weights += weight; } } @@ -242,9 +242,10 @@ __global__ void integrateMLSKernel(HashData hashData, HashParams hashParams, int } wpos /= weights; - wnorm /= weights; + //wnorm /= weights; - float sdf = length(pfb - wpos); //wnorm.x * (pfb.x - wpos.x) + wnorm.y * (pfb.y - wpos.y) + wnorm.z * (pfb.z - wpos.z); + float sdf = length(pfb - wpos); + //float sdf = wnorm.x * (pfb.x - wpos.x) + wnorm.y * (pfb.y - wpos.y) + wnorm.z * (pfb.z - wpos.z); //printf("WEIGHTS: %f\n", weights); @@ -252,7 +253,7 @@ __global__ void integrateMLSKernel(HashData hashData, HashParams hashParams, int // Calculate voxel sign values across a warp int warpNum = i / WARP_SIZE; - uint solid_ballot = __ballot_sync(0xFFFFFFFF, (fabs(sdf) < 0.04f && weights > 10.0f) ? 1 : 0); + uint solid_ballot = __ballot_sync(0xFFFFFFFF, (fabs(sdf) < 0.04f && weights > 20.0f) ? 1 : 0); //uint valid_ballot = __ballot_sync(0xFFFFFFFF, (weights >= 1.0f) ? 1 : 0); // Aggregate each warp result into voxel mask