From 8af6001a03af874dd42e75b6a9bdc7bec03f9066 Mon Sep 17 00:00:00 2001 From: Nicolas Pope <nwpope@utu.fi> Date: Sat, 28 Sep 2019 11:04:01 +0300 Subject: [PATCH] Minor edit to ignore bad points --- applications/reconstruct/src/ilw/ilw.cu | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/applications/reconstruct/src/ilw/ilw.cu b/applications/reconstruct/src/ilw/ilw.cu index c094c9e6b..e60778d6a 100644 --- a/applications/reconstruct/src/ilw/ilw.cu +++ b/applications/reconstruct/src/ilw/ilw.cu @@ -141,14 +141,20 @@ __global__ void move_points_kernel( const unsigned int y = blockIdx.y*blockDim.y + threadIdx.y; if (x < p.width() && y < p.height()) { - const float4 world = p(x,y); - float4 vec = ev.tex2D((int)x,(int)y); - float contrib = vec.w; + const float4 world = p(x,y); + if (world.x == MINF) return; + + float4 vec = make_float4(0.0f, 0.0f, 0.0f, 0.0f); //ev.tex2D((int)x,(int)y); + float contrib = 0.0f; // Calculate screen space distortion with neighbours for (int v=-MOTION_RADIUS; v<=MOTION_RADIUS; ++v) { for (int u=-MOTION_RADIUS; u<=MOTION_RADIUS; ++u) { const float4 vecn = ev.tex2D((int)x+u,(int)y+v); + //const float3 pn = make_float3(p.tex2D((int)x+u,(int)y+v)); + //if (pn.x == MINF) continue; + + //const float s = ftl::cuda::spatialWeighting(pn, make_float3(world), 0.04f); contrib += vecn.w; vec += vecn.w * vecn; } -- GitLab