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
3a762910
Commit
3a762910
authored
6 years ago
by
Nicolas Pope
Browse files
Options
Downloads
Patches
Plain Diff
Add timings to rtcensus
parent
a3a71de3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cv-node/src/rtcensus.cpp
+8
-17
8 additions, 17 deletions
cv-node/src/rtcensus.cpp
with
8 additions
and
17 deletions
cv-node/src/rtcensus.cpp
+
8
−
17
View file @
3a762910
...
...
@@ -29,9 +29,6 @@ static vector<uint64_t> sparse_census_16x16(Mat &arr) {
auto
u_
=
u
+
n
;
for
(
int
m
=-
7
;
m
<=
7
;
m
+=
2
)
{
auto
v_
=
v
+
m
;
//if (u_ < 0 || v_ < 0 || u_ >= arr.cols || v_ >= arr.rows) continue;
r
<<=
1
;
r
|=
XHI
(
arr
.
at
<
uint8_t
>
(
v
,
u
),
arr
.
at
<
uint8_t
>
(
v_
,
u_
));
}
...
...
@@ -44,18 +41,9 @@ static vector<uint64_t> sparse_census_16x16(Mat &arr) {
return
result
;
}
static
inline
uint8_t
hamming
(
uint64_t
n1
,
uint64_t
n2
)
{
/*int x = n1 ^ n2;
uint8_t setBits = 0;
while (x > 0) {
setBits += x & 1;
x >>= 1;
}
return setBits; */
/*static inline uint8_t hamming(uint64_t n1, uint64_t n2) {
return bitset<64>(n1^n2).count();
}
}
*/
static
vector
<
uint16_t
>
dsi_ca
(
vector
<
uint64_t
>
&
census_R
,
vector
<
uint64_t
>
&
census_L
,
size_t
w
,
size_t
h
,
size_t
d_start
,
size_t
d_stop
,
int
sign
=
1
)
{
// TODO Add asserts
...
...
@@ -159,19 +147,22 @@ void RTCensus::disparity(cv::Mat &l, cv::Mat &r, cv::Mat &disp, size_t num_disp,
size_t
d_min
=
0
;
size_t
d_max
=
num_disp
;
auto
start
=
std
::
chrono
::
high_resolution_clock
::
now
();
auto
census_R
=
sparse_census_16x16
(
r
);
auto
census_L
=
sparse_census_16x16
(
l
);
LOG
(
INFO
)
<<
"Census done"
;
std
::
chrono
::
duration
<
double
>
elapsed
=
std
::
chrono
::
high_resolution_clock
::
now
()
-
start
;
LOG
(
INFO
)
<<
"Census in "
<<
elapsed
.
count
()
<<
"s"
;
start
=
std
::
chrono
::
high_resolution_clock
::
now
();
auto
dsi_ca_R
=
dsi_ca
(
census_R
,
census_L
,
l
.
cols
,
l
.
rows
,
d_min
,
d_max
);
auto
dsi_ca_L
=
dsi_ca
(
census_L
,
census_R
,
l
.
cols
,
l
.
rows
,
d_min
,
d_max
,
-
1
);
LOG
(
INFO
)
<<
"DSI done"
;
elapsed
=
std
::
chrono
::
high_resolution_clock
::
now
()
-
start
;
LOG
(
INFO
)
<<
"DSI in "
<<
elapsed
.
count
()
<<
"s"
;
auto
disp_R
=
d_sub
(
dsi_ca_R
,
l
.
cols
,
l
.
rows
,
d_max
-
d_min
);
auto
disp_L
=
d_sub
(
dsi_ca_L
,
l
.
cols
,
l
.
rows
,
d_max
-
d_min
);
LOG
(
INFO
)
<<
"Disp done"
;
//disp = disp_L;
disp
=
consistency
(
disp_R
,
disp_L
);
// TODO confidence and texture filtering
...
...
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