diff --git a/modules/java/src/cpp/features2d_manual.hpp b/modules/java/src/cpp/features2d_manual.hpp index 8af711fd5..2a306ef5a 100644 --- a/modules/java/src/cpp/features2d_manual.hpp +++ b/modules/java/src/cpp/features2d_manual.hpp @@ -6,6 +6,27 @@ namespace cv { +class CV_EXPORTS_AS(FeatureDetector) javaFeatureDetector : public FeatureDetector +{ +public: +#if 0 + void detect( const Mat& image, vector& keypoints, const Mat& mask=Mat() ) const; + void detect( const vector& images, vector >& keypoints, const vector& masks=vector() ) const; + virtual void read( const FileNode& ); + virtual void write( FileStorage& ) const; + virtual bool empty() const; +#endif + + //supported: FAST STAR SIFT SURF ORB MSER GFTT HARRIS Grid(XXXX) Pyramid(XXXX) Dynamic(XXXX) + //not supported: SimpleBlob, Dense + CV_WRAP_AS(create) static javaFeatureDetector* jcreate( const string& detectorType ) + { + Ptr detector = FeatureDetector::create(detectorType); + detector.addref(); + return (javaFeatureDetector*)((FeatureDetector*) detector); + } +}; + class CV_EXPORTS_AS(DescriptorMatcher) javaDescriptorMatcher : public DescriptorMatcher { public: @@ -42,6 +63,7 @@ public: return (javaDescriptorMatcher*)((DescriptorMatcher*) matcher); } + //supported: FlannBased, BruteForce, BruteForce-L1, BruteForce-Hamming, BruteForce-HammingLUT CV_WRAP_AS(create) static javaDescriptorMatcher* jcreate( const string& descriptorMatcherType ) { Ptr matcher = DescriptorMatcher::create(descriptorMatcherType); @@ -50,6 +72,59 @@ public: } }; +class CV_EXPORTS_AS(DescriptorExtractor) javaDescriptorExtractor : public DescriptorExtractor +{ +public: +#if 0 + CV_WRAP void compute( const Mat& image, vector& keypoints, Mat& descriptors ) const; + CV_WRAP void compute( const vector& images, vector >& keypoints, vector& descriptors ) const; + CV_WRAP virtual void read( const FileNode& ); + CV_WRAP virtual void write( FileStorage& ) const; + CV_WRAP virtual int descriptorSize() const = 0; + CV_WRAP virtual int descriptorType() const = 0; + + CV_WRAP virtual bool empty() const; +#endif + + //supported SIFT, SURF, ORB, BRIEF, Opponent(XXXX) + //not supported: Calonder + CV_WRAP_AS(create) static javaDescriptorExtractor* jcreate( const string& descriptorExtractorType ) + { + Ptr extractor = DescriptorExtractor::create(descriptorExtractorType); + extractor.addref(); + return (javaDescriptorExtractor*)((DescriptorExtractor*) extractor); + } +}; + +#if 0 +enum +{ + DRAW_OVER_OUTIMG = 1, // Output image matrix will not be created (Mat::create). + // Matches will be drawn on existing content of output image. + NOT_DRAW_SINGLE_POINTS = 2, // Single keypoints will not be drawn. + DRAW_RICH_KEYPOINTS = 4 // For each keypoint the circle around keypoint with keypoint size and + // orientation will be drawn. +}; + +// Draw keypoints. +CV_EXPORTS_W void drawKeypoints( const Mat& image, const vector& keypoints, Mat& outImage, + const Scalar& color=Scalar::all(-1), int flags=0 ); + +// Draws matches of keypints from two images on output image. +CV_EXPORTS_W void drawMatches( const Mat& img1, const vector& keypoints1, + const Mat& img2, const vector& keypoints2, + const vector& matches1to2, Mat& outImg, + const Scalar& matchColor=Scalar::all(-1), const Scalar& singlePointColor=Scalar::all(-1), + const vector& matchesMask=vector(), int flags=0 ); + +CV_EXPORTS_W void drawMatches( const Mat& img1, const vector& keypoints1, + const Mat& img2, const vector& keypoints2, + const vector >& matches1to2, Mat& outImg, + const Scalar& matchColor=Scalar::all(-1), const Scalar& singlePointColor=Scalar::all(-1), + const vector >& matchesMask=vector >(), int flags=0); + +#endif + } //cv #endif // __OPENCV_FEATURES_2D_MANUAL_HPP__ \ No newline at end of file