Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
vision_utils
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
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
labrobotica
algorithms
vision_utils
Commits
6c07df30
Commit
6c07df30
authored
7 years ago
by
Angel Santamaria-Navarro
Browse files
Options
Downloads
Patches
Plain Diff
Add nnSymmetryTest. No gtest yet
parent
64b06297
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/matchers/matcher_base.cpp
+26
-0
26 additions, 0 deletions
src/matchers/matcher_base.cpp
src/matchers/matcher_base.h
+5
-0
5 additions, 0 deletions
src/matchers/matcher_base.h
with
31 additions
and
0 deletions
src/matchers/matcher_base.cpp
+
26
−
0
View file @
6c07df30
...
...
@@ -308,6 +308,32 @@ void MatcherBase::ransacTest(const KeyPointVector& _raw_kps1,
}
}
void
MatcherBase
::
nnSymmetryTest
(
const
std
::
vector
<
DMatchVector
>&
_matches1
,
const
std
::
vector
<
DMatchVector
>&
_matches2
,
DMatchVector
&
_sym_matches
)
{
// for all matches image 1 -> image 2
for
(
std
::
vector
<
DMatchVector
>::
const_iterator
itM1
=
_matches1
.
begin
();
itM1
!=
_matches1
.
end
();
++
itM1
)
{
if
(
itM1
->
size
()
<
2
)
// ignore deleted matches
continue
;
// for all matches image 2 -> image 1
for
(
std
::
vector
<
DMatchVector
>::
const_iterator
itM2
=
_matches2
.
begin
();
itM2
!=
_matches2
.
end
();
++
itM2
)
{
if
(
itM2
->
size
()
<
2
)
// ignore deleted matches
continue
;
// Match symmetry test
if
((
*
itM1
)[
0
].
queryIdx
==
(
*
itM2
)[
0
].
trainIdx
&&
(
*
itM2
)[
0
].
queryIdx
==
(
*
itM1
)[
0
].
trainIdx
)
{
// add symmetrical match
_sym_matches
.
push_back
(
cv
::
DMatch
((
*
itM1
)[
0
].
queryIdx
,
(
*
itM1
)[
0
].
trainIdx
,
(
*
itM1
)[
0
].
distance
));
break
;
// next match in image 1 -> image 2
}
}
}
}
cv
::
Mat
MatcherBase
::
drawMatches
(
const
cv
::
Mat
_img1
,
const
cv
::
Mat
_img2
,
KeyPointVector
_kpts12_img1
,
KeyPointVector
_kpts12_img2
)
{
...
...
This diff is collapsed.
Click to expand it.
src/matchers/matcher_base.h
+
5
−
0
View file @
6c07df30
...
...
@@ -134,6 +134,11 @@ class MatcherBase : public VUBase, public std::enable_shared_from_this<MatcherBa
KeyPointVector
&
_inlier_kps2
,
DMatchVector
&
_inlier_matches
);
// Check symmetry between nn matches from <im1->im2> and from <im2->im1> pairs
void
nnSymmetryTest
(
const
std
::
vector
<
DMatchVector
>&
_matches1
,
const
std
::
vector
<
DMatchVector
>&
_matches2
,
DMatchVector
&
_sym_matches
);
// Factory method
static
MatcherBasePtr
create
(
const
std
::
string
&
_unique_name
,
const
ParamsBasePtr
_params
);
...
...
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