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
0a6cb4eb
Commit
0a6cb4eb
authored
3 years ago
by
Joan Solà Ortega
Browse files
Options
Downloads
Patches
Plain Diff
Document the code
parent
ba7fcaa3
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
+9
-5
9 additions, 5 deletions
src/processor/processor_visual_odometry.cpp
with
9 additions
and
5 deletions
src/processor/processor_visual_odometry.cpp
+
9
−
5
View file @
0a6cb4eb
...
@@ -229,27 +229,31 @@ void ProcessorVisualOdometry::preProcess()
...
@@ -229,27 +229,31 @@ void ProcessorVisualOdometry::preProcess()
// We try a bunch of time to add keypoints to randomly selected empty regions of interest
// We try a bunch of time to add keypoints to randomly selected empty regions of interest
for
(
int
i
=
0
;
i
<
params_visual_odometry_
->
max_new_features
;
i
++
){
for
(
int
i
=
0
;
i
<
params_visual_odometry_
->
max_new_features
;
i
++
){
cv
::
Rect
rect_roi
;
cv
::
Rect
rect_roi
;
bool
is_empty
=
cell_grid_
.
pickRoi
(
rect_roi
);
bool
is_empty
=
cell_grid_
.
pickRoi
(
rect_roi
);
WOLF_TRACE
(
"rect_roi: "
,
rect_roi
)
if
(
!
is_empty
)
// no empty cells!
if
(
!
is_empty
)
{
{
break
;
break
;
}
}
cv
::
Mat
img_roi
(
img_incoming
,
rect_roi
);
// no data copy -> no overhead
cv
::
Mat
img_roi
(
img_incoming
,
rect_roi
);
// no data copy -> no overhead
std
::
vector
<
cv
::
KeyPoint
>
kps_roi
;
std
::
vector
<
cv
::
KeyPoint
>
kps_roi
;
detector_
->
detect
(
img_roi
,
kps_roi
);
detector_
->
detect
(
img_roi
,
kps_roi
);
if
(
kps_roi
.
size
()
>
0
){
if
(
kps_roi
.
size
()
>
0
){
// retain only the best
image
in each region of interest
// retain only the best
keypoint
in each region of interest
retainBest
(
kps_roi
,
1
);
retainBest
(
kps_roi
,
1
);
// update grid with this detection
cell_grid_
.
hitCell
(
kps_roi
.
at
(
0
));
// Keypoints are detected in the local coordinates of the region of interest
// Keypoints are detected in the local coordinates of the region of interest
// -> translate to the full image corner coordinate system
// -> translate to the full image corner coordinate system
kps_roi
.
at
(
0
).
pt
.
x
=
kps_roi
.
at
(
0
).
pt
.
x
+
rect_roi
.
x
;
kps_roi
.
at
(
0
).
pt
.
x
=
kps_roi
.
at
(
0
).
pt
.
x
+
rect_roi
.
x
;
kps_roi
.
at
(
0
).
pt
.
y
=
kps_roi
.
at
(
0
).
pt
.
y
+
rect_roi
.
y
;
kps_roi
.
at
(
0
).
pt
.
y
=
kps_roi
.
at
(
0
).
pt
.
y
+
rect_roi
.
y
;
kps_last_new
.
push_back
(
kps_roi
.
at
(
0
));
kps_last_new
.
push_back
(
kps_roi
.
at
(
0
));
WOLF_TRACE
(
kps_roi
.
at
(
0
).
pt
.
x
,
" "
,
kps_roi
.
at
(
0
).
pt
.
y
)
cell_grid_
.
hitCell
(
kps_roi
.
at
(
0
));
}
}
else
else
{
{
// block this grid's cell so that it is not reused for detection
cell_grid_
.
blockCell
(
rect_roi
);
cell_grid_
.
blockCell
(
rect_roi
);
}
}
}
}
...
...
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