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
6327e630
Commit
6327e630
authored
5 years ago
by
Nicolas Pope
Browse files
Options
Downloads
Patches
Plain Diff
Minor changes
parent
ccbd22c2
No related branches found
No related tags found
1 merge request
!122
Implements #183 depth ray correspondences
Pipeline
#15039
failed
5 years ago
Stage: all
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
applications/reconstruct/src/ilw/ilw.cpp
+2
-2
2 additions, 2 deletions
applications/reconstruct/src/ilw/ilw.cpp
applications/reconstruct/src/ilw/ilw.cu
+8
-1
8 additions, 1 deletion
applications/reconstruct/src/ilw/ilw.cu
with
10 additions
and
3 deletions
applications/reconstruct/src/ilw/ilw.cpp
+
2
−
2
View file @
6327e630
...
@@ -106,7 +106,7 @@ bool ILW::process(ftl::rgbd::FrameSet &fs, cudaStream_t stream) {
...
@@ -106,7 +106,7 @@ bool ILW::process(ftl::rgbd::FrameSet &fs, cudaStream_t stream) {
_phase0
(
fs
,
stream
);
_phase0
(
fs
,
stream
);
params_
.
range
=
0.
1
f
;
params_
.
range
=
0.
05
f
;
for
(
int
i
=
0
;
i
<
iterations_
;
++
i
)
{
for
(
int
i
=
0
;
i
<
iterations_
;
++
i
)
{
_phase1
(
fs
,
value
(
"cost_function"
,
3
),
stream
);
_phase1
(
fs
,
value
(
"cost_function"
,
3
),
stream
);
...
@@ -114,7 +114,7 @@ bool ILW::process(ftl::rgbd::FrameSet &fs, cudaStream_t stream) {
...
@@ -114,7 +114,7 @@ bool ILW::process(ftl::rgbd::FrameSet &fs, cudaStream_t stream) {
_phase2
(
fs
,
motion_rate_
,
stream
);
_phase2
(
fs
,
motion_rate_
,
stream
);
//}
//}
params_
.
range
*=
0.
5
f
;
params_
.
range
*=
0.
9
f
;
// TODO: Break if no time left
// TODO: Break if no time left
}
}
...
...
This diff is collapsed.
Click to expand it.
applications/reconstruct/src/ilw/ilw.cu
+
8
−
1
View file @
6327e630
...
@@ -108,6 +108,11 @@ __device__ inline float weightFunction<3>(const ftl::cuda::ILWParams ¶ms, fl
...
@@ -108,6 +108,11 @@ __device__ inline float weightFunction<3>(const ftl::cuda::ILWParams ¶ms, fl
return
(
dweight
==
0.0
f
)
?
0.0
f
:
(
params
.
cost_ratio
*
(
cweight
)
+
(
1.0
f
-
params
.
cost_ratio
)
*
dweight
);
return
(
dweight
==
0.0
f
)
?
0.0
f
:
(
params
.
cost_ratio
*
(
cweight
)
+
(
1.0
f
-
params
.
cost_ratio
)
*
dweight
);
}
}
template
<
>
__device__
inline
float
weightFunction
<
4
>
(
const
ftl
::
cuda
::
ILWParams
&
params
,
float
dweight
,
float
cweight
)
{
return
cweight
;
}
template
<
int
COR_STEPS
,
int
FUNCTION
>
template
<
int
COR_STEPS
,
int
FUNCTION
>
__global__
void
correspondence_energy_vector_kernel
(
__global__
void
correspondence_energy_vector_kernel
(
TextureObject
<
float
>
d1
,
TextureObject
<
float
>
d1
,
...
@@ -169,6 +174,7 @@ __global__ void correspondence_energy_vector_kernel(
...
@@ -169,6 +174,7 @@ __global__ void correspondence_energy_vector_kernel(
// Generate a depth correspondence value
// Generate a depth correspondence value
const
float
depth2
=
d2
.
tex2D
((
int
)
screen
.
x
,
(
int
)
screen
.
y
);
const
float
depth2
=
d2
.
tex2D
((
int
)
screen
.
x
,
(
int
)
screen
.
y
);
const
float
dweight
=
ftl
::
cuda
::
weighting
(
fabs
(
depth2
-
camPos
.
z
),
params
.
spatial_smooth
);
const
float
dweight
=
ftl
::
cuda
::
weighting
(
fabs
(
depth2
-
camPos
.
z
),
params
.
spatial_smooth
);
//const float dweight = ftl::cuda::weighting(fabs(depth_adjust - depth1), 2.0f*params.range);
// Generate a colour correspondence value
// Generate a colour correspondence value
const
uchar4
colour2
=
c2
.
tex2D
((
int
)
screen
.
x
,
(
int
)
screen
.
y
);
const
uchar4
colour2
=
c2
.
tex2D
((
int
)
screen
.
x
,
(
int
)
screen
.
y
);
...
@@ -223,6 +229,7 @@ void ftl::cuda::correspondence(
...
@@ -223,6 +229,7 @@ void ftl::cuda::correspondence(
case
1
:
correspondence_energy_vector_kernel
<
16
,
1
><<<
gridSize
,
blockSize
,
0
,
stream
>>>
(
d1
,
d2
,
c1
,
c2
,
dout
,
conf
,
pose1
,
pose1_inv
,
pose2
,
cam1
,
cam2
,
params
);
break
;
case
1
:
correspondence_energy_vector_kernel
<
16
,
1
><<<
gridSize
,
blockSize
,
0
,
stream
>>>
(
d1
,
d2
,
c1
,
c2
,
dout
,
conf
,
pose1
,
pose1_inv
,
pose2
,
cam1
,
cam2
,
params
);
break
;
case
2
:
correspondence_energy_vector_kernel
<
16
,
2
><<<
gridSize
,
blockSize
,
0
,
stream
>>>
(
d1
,
d2
,
c1
,
c2
,
dout
,
conf
,
pose1
,
pose1_inv
,
pose2
,
cam1
,
cam2
,
params
);
break
;
case
2
:
correspondence_energy_vector_kernel
<
16
,
2
><<<
gridSize
,
blockSize
,
0
,
stream
>>>
(
d1
,
d2
,
c1
,
c2
,
dout
,
conf
,
pose1
,
pose1_inv
,
pose2
,
cam1
,
cam2
,
params
);
break
;
case
3
:
correspondence_energy_vector_kernel
<
16
,
3
><<<
gridSize
,
blockSize
,
0
,
stream
>>>
(
d1
,
d2
,
c1
,
c2
,
dout
,
conf
,
pose1
,
pose1_inv
,
pose2
,
cam1
,
cam2
,
params
);
break
;
case
3
:
correspondence_energy_vector_kernel
<
16
,
3
><<<
gridSize
,
blockSize
,
0
,
stream
>>>
(
d1
,
d2
,
c1
,
c2
,
dout
,
conf
,
pose1
,
pose1_inv
,
pose2
,
cam1
,
cam2
,
params
);
break
;
case
4
:
correspondence_energy_vector_kernel
<
16
,
4
><<<
gridSize
,
blockSize
,
0
,
stream
>>>
(
d1
,
d2
,
c1
,
c2
,
dout
,
conf
,
pose1
,
pose1_inv
,
pose2
,
cam1
,
cam2
,
params
);
break
;
}
}
cudaSafeCall
(
cudaGetLastError
()
);
cudaSafeCall
(
cudaGetLastError
()
);
...
@@ -266,7 +273,7 @@ __global__ void move_points_kernel(
...
@@ -266,7 +273,7 @@ __global__ void move_points_kernel(
//if (pn.x == MINF) continue;
//if (pn.x == MINF) continue;
if
(
dn_new
==
0.0
f
)
continue
;
// Neighbour has no new correspondence
if
(
dn_new
==
0.0
f
)
continue
;
// Neighbour has no new correspondence
const
float
s
=
ftl
::
cuda
::
weighting
(
fabs
(
d0_new
-
dn_new
),
params
.
range
);
const
float
s
=
ftl
::
cuda
::
spatialWeighting
(
camera
.
screenToCam
(
x
,
y
,
d0_new
),
camera
.
screenToCam
(
x
+
u
,
y
+
v
,
dn_new
),
params
.
range
);
//
ftl::cuda::weighting(fabs(d0_new - dn_new), params.range);
contrib
+=
(
confn
+
0.01
f
)
*
s
;
contrib
+=
(
confn
+
0.01
f
)
*
s
;
delta
+=
(
confn
+
0.01
f
)
*
s
*
((
confn
==
0.0
f
)
?
dn_old
:
dn_new
);
delta
+=
(
confn
+
0.01
f
)
*
s
*
((
confn
==
0.0
f
)
?
dn_old
:
dn_new
);
}
}
...
...
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