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

Minor edits

parent a414414f
No related branches found
No related tags found
1 merge request!71Implements #130 for optional MLS merging
...@@ -228,13 +228,13 @@ __global__ void integrateMLSKernel(HashData hashData, HashParams hashParams, int ...@@ -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 // 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 if (screenPos.x+u < width && screenPos.y+v < height) { //on screen
float depth = tex2D<float>(camera.depth, screenPos.x+u, screenPos.y+v); 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); float3 worldPos = camera.pose * camera.params.kinectDepthToSkeleton(screenPos.x+u, screenPos.y+v, depth);
float weight = spatialWeighting(length(pfb - worldPos)); float weight = spatialWeighting(length(pfb - worldPos));
wpos += weight*worldPos; wpos += weight*worldPos;
wnorm += weight*make_float3(normal); //wnorm += weight*make_float3(normal);
weights += weight; weights += weight;
} }
} }
...@@ -242,9 +242,10 @@ __global__ void integrateMLSKernel(HashData hashData, HashParams hashParams, int ...@@ -242,9 +242,10 @@ __global__ void integrateMLSKernel(HashData hashData, HashParams hashParams, int
} }
wpos /= weights; 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); //printf("WEIGHTS: %f\n", weights);
...@@ -252,7 +253,7 @@ __global__ void integrateMLSKernel(HashData hashData, HashParams hashParams, int ...@@ -252,7 +253,7 @@ __global__ void integrateMLSKernel(HashData hashData, HashParams hashParams, int
// Calculate voxel sign values across a warp // Calculate voxel sign values across a warp
int warpNum = i / WARP_SIZE; 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); //uint valid_ballot = __ballot_sync(0xFFFFFFFF, (weights >= 1.0f) ? 1 : 0);
// Aggregate each warp result into voxel mask // Aggregate each warp result into voxel mask
......
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