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
78bebf5d
Commit
78bebf5d
authored
3 years ago
by
Joan Solà Ortega
Browse files
Options
Downloads
Patches
Plain Diff
Add more debug info
parent
dbcd9a1e
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
-5
12 additions, 5 deletions
src/processor/processor_visual_odometry.cpp
with
12 additions
and
5 deletions
src/processor/processor_visual_odometry.cpp
+
12
−
5
View file @
78bebf5d
...
...
@@ -128,6 +128,7 @@ void ProcessorVisualOdometry::preProcess()
// TracksMap between last and incoming
// Input: ID of Wkp in last. Output: ID of the tracked Wkp in incoming.
TracksMap
tracks_last_incoming
=
kltTrack
(
img_last
,
img_incoming
,
mwkps_last
,
mwkps_incoming
);
WOLF_INFO
(
"Tracked "
,
mwkps_incoming
.
size
(),
" keypoints..."
);
// TracksMap between origin and last
// Input: ID of Wkp in origin. Output: ID of the tracked Wkp in last.
...
...
@@ -136,6 +137,7 @@ void ProcessorVisualOdometry::preProcess()
// Merge tracks to get TracksMap between origin and incoming
// Input: ID of Wkp in origin. Output: ID of the tracked Wkp in incoming.
TracksMap
tracks_origin_incoming
=
mergeTracks
(
tracks_origin_last
,
tracks_last_incoming
);
WOLF_INFO
(
"Merged "
,
tracks_last_incoming
.
size
(),
" tracks..."
);
// Outliers rejection with essential matrix
cv
::
Mat
E
;
...
...
@@ -151,6 +153,7 @@ void ProcessorVisualOdometry::preProcess()
}
}
}
WOLF_INFO
(
"Retained "
,
tracks_last_incoming_filtered
.
size
(),
" inliers..."
);
// Update captures
capture_image_incoming_
->
addKeyPoints
(
mwkps_incoming
);
...
...
@@ -170,8 +173,11 @@ void ProcessorVisualOdometry::preProcess()
// 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_INFO
(
"Detected "
,
kps_last_new
.
size
(),
" raw keypoints"
);
cv
::
KeyPointsFilter
::
retainBest
(
kps_last_new
,
params_visual_odometry_
->
max_new_features
);
WOLF_INFO
(
"Retained "
,
kps_last_new
.
size
(),
" raw keypoints"
);
// Create a map of wolf KeyPoints to track only the new ones
KeyPointsMap
mwkps_last_new
,
mwkps_incoming_new
;
...
...
@@ -179,15 +185,16 @@ void ProcessorVisualOdometry::preProcess()
WKeyPoint
wkp
(
cvkp
);
mwkps_last_new
[
wkp
.
getId
()]
=
wkp
;
}
WOLF_INFO
(
"Found "
,
mwkps_last_new
.
size
(),
"
new
keypoints in last"
);
WOLF_INFO
(
"Found "
,
mwkps_last_new
.
size
(),
" keypoints in last
that are new
"
);
TracksMap
tracks_last_incoming_new
=
kltTrack
(
img_last
,
img_incoming
,
mwkps_last_new
,
mwkps_incoming_new
);
WOLF_INFO
(
"Tracked "
,
mwkps_incoming_new
.
size
(),
" new keypoints to incoming"
);
// Outliers rejection with essential matrix
// tracks that are not geometrically consistent are removed from tracks_last_incoming_new
cv
::
Mat
E
;
// 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_INFO
(
"
Track
ed "
,
mwkps_incoming_new
.
size
(),
"
new keypoints to incoming
"
);
WOLF_INFO
(
"
Retain
ed "
,
mwkps_incoming_new
.
size
(),
"
inliers
"
);
// Concatenation of old tracks and new tracks
// Only keep tracks until it reaches a max nb of tracks
...
...
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