From 27d2d3cbaccf9b7c0759af475ae2c02de01712c4 Mon Sep 17 00:00:00 2001 From: Vadim Pisarevsky Date: Tue, 12 Aug 2014 00:03:40 +0400 Subject: [PATCH] fixed doc builder complains and the test failures --- modules/core/doc/basic_structures.rst | 8 +- .../common_interfaces_of_descriptor_extractors.rst | 7 -- .../doc/common_interfaces_of_feature_detectors.rst | 7 -- .../test/test_descriptors_regression.cpp | 22 ---- .../features2d/test/test_detectors_regression.cpp | 18 ---- modules/features2d/test/test_keypoints.cpp | 12 --- .../java/generator/src/cpp/features2d_manual.hpp | 118 --------------------- modules/stitching/doc/matching.rst | 2 +- 8 files changed, 4 insertions(+), 190 deletions(-) diff --git a/modules/core/doc/basic_structures.rst b/modules/core/doc/basic_structures.rst index 8a759bc..ce66c7d 100644 --- a/modules/core/doc/basic_structures.rst +++ b/modules/core/doc/basic_structures.rst @@ -3051,13 +3051,11 @@ Here is example of SIFT use in your application via Algorithm interface: :: #include "opencv2/opencv.hpp" #include "opencv2/xfeatures2d.hpp" - + using namespace cv::xfeatures2d; ... - initModule_nonfree(); // to load SURF/SIFT etc. - Ptr sift = SIFT::create(); FileStorage fs("sift_params.xml", FileStorage::READ); @@ -3068,7 +3066,7 @@ Here is example of SIFT use in your application via Algorithm interface: :: } 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->setContrastThreshold(0.01f); // lower the contrast threshold, compared to the default value { WriteStructContext ws(fs, "sift_params", CV_NODE_MAP); @@ -3078,7 +3076,7 @@ Here is example of SIFT use in your application via Algorithm interface: :: Mat image = imread("myimage.png", 0), descriptors; vector keypoints; - (*sift)(image, noArray(), keypoints, descriptors); + sift->detectAndCompute(image, noArray(), keypoints, descriptors); Algorithm::name --------------- diff --git a/modules/features2d/doc/common_interfaces_of_descriptor_extractors.rst b/modules/features2d/doc/common_interfaces_of_descriptor_extractors.rst index e99c672..e910add 100644 --- a/modules/features2d/doc/common_interfaces_of_descriptor_extractors.rst +++ b/modules/features2d/doc/common_interfaces_of_descriptor_extractors.rst @@ -84,13 +84,6 @@ Creates a descriptor extractor by name. The current implementation supports the following types of a descriptor extractor: - * ``"SIFT"`` -- :ocv:class:`SIFT` - * ``"SURF"`` -- :ocv:class:`SURF` - * ``"BRIEF"`` -- :ocv:class:`BriefDescriptorExtractor` * ``"BRISK"`` -- :ocv:class:`BRISK` * ``"ORB"`` -- :ocv:class:`ORB` - * ``"FREAK"`` -- :ocv:class:`FREAK` -A combined format is also supported: descriptor extractor adapter name ( ``"Opponent"`` -- -:ocv:class:`OpponentColorDescriptorExtractor` ) + descriptor extractor name (see above), -for example: ``"OpponentSIFT"`` . diff --git a/modules/features2d/doc/common_interfaces_of_feature_detectors.rst b/modules/features2d/doc/common_interfaces_of_feature_detectors.rst index 4f31dc0..f4e4244 100644 --- a/modules/features2d/doc/common_interfaces_of_feature_detectors.rst +++ b/modules/features2d/doc/common_interfaces_of_feature_detectors.rst @@ -72,20 +72,13 @@ Creates a feature detector by its name. The following detector types are supported: * ``"FAST"`` -- :ocv:class:`FastFeatureDetector` -* ``"STAR"`` -- :ocv:class:`StarFeatureDetector` * ``"ORB"`` -- :ocv:class:`ORB` * ``"BRISK"`` -- :ocv:class:`BRISK` * ``"MSER"`` -- :ocv:class:`MSER` * ``"GFTT"`` -- :ocv:class:`GoodFeaturesToTrackDetector` * ``"HARRIS"`` -- :ocv:class:`GoodFeaturesToTrackDetector` with Harris detector enabled -* ``"Dense"`` -- :ocv:class:`DenseFeatureDetector` * ``"SimpleBlob"`` -- :ocv:class:`SimpleBlobDetector` -Also a combined format is supported: feature detector adapter name ( ``"Grid"`` -- -:ocv:class:`GridAdaptedFeatureDetector`, ``"Pyramid"`` -- -:ocv:class:`PyramidAdaptedFeatureDetector` ) + feature detector name (see above), -for example: ``"GridFAST"``, ``"PyramidSTAR"`` . - FastFeatureDetector ------------------- .. ocv:class:: FastFeatureDetector : public FeatureDetector diff --git a/modules/features2d/test/test_descriptors_regression.cpp b/modules/features2d/test/test_descriptors_regression.cpp index 3c6ae97..944f297 100644 --- a/modules/features2d/test/test_descriptors_regression.cpp +++ b/modules/features2d/test/test_descriptors_regression.cpp @@ -327,28 +327,6 @@ TEST( Features2d_DescriptorExtractor_ORB, regression ) test.safe_run(); } -TEST( Features2d_DescriptorExtractor_FREAK, regression ) -{ - // TODO adjust the parameters below - CV_DescriptorExtractorTest test( "descriptor-freak", (CV_DescriptorExtractorTest::DistanceType)12.f, - DescriptorExtractor::create("FREAK") ); - test.safe_run(); -} - -TEST( Features2d_DescriptorExtractor_BRIEF, regression ) -{ - CV_DescriptorExtractorTest test( "descriptor-brief", 1, - DescriptorExtractor::create("BRIEF") ); - test.safe_run(); -} - -TEST( Features2d_DescriptorExtractor_OpponentBRIEF, regression ) -{ - CV_DescriptorExtractorTest test( "descriptor-opponent-brief", 1, - DescriptorExtractor::create("OpponentBRIEF") ); - test.safe_run(); -} - TEST( Features2d_DescriptorExtractor_KAZE, regression ) { CV_DescriptorExtractorTest< L2 > test( "descriptor-kaze", 0.03f, diff --git a/modules/features2d/test/test_detectors_regression.cpp b/modules/features2d/test/test_detectors_regression.cpp index 25e2c7f..1a7d09a 100644 --- a/modules/features2d/test/test_detectors_regression.cpp +++ b/modules/features2d/test/test_detectors_regression.cpp @@ -277,12 +277,6 @@ TEST( Features2d_Detector_MSER, DISABLED_regression ) test.safe_run(); } -TEST( Features2d_Detector_STAR, regression ) -{ - CV_FeatureDetectorTest test( "detector-star", FeatureDetector::create("STAR") ); - test.safe_run(); -} - TEST( Features2d_Detector_ORB, regression ) { CV_FeatureDetectorTest test( "detector-orb", FeatureDetector::create("ORB") ); @@ -300,15 +294,3 @@ TEST( Features2d_Detector_AKAZE, regression ) CV_FeatureDetectorTest test( "detector-akaze", FeatureDetector::create("AKAZE") ); test.safe_run(); } - -TEST( Features2d_Detector_GridFAST, regression ) -{ - CV_FeatureDetectorTest test( "detector-grid-fast", FeatureDetector::create("GridFAST") ); - test.safe_run(); -} - -TEST( Features2d_Detector_PyramidFAST, regression ) -{ - CV_FeatureDetectorTest test( "detector-pyramid-fast", FeatureDetector::create("PyramidFAST") ); - test.safe_run(); -} diff --git a/modules/features2d/test/test_keypoints.cpp b/modules/features2d/test/test_keypoints.cpp index a9f30b1..349c03e 100644 --- a/modules/features2d/test/test_keypoints.cpp +++ b/modules/features2d/test/test_keypoints.cpp @@ -155,18 +155,6 @@ TEST(Features2d_Detector_Keypoints_ORB, validation) test.safe_run(); } -TEST(Features2d_Detector_Keypoints_Star, validation) -{ - CV_FeatureDetectorKeypointsTest test(Algorithm::create("Feature2D.STAR")); - test.safe_run(); -} - -TEST(Features2d_Detector_Keypoints_Dense, validation) -{ - CV_FeatureDetectorKeypointsTest test(Algorithm::create("Feature2D.Dense")); - test.safe_run(); -} - TEST(Features2d_Detector_Keypoints_KAZE, validation) { CV_FeatureDetectorKeypointsTest test(Algorithm::create("Feature2D.KAZE")); diff --git a/modules/java/generator/src/cpp/features2d_manual.hpp b/modules/java/generator/src/cpp/features2d_manual.hpp index 603f8b2..90a1611 100644 --- a/modules/java/generator/src/cpp/features2d_manual.hpp +++ b/modules/java/generator/src/cpp/features2d_manual.hpp @@ -390,124 +390,6 @@ private: Ptr wrapped; }; -class CV_EXPORTS_AS(GenericDescriptorMatcher) javaGenericDescriptorMatcher -{ -public: - CV_WRAP void add( const std::vector& images, - std::vector >& keypoints ) - { return wrapped->add(images, keypoints); } - - CV_WRAP const std::vector& getTrainImages() const - { return wrapped->getTrainImages(); } - - CV_WRAP const std::vector >& getTrainKeypoints() const - { return wrapped->getTrainKeypoints(); } - - CV_WRAP void clear() - { return wrapped->clear(); } - - CV_WRAP bool isMaskSupported() - { return wrapped->isMaskSupported(); } - - CV_WRAP void train() - { return wrapped->train(); } - - CV_WRAP void classify( const Mat& queryImage, CV_IN_OUT std::vector& queryKeypoints, - const Mat& trainImage, std::vector& trainKeypoints ) const - { return wrapped->classify(queryImage, queryKeypoints, trainImage, trainKeypoints); } - - CV_WRAP void classify( const Mat& queryImage, CV_IN_OUT std::vector& queryKeypoints ) - { return wrapped->classify(queryImage, queryKeypoints); } - - CV_WRAP void match( const Mat& queryImage, std::vector& queryKeypoints, - const Mat& trainImage, std::vector& trainKeypoints, - CV_OUT std::vector& matches, const Mat& mask=Mat() ) const - { return wrapped->match(queryImage, queryKeypoints, trainImage, trainKeypoints, matches, mask); } - - CV_WRAP void knnMatch( const Mat& queryImage, std::vector& queryKeypoints, - const Mat& trainImage, std::vector& trainKeypoints, - CV_OUT std::vector >& matches, int k, - const Mat& mask=Mat(), bool compactResult=false ) const - { return wrapped->knnMatch(queryImage, queryKeypoints, trainImage, trainKeypoints, - matches, k, mask, compactResult); } - - CV_WRAP void radiusMatch( const Mat& queryImage, std::vector& queryKeypoints, - const Mat& trainImage, std::vector& trainKeypoints, - CV_OUT std::vector >& matches, float maxDistance, - const Mat& mask=Mat(), bool compactResult=false ) const - { return wrapped->radiusMatch(queryImage, queryKeypoints, trainImage, trainKeypoints, - matches, maxDistance, mask, compactResult); } - - CV_WRAP void match( const Mat& queryImage, std::vector& queryKeypoints, - CV_OUT std::vector& matches, const std::vector& masks=std::vector() ) - { return wrapped->match(queryImage, queryKeypoints, matches, masks); } - - CV_WRAP void knnMatch( const Mat& queryImage, std::vector& queryKeypoints, - CV_OUT std::vector >& matches, int k, - const std::vector& masks=std::vector(), bool compactResult=false ) - { return wrapped->knnMatch(queryImage, queryKeypoints, matches, k, masks, compactResult); } - - CV_WRAP void radiusMatch( const Mat& queryImage, std::vector& queryKeypoints, - CV_OUT std::vector >& matches, float maxDistance, - const std::vector& masks=std::vector(), bool compactResult=false ) - { return wrapped->radiusMatch(queryImage, queryKeypoints, matches, maxDistance, masks, compactResult); } - - CV_WRAP bool empty() const - { return wrapped->empty(); } - - - enum - { - ONEWAY = 1, - FERN = 2 - }; - - CV_WRAP_AS(clone) javaGenericDescriptorMatcher* jclone( bool emptyTrainData=false ) const - { - return new javaGenericDescriptorMatcher(wrapped->clone(emptyTrainData)); - } - - //supported: OneWay, Fern - //unsupported: Vector - CV_WRAP static javaGenericDescriptorMatcher* create( int matcherType ) - { - String name; - - switch(matcherType) - { - case ONEWAY: - name = "ONEWAY"; - break; - case FERN: - name = "FERN"; - break; - default: - CV_Error( Error::StsBadArg, "Specified generic descriptor matcher type is not supported." ); - break; - } - - return new javaGenericDescriptorMatcher(GenericDescriptorMatcher::create(name)); - } - - CV_WRAP void write( const String& fileName ) const - { - FileStorage fs(fileName, FileStorage::WRITE); - wrapped->write(fs); - } - - CV_WRAP void read( const String& fileName ) - { - FileStorage fs(fileName, FileStorage::READ); - wrapped->read(fs.root()); - } - -private: - javaGenericDescriptorMatcher(Ptr _wrapped) : wrapped(_wrapped) - {} - - Ptr wrapped; -}; - #if 0 //DO NOT REMOVE! The block is required for sources parser enum diff --git a/modules/stitching/doc/matching.rst b/modules/stitching/doc/matching.rst index 9f112d0..e8a0ee6 100644 --- a/modules/stitching/doc/matching.rst +++ b/modules/stitching/doc/matching.rst @@ -88,7 +88,7 @@ SURF features finder. :: /* hidden */ }; -.. seealso:: :ocv:class:`detail::FeaturesFinder`, :ocv:class:`SURF` +.. seealso:: :ocv:class:`detail::FeaturesFinder`, ``SURF`` detail::OrbFeaturesFinder ------------------------- -- 2.7.4