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
0ba3236c
Commit
0ba3236c
authored
May 17, 2012
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed Algorithm usage example #1904
parent
8f3273bf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
basic_structures.rst
modules/core/doc/basic_structures.rst
+5
-4
No files found.
modules/core/doc/basic_structures.rst
View file @
0ba3236c
...
@@ -2324,6 +2324,7 @@ The class provides the following features for all derived classes:
...
@@ -2324,6 +2324,7 @@ The class provides the following features for all derived classes:
Here is example of SIFT use in your application via Algorithm interface: ::
Here is example of SIFT use in your application via Algorithm interface: ::
#include "opencv2/opencv.hpp"
#include "opencv2/opencv.hpp"
#include "opencv2/nonfree/nonfree.hpp"
...
...
...
@@ -2334,22 +2335,22 @@ Here is example of SIFT use in your application via Algorithm interface: ::
...
@@ -2334,22 +2335,22 @@ Here is example of SIFT use in your application via Algorithm interface: ::
FileStorage fs("sift_params.xml", FileStorage::READ);
FileStorage fs("sift_params.xml", FileStorage::READ);
if( fs.isOpened() ) // if we have file with parameters, read them
if( fs.isOpened() ) // if we have file with parameters, read them
{
{
sift
.
read(fs["sift_params"]);
sift
->
read(fs["sift_params"]);
fs.release();
fs.release();
}
}
else // else modify the parameters and store them; user can later edit the file to use different parameters
else // else modify the parameters and store them; user can later edit the file to use different parameters
{
{
sift
.
set("contrastThreshold", 0.01f); // lower the contrast threshold, compared to the default value
sift
->
set("contrastThreshold", 0.01f); // lower the contrast threshold, compared to the default value
{
{
WriteStructContext ws(fs, "sift_params", CV_NODE_MAP);
WriteStructContext ws(fs, "sift_params", CV_NODE_MAP);
sift
.
write(fs);
sift
->
write(fs);
}
}
}
}
Mat image = imread("myimage.png", 0), descriptors;
Mat image = imread("myimage.png", 0), descriptors;
vector<KeyPoint> keypoints;
vector<KeyPoint> keypoints;
sift
(image, noArray(), keypoints, descriptors);
(*sift)
(image, noArray(), keypoints, descriptors);
Algorithm::get
Algorithm::get
...
...
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