Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv_contrib
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_contrib
Commits
f4df732b
Commit
f4df732b
authored
Apr 03, 2015
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #200 from alfonsosanchezbeato/fix-sample-reg
Adapt reg sample to changes in features detectors
parents
f822984a
97cf5ade
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
map_test.cpp
modules/reg/samples/map_test.cpp
+10
-9
No files found.
modules/reg/samples/map_test.cpp
View file @
f4df732b
...
...
@@ -289,23 +289,25 @@ static void calcHomographyFeature(const Mat& image1, const Mat& image2)
else
image2
.
copyTo
(
gray_image2
);
//-- Step 1: Detect the keypoints using SURF Detector
//-- Step 1: Detect the keypoints using SIFT or SURF Detector
#ifdef USE_SIFT
Ptr
<
Feature2D
>
features
=
SIFT
::
create
();
#else
int
minHessian
=
400
;
SurfFeatureDetector
detector
(
minHessian
);
Ptr
<
Feature2D
>
features
=
SURF
::
create
(
minHessian
);
#endif
std
::
vector
<
KeyPoint
>
keypoints_object
,
keypoints_scene
;
detector
.
detect
(
gray_image1
,
keypoints_object
);
detector
.
detect
(
gray_image2
,
keypoints_scene
);
features
->
detect
(
gray_image1
,
keypoints_object
);
features
->
detect
(
gray_image2
,
keypoints_scene
);
//-- Step 2: Calculate descriptors (feature vectors)
SurfDescriptorExtractor
extractor
;
Mat
descriptors_object
,
descriptors_scene
;
extractor
.
compute
(
gray_image1
,
keypoints_object
,
descriptors_object
);
extractor
.
compute
(
gray_image2
,
keypoints_scene
,
descriptors_scene
);
features
->
compute
(
gray_image1
,
keypoints_object
,
descriptors_object
);
features
->
compute
(
gray_image2
,
keypoints_scene
,
descriptors_scene
);
//-- Step 3: Matching descriptor vectors using FLANN matcher
FlannBasedMatcher
matcher
;
...
...
@@ -431,4 +433,3 @@ int main(void)
return
0
;
}
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