Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
wolf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
wolf
Commits
4cbddaee
"ReadMe.md" did not exist on "7f01c0e3637f8fef4c14ba7610ff7c50f4ee8878"
Commit
4cbddaee
authored
7 years ago
by
Joan Solà Ortega
Browse files
Options
Downloads
Patches
Plain Diff
Update trackId in ProcessorTrackerFeature
parent
3d30eb3e
No related branches found
No related tags found
1 merge request
!157
Kfpackmanager
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/processor_image_feature.cpp
+3
-6
3 additions, 6 deletions
src/processor_image_feature.cpp
src/processor_tracker_feature.cpp
+44
-30
44 additions, 30 deletions
src/processor_tracker_feature.cpp
src/processor_tracker_feature_dummy.cpp
+0
-4
0 additions, 4 deletions
src/processor_tracker_feature_dummy.cpp
with
47 additions
and
40 deletions
src/processor_image_feature.cpp
+
3
−
6
View file @
4cbddaee
...
@@ -214,8 +214,6 @@ unsigned int ProcessorImageFeature::trackFeatures(const FeatureBaseList& _featur
...
@@ -214,8 +214,6 @@ unsigned int ProcessorImageFeature::trackFeatures(const FeatureBaseList& _featur
incoming_point_ptr
->
setIsKnown
(
feature_ptr
->
isKnown
());
incoming_point_ptr
->
setIsKnown
(
feature_ptr
->
isKnown
());
_feature_list_out
.
push_back
(
incoming_point_ptr
);
_feature_list_out
.
push_back
(
incoming_point_ptr
);
incoming_point_ptr
->
setTrackId
(
feature_ptr
->
trackId
());
_feature_matches
[
incoming_point_ptr
]
=
std
::
make_shared
<
FeatureMatch
>
(
FeatureMatch
({
feature_base_ptr
,
normalized_score
}));
_feature_matches
[
incoming_point_ptr
]
=
std
::
make_shared
<
FeatureMatch
>
(
FeatureMatch
({
feature_base_ptr
,
normalized_score
}));
}
}
else
else
...
@@ -321,7 +319,6 @@ unsigned int ProcessorImageFeature::detectNewFeatures(const unsigned int& _max_n
...
@@ -321,7 +319,6 @@ unsigned int ProcessorImageFeature::detectNewFeatures(const unsigned int& _max_n
new_descriptors
.
row
(
index
),
new_descriptors
.
row
(
index
),
Eigen
::
Matrix2s
::
Identity
()
*
params_
.
noise
.
pixel_noise_var
);
Eigen
::
Matrix2s
::
Identity
()
*
params_
.
noise
.
pixel_noise_var
);
point_ptr
->
setIsKnown
(
false
);
point_ptr
->
setIsKnown
(
false
);
point_ptr
->
setTrackId
(
point_ptr
->
id
());
addNewFeatureLast
(
point_ptr
);
addNewFeatureLast
(
point_ptr
);
active_search_grid_
.
hitCell
(
new_keypoints
[
0
]);
active_search_grid_
.
hitCell
(
new_keypoints
[
0
]);
...
@@ -369,10 +366,10 @@ unsigned int ProcessorImageFeature::detect(cv::Mat _image, cv::Rect& _roi, std::
...
@@ -369,10 +366,10 @@ unsigned int ProcessorImageFeature::detect(cv::Mat _image, cv::Rect& _roi, std::
detector_descriptor_ptr_
->
detect
(
_image_roi
,
_new_keypoints
);
detector_descriptor_ptr_
->
detect
(
_image_roi
,
_new_keypoints
);
detector_descriptor_ptr_
->
compute
(
_image_roi
,
_new_keypoints
,
new_descriptors
);
detector_descriptor_ptr_
->
compute
(
_image_roi
,
_new_keypoints
,
new_descriptors
);
for
(
unsigned
int
i
=
0
;
i
<
_new_keypoints
.
size
();
i
++
)
for
(
auto
point
:
_new_keypoints
)
{
{
_new_keypoints
[
i
].
pt
.
x
=
_new_keypoints
[
i
]
.
pt
.
x
+
_roi
.
x
;
point
.
pt
.
x
+
=
_roi
.
x
;
_new_keypoints
[
i
].
pt
.
y
=
_new_keypoints
[
i
]
.
pt
.
y
+
_roi
.
y
;
point
.
pt
.
y
+
=
_roi
.
y
;
}
}
return
_new_keypoints
.
size
();
return
_new_keypoints
.
size
();
}
}
...
...
This diff is collapsed.
Click to expand it.
src/processor_tracker_feature.cpp
+
44
−
30
View file @
4cbddaee
...
@@ -19,6 +19,41 @@ ProcessorTrackerFeature::~ProcessorTrackerFeature()
...
@@ -19,6 +19,41 @@ ProcessorTrackerFeature::~ProcessorTrackerFeature()
{
{
}
}
unsigned
int
ProcessorTrackerFeature
::
processNew
(
const
unsigned
int
&
_max_new_features
)
{
/* Rationale: A keyFrame will be created using the last Capture.
* First, we work on the last Capture to detect new Features,
* When done, we need to track these new Features to the incoming Capture.
* At the end, all new Features are appended to the lists of known Features in
* the last and incoming Captures.
*/
// Populate the last Capture with new Features. The result is in new_features_last_.
unsigned
int
n
=
detectNewFeatures
(
_max_new_features
);
for
(
auto
ftr
:
new_features_last_
)
{
ftr
->
setTrackId
(
ftr
->
id
()
);
WOLF_INFO
(
"New ftr track: "
,
ftr
->
trackId
(),
", last: "
,
ftr
->
id
());
}
// Track new features from last to incoming. This will append new correspondences to matches_last_incoming
trackFeatures
(
new_features_last_
,
new_features_incoming_
,
matches_last_from_incoming_
);
for
(
auto
match
:
matches_last_from_incoming_
)
{
match
.
first
->
setTrackId
(
match
.
second
->
feature_ptr_
->
trackId
()
);
WOLF_INFO
(
"New ftr track: "
,
match
.
first
->
trackId
(),
", last: "
,
match
.
second
->
feature_ptr_
->
id
(),
", inc: "
,
match
.
first
->
id
());
}
// Append all new Features to the incoming Captures' list of Features
incoming_ptr_
->
addFeatureList
(
new_features_incoming_
);
// Append all new Features to the last Captures' list of Features
last_ptr_
->
addFeatureList
(
new_features_last_
);
// return the number of new features detected in \b last
return
n
;
}
unsigned
int
ProcessorTrackerFeature
::
processKnown
()
unsigned
int
ProcessorTrackerFeature
::
processKnown
()
{
{
...
@@ -31,6 +66,11 @@ unsigned int ProcessorTrackerFeature::processKnown()
...
@@ -31,6 +66,11 @@ unsigned int ProcessorTrackerFeature::processKnown()
// Track features from last_ptr_ to incoming_ptr_
// Track features from last_ptr_ to incoming_ptr_
trackFeatures
(
last_ptr_
->
getFeatureList
(),
known_features_incoming_
,
matches_last_from_incoming_
);
trackFeatures
(
last_ptr_
->
getFeatureList
(),
known_features_incoming_
,
matches_last_from_incoming_
);
for
(
auto
match
:
matches_last_from_incoming_
)
{
match
.
first
->
setTrackId
(
match
.
second
->
feature_ptr_
->
trackId
()
);
WOLF_INFO
(
"Known ftr track: "
,
match
.
first
->
trackId
(),
", last: "
,
match
.
second
->
feature_ptr_
->
id
(),
", inc: "
,
match
.
first
->
id
());
}
// std::cout << "Tracked: " << known_features_incoming_.size() << std::endl;
// std::cout << "Tracked: " << known_features_incoming_.size() << std::endl;
...
@@ -53,10 +93,10 @@ unsigned int ProcessorTrackerFeature::processKnown()
...
@@ -53,10 +93,10 @@ unsigned int ProcessorTrackerFeature::processKnown()
known_incoming_feature_it
++
;
known_incoming_feature_it
++
;
}
}
}
}
std
::
cout
<<
"known features incoming: "
;
//
std::cout << "known features incoming: ";
for
(
auto
ftr
:
known_features_incoming_
)
//
for (auto ftr:known_features_incoming_)
std
::
cout
<<
ftr
->
id
()
<<
", "
;
//
std::cout << ftr->id() << ", ";
std
::
cout
<<
std
::
endl
;
//
std::cout << std::endl;
// Append remaining incoming features -> this empties known_features_incoming_
// Append remaining incoming features -> this empties known_features_incoming_
incoming_ptr_
->
addFeatureList
(
known_features_incoming_
);
incoming_ptr_
->
addFeatureList
(
known_features_incoming_
);
known_features_incoming_
.
clear
();
known_features_incoming_
.
clear
();
...
@@ -92,7 +132,6 @@ void ProcessorTrackerFeature::advanceDerived()
...
@@ -92,7 +132,6 @@ void ProcessorTrackerFeature::advanceDerived()
void
ProcessorTrackerFeature
::
resetDerived
()
void
ProcessorTrackerFeature
::
resetDerived
()
{
{
// std::cout << "ProcessorTrackerFeature::reset()" << std::endl;
// We also reset here the list of correspondences, which passes from last--incoming to origin--last.
// We also reset here the list of correspondences, which passes from last--incoming to origin--last.
std
::
cout
<<
"
\t
incoming 2 last: "
<<
matches_last_from_incoming_
.
size
()
<<
std
::
endl
;
std
::
cout
<<
"
\t
incoming 2 last: "
<<
matches_last_from_incoming_
.
size
()
<<
std
::
endl
;
...
@@ -110,31 +149,6 @@ void ProcessorTrackerFeature::resetDerived()
...
@@ -110,31 +149,6 @@ void ProcessorTrackerFeature::resetDerived()
}
}
unsigned
int
ProcessorTrackerFeature
::
processNew
(
const
unsigned
int
&
_max_new_features
)
{
/* Rationale: A keyFrame will be created using the last Capture.
* First, we work on the last Capture to detect new Features,
* When done, we need to track these new Features to the incoming Capture.
* At the end, all new Features are appended to the lists of known Features in
* the last and incoming Captures.
*/
// Populate the last Capture with new Features. The result is in new_features_last_.
unsigned
int
n
=
detectNewFeatures
(
_max_new_features
);
// Track new features from last to incoming. This will append new correspondences to matches_last_incoming
trackFeatures
(
new_features_last_
,
new_features_incoming_
,
matches_last_from_incoming_
);
// Append all new Features to the incoming Captures' list of Features
incoming_ptr_
->
addFeatureList
(
new_features_incoming_
);
// Append all new Features to the last Captures' list of Features
last_ptr_
->
addFeatureList
(
new_features_last_
);
// return the number of new features detected in \b last
return
n
;
}
void
ProcessorTrackerFeature
::
establishConstraints
()
void
ProcessorTrackerFeature
::
establishConstraints
()
{
{
for
(
auto
match
:
matches_origin_from_last_
)
for
(
auto
match
:
matches_origin_from_last_
)
...
...
This diff is collapsed.
Click to expand it.
src/processor_tracker_feature_dummy.cpp
+
0
−
4
View file @
4cbddaee
...
@@ -17,8 +17,6 @@ unsigned int ProcessorTrackerFeatureDummy::trackFeatures(const FeatureBaseList&
...
@@ -17,8 +17,6 @@ unsigned int ProcessorTrackerFeatureDummy::trackFeatures(const FeatureBaseList&
{
{
std
::
cout
<<
"tracking "
<<
_feature_list_in
.
size
()
<<
" features..."
<<
std
::
endl
;
std
::
cout
<<
"tracking "
<<
_feature_list_in
.
size
()
<<
" features..."
<<
std
::
endl
;
WOLF_TRACE
(
"List sizes: in: "
,
_feature_list_in
.
size
(),
"; out: "
,
_feature_list_out
.
size
(),
"; correspondences: "
,
_feature_correspondences
.
size
());
// loosing the track of the first 2 features
// loosing the track of the first 2 features
auto
features_lost
=
0
;
auto
features_lost
=
0
;
for
(
auto
feat_in_ptr
:
_feature_list_in
)
for
(
auto
feat_in_ptr
:
_feature_list_in
)
...
@@ -32,7 +30,6 @@ unsigned int ProcessorTrackerFeatureDummy::trackFeatures(const FeatureBaseList&
...
@@ -32,7 +30,6 @@ unsigned int ProcessorTrackerFeatureDummy::trackFeatures(const FeatureBaseList&
else
else
{
{
FeatureBasePtr
ftr
(
std
::
make_shared
<
FeatureBase
>
(
"POINT IMAGE"
,
feat_in_ptr
->
getMeasurement
(),
feat_in_ptr
->
getMeasurementCovariance
()));
FeatureBasePtr
ftr
(
std
::
make_shared
<
FeatureBase
>
(
"POINT IMAGE"
,
feat_in_ptr
->
getMeasurement
(),
feat_in_ptr
->
getMeasurementCovariance
()));
ftr
->
setTrackId
(
feat_in_ptr
->
id
());
_feature_list_out
.
push_back
(
ftr
);
_feature_list_out
.
push_back
(
ftr
);
_feature_correspondences
[
_feature_list_out
.
back
()]
=
std
::
make_shared
<
FeatureMatch
>
(
FeatureMatch
({
feat_in_ptr
,
0
}));
_feature_correspondences
[
_feature_list_out
.
back
()]
=
std
::
make_shared
<
FeatureMatch
>
(
FeatureMatch
({
feat_in_ptr
,
0
}));
std
::
cout
<<
"feature "
<<
feat_in_ptr
->
id
()
<<
" tracked to feature "
<<
ftr
->
id
()
<<
" !"
<<
std
::
endl
;
std
::
cout
<<
"feature "
<<
feat_in_ptr
->
id
()
<<
" tracked to feature "
<<
ftr
->
id
()
<<
" !"
<<
std
::
endl
;
...
@@ -62,7 +59,6 @@ unsigned int ProcessorTrackerFeatureDummy::detectNewFeatures(const unsigned int&
...
@@ -62,7 +59,6 @@ unsigned int ProcessorTrackerFeatureDummy::detectNewFeatures(const unsigned int&
FeatureBasePtr
ftr
(
FeatureBasePtr
ftr
(
std
::
make_shared
<
FeatureBase
>
(
"POINT IMAGE"
,
n_feature_
*
Eigen
::
Vector1s
::
Ones
(),
Eigen
::
MatrixXs
::
Ones
(
1
,
1
)));
std
::
make_shared
<
FeatureBase
>
(
"POINT IMAGE"
,
n_feature_
*
Eigen
::
Vector1s
::
Ones
(),
Eigen
::
MatrixXs
::
Ones
(
1
,
1
)));
new_features_last_
.
push_back
(
ftr
);
new_features_last_
.
push_back
(
ftr
);
ftr
->
setTrackId
(
ftr
->
id
());
std
::
cout
<<
"feature "
<<
ftr
->
id
()
<<
" detected!"
<<
std
::
endl
;
std
::
cout
<<
"feature "
<<
ftr
->
id
()
<<
" detected!"
<<
std
::
endl
;
}
}
std
::
cout
<<
new_features_last_
.
size
()
<<
" features detected!"
<<
std
::
endl
;
std
::
cout
<<
new_features_last_
.
size
()
<<
" features detected!"
<<
std
::
endl
;
...
...
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