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
2baf1a3c
Commit
2baf1a3c
authored
Mar 05, 2015
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3788 from berak:fix_features2d_tut
parents
aa113c5a
b7f2a4da
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
24 deletions
+11
-24
feature_flann_matcher.markdown
...es2d/feature_flann_matcher/feature_flann_matcher.markdown
+6
-12
feature_homography.markdown
...features2d/feature_homography/feature_homography.markdown
+5
-12
No files found.
doc/tutorials/features2d/feature_flann_matcher/feature_flann_matcher.markdown
View file @
2baf1a3c
...
...
@@ -54,25 +54,19 @@ int main( int argc, char** argv )
if( !img_1.data || !img_2.data )
{ std::cout<< " --(!) Error reading images " << std::endl; return -1; }
//-- Step 1: Detect the keypoints using SURF Detector
//-- Step 1: Detect the keypoints using SURF Detector
, compute the descriptors
int minHessian = 400;
SurfFeatureDetector detector( minHessian );
Ptr
<SURF>
detector = SURF::create();
detector->setMinHessian(minHessian);
std::vector
<KeyPoint>
keypoints_1, keypoints_2;
detector.detect( img_1, keypoints_1 );
detector.detect( img_2, keypoints_2 );
//-- Step 2: Calculate descriptors (feature vectors)
SurfDescriptorExtractor extractor;
Mat descriptors_1, descriptors_2;
extractor.c
ompute( img_1, keypoints_1, descriptors_1 );
extractor.c
ompute( img_2, keypoints_2, descriptors_2 );
detector->detectAndC
ompute( img_1, keypoints_1, descriptors_1 );
detector->detectAndC
ompute( img_2, keypoints_2, descriptors_2 );
//-- Step
3
: Matching descriptor vectors using FLANN matcher
//-- Step
2
: Matching descriptor vectors using FLANN matcher
FlannBasedMatcher matcher;
std::vector
<
DMatch
>
matches;
matcher.match( descriptors_1, descriptors_2, matches );
...
...
doc/tutorials/features2d/feature_homography/feature_homography.markdown
View file @
2baf1a3c
...
...
@@ -42,25 +42,18 @@ int main( int argc, char** argv )
if( !img_object.data || !img_scene.data )
{ std::cout<< " --(!) Error reading images " << std::endl; return -1; }
//-- Step 1: Detect the keypoints
using SURF Detector
//-- Step 1: Detect the keypoints
and extract descriptors using SURF
int minHessian = 400;
SurfFeatureDetector detector
( minHessian );
Ptr
<SURF>
detector = SURF::create
( minHessian );
std::vector
<KeyPoint>
keypoints_object, keypoints_scene;
detector.detect( img_object, keypoints_object );
detector.detect( img_scene, keypoints_scene );
//-- Step 2: Calculate descriptors (feature vectors)
SurfDescriptorExtractor extractor;
Mat descriptors_object, descriptors_scene;
extractor.c
ompute( img_object, keypoints_object, descriptors_object );
extractor.c
ompute( img_scene, keypoints_scene, descriptors_scene );
detector->detectAndC
ompute( img_object, keypoints_object, descriptors_object );
detector->detectAndC
ompute( img_scene, keypoints_scene, descriptors_scene );
//-- Step
3
: Matching descriptor vectors using FLANN matcher
//-- Step
2
: Matching descriptor vectors using FLANN matcher
FlannBasedMatcher matcher;
std::vector
<
DMatch
>
matches;
matcher.match( descriptors_object, descriptors_scene, matches );
...
...
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