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
edc41d4c
Commit
edc41d4c
authored
Nov 29, 2010
by
Gary Bradski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated comments
parent
1066bd2f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
19 deletions
+21
-19
matching_to_many_images.cpp
samples/cpp/matching_to_many_images.cpp
+21
-19
No files found.
samples/cpp/matching_to_many_images.cpp
View file @
edc41d4c
...
...
@@ -7,16 +7,6 @@
using
namespace
cv
;
using
namespace
std
;
/*
* This is a sample on matching descriptors detected on one image to descriptors detected in image set.
* So we have one query image and several train images. For each keypoint descriptor of query image
* the one nearest train descriptor is found the entire collection of train images. To visualize the result
* of matching we save images, each of which combines query and train image with matches between them (if they exist).
* Match is drawn as line between corresponding points. Count of all matches is equel to count of
* query keypoints, so we have the same count of lines in all set of result images (but not for each result
* (train) image).
*/
const
string
defaultDetectorType
=
"SURF"
;
const
string
defaultDescriptorType
=
"SURF"
;
const
string
defaultMatcherType
=
"FlannBased"
;
...
...
@@ -24,6 +14,27 @@ const string defaultQueryImageName = "../../opencv/samples/cpp/matching_to_many_
const
string
defaultFileWithTrainImages
=
"../../opencv/samples/cpp/matching_to_many_images/train/trainImages.txt"
;
const
string
defaultDirToSaveResImages
=
"../../opencv/samples/cpp/matching_to_many_images/results"
;
void
printPrompt
(
const
string
&
applName
)
{
cout
<<
"/*
\n
"
<<
" * This is a sample on matching descriptors detected on one image to descriptors detected in image set.
\n
"
<<
" * So we have one query image and several train images. For each keypoint descriptor of query image
\n
"
<<
" * the one nearest train descriptor is found the entire collection of train images. To visualize the result
\n
"
<<
" * of matching we save images, each of which combines query and train image with matches between them (if they exist).
\n
"
<<
" * Match is drawn as line between corresponding points. Count of all matches is equel to count of
\n
"
<<
" * query keypoints, so we have the same count of lines in all set of result images (but not for each result
\n
"
<<
" * (train) image).
\n
"
<<
" */
\n
"
<<
endl
;
cout
<<
endl
<<
"Format:"
<<
endl
;
cout
<<
"./"
<<
applName
<<
" [detectorType] [descriptorType] [matcherType] [queryImage] [fileWithTrainImages] [dirToSaveResImages]"
<<
endl
;
cout
<<
endl
;
cout
<<
"
\n
Example:"
<<
endl
<<
"./"
<<
applName
<<
" "
<<
defaultDetectorType
<<
" "
<<
defaultDescriptorType
<<
" "
<<
defaultMatcherType
<<
" "
<<
defaultQueryImageName
<<
" "
<<
defaultFileWithTrainImages
<<
" "
<<
defaultDirToSaveResImages
<<
endl
;
}
void
maskMatchesByTrainImgIdx
(
const
vector
<
DMatch
>&
matches
,
int
trainImgIdx
,
vector
<
char
>&
mask
)
{
mask
.
resize
(
matches
.
size
()
);
...
...
@@ -166,15 +177,6 @@ void saveResultImages( const Mat& queryImage, const vector<KeyPoint>& queryKeypo
cout
<<
">"
<<
endl
;
}
void
printPrompt
(
const
string
&
applName
)
{
cout
<<
endl
<<
"Format:"
<<
endl
;
cout
<<
applName
<<
" [detectorType] [descriptorType] [matcherType] [queryImage] [fileWithTrainImages] [dirToSaveResImages]"
<<
endl
;
cout
<<
endl
<<
"Example:"
<<
endl
<<
defaultDetectorType
<<
" "
<<
defaultDescriptorType
<<
" "
<<
defaultMatcherType
<<
" "
<<
defaultQueryImageName
<<
" "
<<
defaultFileWithTrainImages
<<
" "
<<
defaultDirToSaveResImages
<<
endl
;
}
int
main
(
int
argc
,
char
**
argv
)
{
string
detectorType
=
defaultDetectorType
;
...
...
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