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
53c0517c
Commit
53c0517c
authored
5 years ago
by
Nicolas Pope
Browse files
Options
Downloads
Patches
Plain Diff
Fix visualise confidence
parent
928c70b4
No related branches found
No related tags found
1 merge request
!122
Implements #183 depth ray correspondences
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
applications/gui/src/camera.cpp
+1
-1
1 addition, 1 deletion
applications/gui/src/camera.cpp
applications/reconstruct/src/ilw/ilw.cu
+24
-30
24 additions, 30 deletions
applications/reconstruct/src/ilw/ilw.cu
with
25 additions
and
31 deletions
applications/gui/src/camera.cpp
+
1
−
1
View file @
53c0517c
...
...
@@ -376,6 +376,7 @@ const GLTexture &ftl::gui::Camera::captureFrame() {
cv
::
Mat
tmp
;
switch
(
channel_
)
{
case
Channel
::
Confidence
:
case
Channel
::
Energy
:
if
(
depth_
.
rows
==
0
)
{
break
;
}
visualizeEnergy
(
depth_
,
tmp
,
10.0
);
...
...
@@ -398,7 +399,6 @@ const GLTexture &ftl::gui::Camera::captureFrame() {
break
;
case
Channel
::
Flow
:
case
Channel
::
Confidence
:
case
Channel
::
Normals
:
case
Channel
::
Right
:
if
(
depth_
.
rows
==
0
||
depth_
.
type
()
!=
CV_8UC3
)
{
break
;
}
...
...
This diff is collapsed.
Click to expand it.
applications/reconstruct/src/ilw/ilw.cu
+
24
−
30
View file @
53c0517c
...
...
@@ -86,26 +86,26 @@ void ftl::cuda::preprocess_depth(
//==============================================================================
template
<
int
FUNCTION
>
__device__
float
cos
tFunction
(
const
ftl
::
cuda
::
ILWParams
&
params
,
float
dweight
,
float
cweight
);
__device__
float
weigh
tFunction
(
const
ftl
::
cuda
::
ILWParams
&
params
,
float
dweight
,
float
cweight
);
template
<
>
__device__
inline
float
cos
tFunction
<
0
>
(
const
ftl
::
cuda
::
ILWParams
&
params
,
float
dweight
,
float
cweight
)
{
return
1.0
f
-
(
params
.
cost_ratio
*
(
cweight
)
+
(
1.0
f
-
params
.
cost_ratio
)
*
dweight
);
__device__
inline
float
weigh
tFunction
<
0
>
(
const
ftl
::
cuda
::
ILWParams
&
params
,
float
dweight
,
float
cweight
)
{
return
(
params
.
cost_ratio
*
(
cweight
)
+
(
1.0
f
-
params
.
cost_ratio
)
*
dweight
);
}
template
<
>
__device__
inline
float
cos
tFunction
<
1
>
(
const
ftl
::
cuda
::
ILWParams
&
param
,
float
dweight
,
float
cweight
)
{
return
1.0
f
-
(
cweight
*
cweight
*
dweight
);
__device__
inline
float
weigh
tFunction
<
1
>
(
const
ftl
::
cuda
::
ILWParams
&
param
,
float
dweight
,
float
cweight
)
{
return
(
cweight
*
cweight
*
dweight
);
}
template
<
>
__device__
inline
float
cos
tFunction
<
2
>
(
const
ftl
::
cuda
::
ILWParams
&
param
,
float
dweight
,
float
cweight
)
{
return
1.0
f
-
(
dweight
*
dweight
*
cweight
);
__device__
inline
float
weigh
tFunction
<
2
>
(
const
ftl
::
cuda
::
ILWParams
&
param
,
float
dweight
,
float
cweight
)
{
return
(
dweight
*
dweight
*
cweight
);
}
template
<
>
__device__
inline
float
cos
tFunction
<
3
>
(
const
ftl
::
cuda
::
ILWParams
&
params
,
float
dweight
,
float
cweight
)
{
return
(
dweight
==
0.0
f
)
?
1
.0
f
:
1.0
f
-
(
params
.
cost_ratio
*
(
cweight
)
+
(
1.0
f
-
params
.
cost_ratio
)
*
dweight
);
__device__
inline
float
weigh
tFunction
<
3
>
(
const
ftl
::
cuda
::
ILWParams
&
params
,
float
dweight
,
float
cweight
)
{
return
(
dweight
==
0.0
f
)
?
0
.0
f
:
(
params
.
cost_ratio
*
(
cweight
)
+
(
1.0
f
-
params
.
cost_ratio
)
*
dweight
);
}
template
<
int
COR_STEPS
,
int
FUNCTION
>
...
...
@@ -139,10 +139,10 @@ __global__ void correspondence_energy_vector_kernel(
const
uchar4
colour1
=
c1
.
tex2D
(
x
,
y
);
float
bestcost
=
1.1
f
;
float
avgcost
=
0.0
f
;
float
bestdepth
;
float
depth_accum
=
0.0
f
;
float
bestweight
=
0.0
f
;
int
count
=
0
;
float
contrib
=
0.0
f
;
const
float
step_interval
=
params
.
range
/
(
COR_STEPS
/
2
);
...
...
@@ -172,31 +172,25 @@ __global__ void correspondence_energy_vector_kernel(
const
uchar4
colour2
=
c2
.
tex2D
((
int
)
screen
.
x
,
(
int
)
screen
.
y
);
const
float
cweight
=
ftl
::
cuda
::
colourWeighting
(
colour1
,
colour2
,
params
.
colour_smooth
);
const
float
cost
=
costFunction
<
FUNCTION
>
(
params
,
dweight
,
cweight
);
// Cost is so bad, don't even consider this a valid option
if
(
cost
>=
params
.
cost_threshold
)
continue
;
const
float
weight
=
weightFunction
<
FUNCTION
>
(
params
,
dweight
,
cweight
);
++
count
;
avgcost
+=
cos
t
;
if
(
cost
<
bestcost
)
{
bestdepth
=
depth_adjust
;
best
cost
=
cos
t
;
contrib
+=
weigh
t
;
depth_accum
+=
depth_adjust
*
weight
;
if
(
weight
>
bestweight
)
{
best
weight
=
weigh
t
;
}
}
//count = warpSum(count);
const
float
mincost
=
bestcost
;
//warpMin(bestcost);
//bool best = mincost == bestcost;
avgcost
/=
count
;
const
float
confidence
=
(
params
.
flags
&
ftl
::
cuda
::
kILWFlag_ColourConfidenceOnly
)
?
avgcost
:
(
avgcost
-
mincost
);
const
float
avgweight
=
contrib
/
count
;
const
float
confidence
=
bestweight
-
avgweight
;
if
(
mincost
<
1
.0
f
)
{
if
(
contrib
>
0
.0
f
)
{
float
old
=
conf
.
tex2D
(
x
,
y
);
if
(
(
1.0
f
-
mincost
)
*
confidence
>
old
)
{
dout
(
x
,
y
)
=
best
depth
;
conf
(
x
,
y
)
=
(
1.0
f
-
mincost
)
*
confidence
;
if
(
bestweight
*
confidence
>
old
)
{
dout
(
x
,
y
)
=
depth
_accum
/
contrib
;
conf
(
x
,
y
)
=
bestweight
*
confidence
;
}
}
}
...
...
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