Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
vision
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
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
mobile_robotics
wolf_projects
wolf_lib
plugins
vision
Commits
5c34e4b1
Commit
5c34e4b1
authored
3 years ago
by
Joan Solà Ortega
Browse files
Options
Downloads
Patches
Plain Diff
some debug msgs
parent
445186fa
No related branches found
No related tags found
2 merge requests
!36
After cmake and const refactor
,
!28
Resolve "Building a new visual odometry system"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/processor/processor_visual_odometry.cpp
+12
-3
12 additions, 3 deletions
src/processor/processor_visual_odometry.cpp
with
12 additions
and
3 deletions
src/processor/processor_visual_odometry.cpp
+
12
−
3
View file @
5c34e4b1
...
...
@@ -162,13 +162,16 @@ void ProcessorVisualOdometry::preProcess()
// detect new KeyPoints in last and track them to incoming
////////////////////////////////
size_t
n_tracks_origin
=
tracks_origin_incoming
.
size
();
WOLF_TRACE
(
"# of tracks: "
,
n_tracks_origin
,
"; min # of tracks: "
,
params_visual_odometry_
->
min_features_for_keyframe
);
if
(
n_tracks_origin
<
params_visual_odometry_
->
min_features_for_keyframe
){
std
::
cout
<<
" Too Few Tracks"
<<
std
::
endl
;
WOLF_TRACE
(
" Too Few Tracks"
);
// Detect new KeyPoints
std
::
vector
<
cv
::
KeyPoint
>
kps_last_new
;
detector_
->
detect
(
img_last
,
kps_last_new
);
cv
::
KeyPointsFilter
::
retainBest
(
kps_last_new
,
params_visual_odometry_
->
max_new_features
);
WOLF_TRACE
(
"Detected "
,
kps_last_new
.
size
(),
" new raw keypoints"
);
// Create a map of wolf KeyPoints to track only the new ones
KeyPointsMap
mwkps_last_new
,
mwkps_incoming_new
;
...
...
@@ -176,6 +179,7 @@ void ProcessorVisualOdometry::preProcess()
WKeyPoint
wkp
(
cvkp
);
mwkps_last_new
[
wkp
.
getId
()]
=
wkp
;
}
WOLF_TRACE
(
"Found "
,
mwkps_last_new
.
size
(),
" new keypoints"
);
TracksMap
tracks_last_incoming_new
=
kltTrack
(
img_last
,
img_incoming
,
mwkps_last_new
,
mwkps_incoming_new
);
...
...
@@ -183,6 +187,7 @@ void ProcessorVisualOdometry::preProcess()
// tracks that are not geometrically consistent are removed from tracks_last_incoming_new
cv
::
Mat
E
;
filterWithEssential
(
mwkps_last_new
,
mwkps_incoming_new
,
tracks_last_incoming_new
,
E
);
WOLF_TRACE
(
"Tracked "
,
mwkps_incoming_new
.
size
(),
" new keypoints"
);
// Concatenation of old tracks and new tracks
// Only keep tracks until it reaches a max nb of tracks
...
...
@@ -196,6 +201,7 @@ void ProcessorVisualOdometry::preProcess()
tracks_last_incoming_filtered
[
track
.
first
]
=
track
.
second
;
count_new_tracks
++
;
}
WOLF_TRACE
(
"New total : "
,
tracks_last_incoming_filtered
.
size
(),
" tracks"
);
// Update captures
capture_image_last_
->
addKeyPoints
(
mwkps_last_new
);
...
...
@@ -208,7 +214,7 @@ void ProcessorVisualOdometry::preProcess()
}
auto
dt_preprocess
=
std
::
chrono
::
duration_cast
<
std
::
chrono
::
milliseconds
>
(
std
::
chrono
::
system_clock
::
now
()
-
t1
).
count
();
std
::
cout
<<
"dt_preprocess (ms): "
<<
dt_preprocess
<<
std
::
endl
;
WOLF_INFO
(
"dt_preprocess (ms): "
,
dt_preprocess
)
;
}
...
...
@@ -397,6 +403,9 @@ bool ProcessorVisualOdometry::voteForKeyFrame() const
// simple vote based on frame count, should be changed to something that takes into account number of tracks alive, parallax, etc.
// vote = vote || ((frame_count_ % 5) == 0);
vote
=
vote
||
incoming_ptr_
->
getFeatureList
().
size
()
<
params_visual_odometry_
->
min_features_for_keyframe
;
std
::
cout
<<
"vote "
<<
vote
<<
std
::
endl
;
return
vote
;
}
...
...
@@ -506,7 +515,7 @@ bool ProcessorVisualOdometry::filterWithEssential(const KeyPointsMap _mwkps_prev
p2f_curr
,
Kcv_
,
cv
::
RANSAC
,
0.99
,
0.99
9
,
1.0
,
cvMask
);
...
...
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