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
b1a2bb27
Commit
b1a2bb27
authored
5 years ago
by
Nicolas Pope
Browse files
Options
Downloads
Patches
Plain Diff
Add colour cost
parent
dd9a3f1c
No related branches found
No related tags found
2 merge requests
!116
Implements #133 point alignment
,
!114
Ongoing #133 improvements
Pipeline
#14589
passed
5 years ago
Stage: all
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
applications/reconstruct/src/ilw/ilw.cu
+10
-5
10 additions, 5 deletions
applications/reconstruct/src/ilw/ilw.cu
with
10 additions
and
5 deletions
applications/reconstruct/src/ilw/ilw.cu
+
10
−
5
View file @
b1a2bb27
...
@@ -16,7 +16,7 @@ __device__ inline float warpMin(float e) {
...
@@ -16,7 +16,7 @@ __device__ inline float warpMin(float e) {
return
e
;
return
e
;
}
}
#define COR_WIN_RADIUS 1
6
#define COR_WIN_RADIUS 1
7
#define COR_WIN_SIZE (COR_WIN_RADIUS * COR_WIN_RADIUS)
#define COR_WIN_SIZE (COR_WIN_RADIUS * COR_WIN_RADIUS)
__global__
void
correspondence_energy_vector_kernel
(
__global__
void
correspondence_energy_vector_kernel
(
...
@@ -34,7 +34,8 @@ __global__ void correspondence_energy_vector_kernel(
...
@@ -34,7 +34,8 @@ __global__ void correspondence_energy_vector_kernel(
const
int
x
=
(
blockIdx
.
x
*
blockDim
.
x
+
threadIdx
.
x
)
/
WARP_SIZE
;
const
int
x
=
(
blockIdx
.
x
*
blockDim
.
x
+
threadIdx
.
x
)
/
WARP_SIZE
;
const
int
y
=
blockIdx
.
y
*
blockDim
.
y
+
threadIdx
.
y
;
const
int
y
=
blockIdx
.
y
*
blockDim
.
y
+
threadIdx
.
y
;
const
float3
world1
=
make_float3
(
p1
.
tex2D
(
x
,
y
));
const
float3
world1
=
make_float3
(
p1
.
tex2D
(
x
,
y
));
const
uchar4
colour1
=
c1
.
tex2D
(
x
,
y
);
if
(
world1
.
x
==
MINF
)
return
;
if
(
world1
.
x
==
MINF
)
return
;
const
float3
camPos2
=
pose2
*
world1
;
const
float3
camPos2
=
pose2
*
world1
;
const
uint2
screen2
=
cam2
.
camToScreen
<
uint2
>
(
camPos2
);
const
uint2
screen2
=
cam2
.
camToScreen
<
uint2
>
(
camPos2
);
...
@@ -50,11 +51,14 @@ __global__ void correspondence_energy_vector_kernel(
...
@@ -50,11 +51,14 @@ __global__ void correspondence_energy_vector_kernel(
const
float
u
=
(
i
%
COR_WIN_RADIUS
)
-
(
COR_WIN_RADIUS
/
2
);
const
float
u
=
(
i
%
COR_WIN_RADIUS
)
-
(
COR_WIN_RADIUS
/
2
);
const
float
v
=
(
i
/
COR_WIN_RADIUS
)
-
(
COR_WIN_RADIUS
/
2
);
const
float
v
=
(
i
/
COR_WIN_RADIUS
)
-
(
COR_WIN_RADIUS
/
2
);
const
float3
world2
=
make_float3
(
p2
.
tex2D
(
screen2
.
x
+
u
,
screen2
.
y
+
v
));
const
float3
world2
=
make_float3
(
p2
.
tex2D
(
screen2
.
x
+
u
,
screen2
.
y
+
v
));
const
uchar4
colour2
=
c2
.
tex2D
(
screen2
.
x
+
u
,
screen2
.
y
+
v
);
if
(
world2
.
x
==
MINF
)
continue
;
if
(
world2
.
x
==
MINF
)
continue
;
// Determine degree of correspondence
// Determine degree of correspondence
const
float
cost
=
1.0
f
-
ftl
::
cuda
::
spatialWeighting
(
world1
,
world2
,
0.04
f
);
float
cost
=
1.0
f
-
ftl
::
cuda
::
spatialWeighting
(
world1
,
world2
,
0.04
f
);
cost
+=
1.0
f
-
ftl
::
cuda
::
colourWeighting
(
colour1
,
colour2
,
50.0
f
);
cost
/=
2.0
f
;
if
(
cost
<
bestcost
)
{
if
(
cost
<
bestcost
)
{
bestpoint
=
world2
;
bestpoint
=
world2
;
...
@@ -74,7 +78,8 @@ __global__ void correspondence_energy_vector_kernel(
...
@@ -74,7 +78,8 @@ __global__ void correspondence_energy_vector_kernel(
(
bestpoint
.
y
-
world1
.
y
),
(
bestpoint
.
y
-
world1
.
y
),
(
bestpoint
.
z
-
world1
.
z
),
(
bestpoint
.
z
-
world1
.
z
),
mincost
);
mincost
);
eout
(
x
,
y
)
=
mincost
*
5.0
f
;
//confidence * 5.0f;
//eout(x,y) = (1.0f - mincost) * 7.0f; //confidence * 5.0f;
eout
(
x
,
y
)
=
confidence
*
7.0
f
;
}
else
if
(
mincost
>=
1.0
f
&&
lane
==
0
)
{
}
else
if
(
mincost
>=
1.0
f
&&
lane
==
0
)
{
vout
(
x
,
y
)
=
make_float4
(
0.0
f
);
vout
(
x
,
y
)
=
make_float4
(
0.0
f
);
eout
(
x
,
y
)
=
0.0
f
;
eout
(
x
,
y
)
=
0.0
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