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
a7da228c
Commit
a7da228c
authored
4 years ago
by
Nicolas Pope
Browse files
Options
Downloads
Patches
Plain Diff
Tune CT a little
parent
dc8c9637
No related branches found
No related tags found
1 merge request
!349
Use 5x5 proper census for SGM
Pipeline
#32705
passed
4 years ago
Stage: all
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/libsgm/src/census_transform.cu
+11
-29
11 additions, 29 deletions
lib/libsgm/src/census_transform.cu
with
11 additions
and
29 deletions
lib/libsgm/src/census_transform.cu
+
11
−
29
View file @
a7da228c
...
@@ -116,43 +116,25 @@ __global__ void census_transform_kernel(
...
@@ -116,43 +116,25 @@ __global__ void census_transform_kernel(
static
constexpr
int
RADIUS_Y
=
WINDOW_HEIGHT
/
2
;
static
constexpr
int
RADIUS_Y
=
WINDOW_HEIGHT
/
2
;
const
int
x
=
(
blockIdx
.
x
*
blockDim
.
x
+
threadIdx
.
x
);
const
int
x
=
(
blockIdx
.
x
*
blockDim
.
x
+
threadIdx
.
x
);
const
int
y
=
blockIdx
.
y
*
blockDim
.
y
+
threadIdx
.
y
;
const
int
y
=
blockIdx
.
y
*
blockDim
.
y
+
threadIdx
.
y
;
dest
[
x
+
y
*
width
]
=
0
;
feature_type
res
=
0
;
if
(
x
>=
RADIUS_X
&&
y
>=
RADIUS_Y
&&
x
<
width
-
RADIUS_X
&&
y
<
height
-
RADIUS_Y
)
{
if
(
x
>=
RADIUS_X
&&
y
>=
RADIUS_Y
&&
x
<
width
-
RADIUS_X
&&
y
<
height
-
RADIUS_Y
)
{
short
center
=
src
[
y
*
pitch
+
x
];
const
T
center
=
src
[
y
*
pitch
+
x
];
uint8_t
i
=
0
;
// bit counter for *out
// possible BUG in operator(), gets called more than once per pixel;
// local variable for sub-bitstring to avoid data race (no read
// dependency to out; writes are identical)
feature_type
res
=
0
;
for
(
int
wy
=
-
RADIUS_Y
;
wy
<=
RADIUS_Y
;
wy
++
)
{
for
(
int
wx
=
-
RADIUS_X
;
wx
<=
RADIUS_X
;
wx
++
)
{
const
int
y_
=
y
+
wy
;
const
int
x_
=
x
+
wx
;
if
(
y
==
0
&&
x
==
0
)
{
continue
;
}
// zero if first value, otherwise shift to left
#pragma unroll
res
=
(
res
<<
1
);
for
(
int
wy
=
-
RADIUS_Y
;
wy
<=
RADIUS_Y
;
++
wy
)
{
res
|=
(
center
<
(
src
[
y_
*
pitch
+
x_
])
?
1
:
0
)
;
const
int
i
=
(
y
+
wy
)
*
pitch
+
x
;
// if all bits set, continue to next element
#pragma unroll
/*if (++i % 64 == 0) {
for
(
int
wx
=
-
RADIUS_X
;
wx
<=
RADIUS_X
;
++
wx
)
{
*out = res;
res
=
(
res
<<
1
)
|
(
center
<
(
src
[
i
+
wx
])
?
1
:
0
);
out++;
}*/
}
}
}
}
//if ((i - 1)%64 != 0) {
// write remaining bits
dest
[
x
+
y
*
width
]
=
res
;
//}
}
}
dest
[
x
+
y
*
width
]
=
res
;
}
}
template
<
typename
T
>
template
<
typename
T
>
...
...
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