Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
ftl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nicolas Pope
ftl
Commits
1f608d52
Commit
1f608d52
authored
5 years ago
by
Nicolas Pope
Browse files
Options
Downloads
Patches
Plain Diff
Minor edits
parent
a414414f
No related branches found
No related tags found
1 merge request
!71
Implements #130 for optional MLS merging
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
applications/reconstruct/src/integrators.cu
+6
-5
6 additions, 5 deletions
applications/reconstruct/src/integrators.cu
with
6 additions
and
5 deletions
applications/reconstruct/src/integrators.cu
+
6
−
5
View file @
1f608d52
...
@@ -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.04
f
&&
weights
>
1
0.0
f
)
?
1
:
0
);
uint
solid_ballot
=
__ballot_sync
(
0xFFFFFFFF
,
(
fabs
(
sdf
)
<
0.04
f
&&
weights
>
2
0.0
f
)
?
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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment