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
d5a7d1d9
Commit
d5a7d1d9
authored
5 years ago
by
Nicolas Pope
Browse files
Options
Downloads
Patches
Plain Diff
WIP Dynamic smoothing
parent
a7113d09
No related branches found
No related tags found
1 merge request
!90
Implement #150 splat resizing
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
applications/reconstruct/src/dibr.cu
+6
-4
6 additions, 4 deletions
applications/reconstruct/src/dibr.cu
with
6 additions
and
4 deletions
applications/reconstruct/src/dibr.cu
+
6
−
4
View file @
d5a7d1d9
...
@@ -400,6 +400,8 @@ __device__ inline float warpMin(float e) {
...
@@ -400,6 +400,8 @@ __device__ inline float warpMin(float e) {
}
}
#define ENERGY_THRESHOLD 0.1f
#define ENERGY_THRESHOLD 0.1f
#define SMOOTHING_MULTIPLIER_A 10.0f
#define SMOOTHING_MULTIPLIER_B 5.0f
/*
/*
...
@@ -449,7 +451,7 @@ __device__ inline float warpMin(float e) {
...
@@ -449,7 +451,7 @@ __device__ inline float warpMin(float e) {
// 1) Depth from original source
// 1) Depth from original source
// 2) Colour contrast in underlying RGB
// 2) Colour contrast in underlying RGB
// 3) Estimated noise levels in depth values
// 3) Estimated noise levels in depth values
if
(
point
.
z
>
clusterBase
&&
point
.
z
<
params
.
camera
.
m_sensorDepthWorldMax
&&
length
(
point
-
camPos
)
<=
0.04
f
)
{
if
(
point
.
z
>
clusterBase
&&
point
.
z
<
params
.
camera
.
m_sensorDepthWorldMax
&&
length
(
point
-
camPos
)
<=
SMOOTHING_MULTIPLIER_A
*
(
point
.
z
/
params
.
camera
.
fx
)
)
{
atomicMin
(
&
minimum
[
warp
],
point
.
z
*
1000.0
f
);
atomicMin
(
&
minimum
[
warp
],
point
.
z
*
1000.0
f
);
}
}
}
}
...
@@ -471,7 +473,7 @@ __device__ inline float warpMin(float e) {
...
@@ -471,7 +473,7 @@ __device__ inline float warpMin(float e) {
const
float3
point
=
params
.
camera
.
kinectDepthToSkeleton
(
x
+
u
,
y
+
v
,
float
(
point_in
.
tex2D
(
x
+
u
,
y
+
v
))
/
1000.0
f
);
const
float3
point
=
params
.
camera
.
kinectDepthToSkeleton
(
x
+
u
,
y
+
v
,
float
(
point_in
.
tex2D
(
x
+
u
,
y
+
v
))
/
1000.0
f
);
// If it is close enough...
// If it is close enough...
if
(
point
.
z
>
params
.
camera
.
m_sensorDepthWorldMin
&&
point
.
z
<
params
.
camera
.
m_sensorDepthWorldMax
&&
length
(
point
-
minPos
)
<=
0.04
f
)
{
if
(
point
.
z
>
params
.
camera
.
m_sensorDepthWorldMin
&&
point
.
z
<
params
.
camera
.
m_sensorDepthWorldMax
&&
length
(
point
-
minPos
)
<=
SMOOTHING_MULTIPLIER_A
*
(
point
.
z
/
params
.
camera
.
fx
)
)
{
// Append to neighbour list
// Append to neighbour list
//unsigned int idx = atomicInc(&nidx[warp], MAX_NEIGHBORS_2-1);
//unsigned int idx = atomicInc(&nidx[warp], MAX_NEIGHBORS_2-1);
unsigned
int
idx
=
atomicAdd
(
&
nidx
[
warp
],
1
);
unsigned
int
idx
=
atomicAdd
(
&
nidx
[
warp
],
1
);
...
@@ -511,7 +513,7 @@ __device__ inline float warpMin(float e) {
...
@@ -511,7 +513,7 @@ __device__ inline float warpMin(float e) {
// Search for best or threshold energy
// Search for best or threshold energy
for
(
int
k
=
lane
;
k
<
MAX_ITERATIONS
;
k
+=
WARP_SIZE
)
{
for
(
int
k
=
lane
;
k
<
MAX_ITERATIONS
;
k
+=
WARP_SIZE
)
{
const
float3
nearest
=
params
.
camera
.
kinectDepthToSkeleton
(
x
,
y
,
minDepth
+
float
(
k
)
*
interval
);
const
float3
nearest
=
params
.
camera
.
kinectDepthToSkeleton
(
x
,
y
,
minDepth
+
float
(
k
)
*
interval
);
const
float
myenergy
=
ftl
::
cuda
::
mls_point_energy
<
MAX_NEIGHBORS_2
>
(
neighborhood_cache
[
warp
],
nearest
,
min
(
nidx
[
warp
],
MAX_NEIGHBORS_2
),
S
PATIAL_S
MOOTHING
);
const
float
myenergy
=
ftl
::
cuda
::
mls_point_energy
<
MAX_NEIGHBORS_2
>
(
neighborhood_cache
[
warp
],
nearest
,
min
(
nidx
[
warp
],
MAX_NEIGHBORS_2
),
SMOOTHING
_MULTIPLIER_B
*
(
nearest
.
z
/
params
.
camera
.
fx
)
);
const
float
newenergy
=
warpMax
(
max
(
myenergy
,
maxenergy
));
const
float
newenergy
=
warpMax
(
max
(
myenergy
,
maxenergy
));
bestdepth
=
(
myenergy
==
newenergy
)
?
nearest
.
z
:
(
newenergy
>
maxenergy
)
?
0.0
f
:
bestdepth
;
bestdepth
=
(
myenergy
==
newenergy
)
?
nearest
.
z
:
(
newenergy
>
maxenergy
)
?
0.0
f
:
bestdepth
;
maxenergy
=
newenergy
;
maxenergy
=
newenergy
;
...
@@ -548,7 +550,7 @@ __device__ inline float warpMin(float e) {
...
@@ -548,7 +550,7 @@ __device__ inline float warpMin(float e) {
if
(
maxenergy
>=
ENERGY_THRESHOLD
)
return
;
if
(
maxenergy
>=
ENERGY_THRESHOLD
)
return
;
// Move to next possible surface...
// Move to next possible surface...
clusterBase
=
minDepth
+
0.0
4
f
;
clusterBase
=
minDepth
+
0.0
1
f
;
};
};
}
}
...
...
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