From 0ba3236ce0c4208a110a73e2e1ad3cd50aa1ad93 Mon Sep 17 00:00:00 2001 From: Andrey Kamaev Date: Thu, 17 May 2012 10:52:07 +0000 Subject: [PATCH] Fixed Algorithm usage example #1904 --- modules/core/doc/basic_structures.rst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/core/doc/basic_structures.rst b/modules/core/doc/basic_structures.rst index 3244290db3..cfdc3c61a8 100644 --- a/modules/core/doc/basic_structures.rst +++ b/modules/core/doc/basic_structures.rst @@ -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: :: #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: :: FileStorage fs("sift_params.xml", FileStorage::READ); if( fs.isOpened() ) // if we have file with parameters, read them { - sift.read(fs["sift_params"]); + sift->read(fs["sift_params"]); fs.release(); } 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); - sift.write(fs); + sift->write(fs); } } Mat image = imread("myimage.png", 0), descriptors; vector keypoints; - sift(image, noArray(), keypoints, descriptors); + (*sift)(image, noArray(), keypoints, descriptors); Algorithm::get