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
8836624a
Commit
8836624a
authored
6 years ago
by
Nicolas Pope
Browse files
Options
Downloads
Patches
Plain Diff
Comments added
parent
b69425ac
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cv-node/README.md
+5
-2
5 additions, 2 deletions
cv-node/README.md
cv-node/src/algorithms/rtcensus.cu
+24
-15
24 additions, 15 deletions
cv-node/src/algorithms/rtcensus.cu
with
29 additions
and
17 deletions
cv-node/README.md
+
5
−
2
View file @
8836624a
...
...
@@ -14,7 +14,8 @@ make
`
## Install
TODO. Currently, copy
`<source_direction>/config/config.json`
to
`~/config/ftl`
.
TODO. Currently, copy
`<source_direction>/config/config.json`
to
`~/.config/ftl/config.json`
on Linux.
## Usage
An optional command-line argument can be passed to specify a stereo video file
...
...
@@ -30,7 +31,9 @@ JSON config option at `{ "disparity": { "algorithm": "sgbm" }}`.
### Calibration
Cameras can be calibrated by using argument
`--calibrate`
. You either
need to provide a calibration video as an argument or do it live. A checkerboard
grid pattern is required, the size can be configured in the json file.
grid pattern is required, the size can be configured in the json file. After
callibration the data is save and will be reloaded automatically next time you
run
`cv-node`
.
Note: best calibration is not too close or far from the cameras, the board must
be fully visible in each camera and move to cover as much of the visual field
...
...
This diff is collapsed.
Click to expand it.
cv-node/src/algorithms/rtcensus.cu
+
24
−
15
View file @
8836624a
...
...
@@ -26,29 +26,43 @@ using namespace cv;
namespace
ftl
{
namespace
gpu
{
// --- SUPPORT -----------------------------------------------------------------
/*
* Sparse 16x16 census (so 8x8) creating a 64bit mask
* (14) & (15), based upon (9)
*/
__device__
uint64_t
sparse_census
(
unsigned
char
*
arr
,
size_t
u
,
size_t
v
,
size_t
w
)
{
uint64_t
r
=
0
;
unsigned
char
t
=
arr
[
v
*
w
+
u
];
for
(
int
n
=-
7
;
n
<=
7
;
n
+=
2
)
{
auto
u_
=
u
+
n
;
for
(
int
m
=-
7
;
m
<=
7
;
m
+=
2
)
{
auto
v_
=
v
+
m
;
r
<<=
1
;
r
|=
XHI
(
t
,
arr
[
v_
*
w
+
u_
]);
}
auto
start_ix
=
(
v
+
m
)
*
w
+
u
;
for
(
int
n
=-
7
;
n
<=
7
;
n
+=
2
)
{
r
<<=
1
;
r
|=
XHI
(
t
,
arr
[
start_ix
+
n
]);
}
}
return
r
;
}
/*
* Parabolic interpolation between matched disparities either side.
* Results in subpixel disparity. (20).
*/
__device__
float
fit_parabola
(
size_t
pi
,
uint16_t
p
,
uint16_t
pl
,
uint16_t
pr
)
{
float
a
=
pr
-
pl
;
float
b
=
2
*
(
2
*
p
-
pl
-
pr
);
return
static_cast
<
float
>
(
pi
)
+
(
a
/
b
);
}
// --- KERNELS -----------------------------------------------------------------
/*
* Calculate census mask for left and right images together.
*/
__global__
void
census_kernel
(
PtrStepSzb
l
,
PtrStepSzb
r
,
uint64_t
*
census
)
{
//extern __shared__ uint64_t census[];
...
...
@@ -62,23 +76,18 @@ __global__ void census_kernel(PtrStepSzb l, PtrStepSzb r, uint64_t *census) {
size_t
width
=
l
.
cols
;
for
(
size_t
v
=
v_start
;
v
<
v_end
;
v
++
)
{
//for (size_t u=7; u<width-7; u++) {
size_t
ix
=
(
u
+
v
*
width
)
*
2
;
uint64_t
cenL
=
sparse_census
(
l
.
data
,
u
,
v
,
l
.
step
);
uint64_t
cenR
=
sparse_census
(
r
.
data
,
u
,
v
,
r
.
step
);
census
[
ix
]
=
cenL
;
census
[
ix
+
1
]
=
cenR
;
//disp(v,u) = (float)cenL;
//}
}
//__syncthreads();
return
;
}
/*
* Generate left and right disparity images from census data. (19)
*/
__global__
void
disp_kernel
(
float
*
disp_l
,
float
*
disp_r
,
size_t
width
,
size_t
height
,
uint64_t
*
census
,
size_t
ds
)
{
//extern __shared__ uint64_t cache[];
...
...
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