Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
b28056e3
Commit
b28056e3
authored
May 03, 2015
by
laurentBerger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Trailing whitespace
parent
3e25c085
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
6 deletions
+2
-6
matchmethod_orb_akaze_brisk.cpp
samples/cpp/matchmethod_orb_akaze_brisk.cpp
+2
-6
No files found.
samples/cpp/matchmethod_orb_akaze_brisk.cpp
View file @
b28056e3
...
@@ -12,7 +12,7 @@ int main(void)
...
@@ -12,7 +12,7 @@ int main(void)
typeAlgoMatch
.
push_back
(
"BruteForce"
);
typeAlgoMatch
.
push_back
(
"BruteForce"
);
typeAlgoMatch
.
push_back
(
"BruteForce-Hamming"
);
typeAlgoMatch
.
push_back
(
"BruteForce-Hamming"
);
typeAlgoMatch
.
push_back
(
"BruteForce-Hamming(2)"
);
typeAlgoMatch
.
push_back
(
"BruteForce-Hamming(2)"
);
vector
<
String
>
typeDesc
;
vector
<
String
>
typeDesc
;
typeDesc
.
push_back
(
"AKAZE"
);
typeDesc
.
push_back
(
"AKAZE"
);
typeDesc
.
push_back
(
"ORB"
);
typeDesc
.
push_back
(
"ORB"
);
...
@@ -22,7 +22,7 @@ int main(void)
...
@@ -22,7 +22,7 @@ int main(void)
vector
<
String
>
fileName
;
vector
<
String
>
fileName
;
fileName
.
push_back
(
"basketball1.png"
);
fileName
.
push_back
(
"basketball1.png"
);
fileName
.
push_back
(
"basketball2.png"
);
fileName
.
push_back
(
"basketball2.png"
);
Mat
img1
=
imread
(
dataFolder
+
fileName
[
0
],
IMREAD_GRAYSCALE
);
Mat
img1
=
imread
(
dataFolder
+
fileName
[
0
],
IMREAD_GRAYSCALE
);
Mat
img2
=
imread
(
dataFolder
+
fileName
[
1
],
IMREAD_GRAYSCALE
);
Mat
img2
=
imread
(
dataFolder
+
fileName
[
1
],
IMREAD_GRAYSCALE
);
...
@@ -61,19 +61,15 @@ int main(void)
...
@@ -61,19 +61,15 @@ int main(void)
tab
.
at
<
float
>
(
i
,
0
)
=
matches
[
i
].
distance
;
tab
.
at
<
float
>
(
i
,
0
)
=
matches
[
i
].
distance
;
sortIdx
(
tab
,
index
,
SORT_EVERY_COLUMN
+
SORT_ASCENDING
);
sortIdx
(
tab
,
index
,
SORT_EVERY_COLUMN
+
SORT_ASCENDING
);
vector
<
DMatch
>
bestMatches
;
/*<! best match */
vector
<
DMatch
>
bestMatches
;
/*<! best match */
for
(
int
i
=
0
;
i
<
30
;
i
++
)
for
(
int
i
=
0
;
i
<
30
;
i
++
)
bestMatches
.
push_back
(
matches
[
index
.
at
<
int
>
(
i
,
0
)]);
bestMatches
.
push_back
(
matches
[
index
.
at
<
int
>
(
i
,
0
)]);
Mat
result
;
Mat
result
;
drawMatches
(
img1
,
keyImg1
,
img2
,
keyImg2
,
bestMatches
,
result
);
drawMatches
(
img1
,
keyImg1
,
img2
,
keyImg2
,
bestMatches
,
result
);
namedWindow
(
*
itDesc
+
": "
+*
itMatcher
,
WINDOW_AUTOSIZE
);
namedWindow
(
*
itDesc
+
": "
+*
itMatcher
,
WINDOW_AUTOSIZE
);
imshow
(
*
itDesc
+
": "
+
*
itMatcher
,
result
);
imshow
(
*
itDesc
+
": "
+
*
itMatcher
,
result
);
FileStorage
fs
(
*
itDesc
+
"_"
+*
itMatcher
+
"_"
+
fileName
[
0
]
+
"_"
+
fileName
[
1
]
+
".xml"
,
FileStorage
::
WRITE
);
FileStorage
fs
(
*
itDesc
+
"_"
+*
itMatcher
+
"_"
+
fileName
[
0
]
+
"_"
+
fileName
[
1
]
+
".xml"
,
FileStorage
::
WRITE
);
fs
<<
"Matches"
<<
matches
;
fs
<<
"Matches"
<<
matches
;
vector
<
DMatch
>::
iterator
it
;
vector
<
DMatch
>::
iterator
it
;
cout
<<
"Index
\t
Index
\t
index
\t
distance
\n
"
;
cout
<<
"Index
\t
Index
\t
index
\t
distance
\n
"
;
cout
<<
"in img1
\t
in img2
\t
image
\t\n
"
;
cout
<<
"in img1
\t
in img2
\t
image
\t\n
"
;
for
(
it
=
matches
.
begin
();
it
!=
matches
.
end
();
it
++
)
for
(
it
=
matches
.
begin
();
it
!=
matches
.
end
();
it
++
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment