More granular build of Java API: it is now possible to build Java wrappers only for the subset of OpenCV modules

This commit is contained in:
Andrey Kamaev
2012-02-20 11:50:43 +00:00
parent 8dc28473c7
commit 00db5a69a2
6 changed files with 149 additions and 115 deletions

View File

@@ -1,7 +1,3 @@
//
// This file is auto-generated, please don't edit!
//
#include <jni.h>
#ifdef DEBUG
@@ -10,6 +6,9 @@
#define LOGD(...) ((void)__android_log_print(ANDROID_LOG_DEBUG, MODULE_LOG_TAG, __VA_ARGS__))
#endif // DEBUG
#include "opencv2/opencv_modules.hpp"
#ifdef HAVE_OPENCV_HIGHGUI
#include "opencv2/highgui/highgui_c.h"
#include "opencv2/highgui/highgui.hpp"
using namespace cv;
@@ -452,3 +451,4 @@ JNIEXPORT void JNICALL Java_org_opencv_highgui_VideoCapture_n_1delete
} // extern "C"
#endif // HAVE_OPENCV_HIGHGUI

View File

@@ -180,7 +180,7 @@ void vector_Point3d_to_Mat(vector<Point3d>& v_point, Mat& mat)
mat = Mat(v_point, true);
}
#ifdef HAVE_OPENCV_FEATURES2D
//vector_KeyPoint
void Mat_to_vector_KeyPoint(Mat& mat, vector<KeyPoint>& v_kp)
{
@@ -206,6 +206,7 @@ void vector_KeyPoint_to_Mat(vector<KeyPoint>& v_kp, Mat& mat)
mat.at< Vec<double, 7> >(i, 0) = Vec<double, 7>(kp.pt.x, kp.pt.y, kp.size, kp.angle, kp.response, kp.octave, kp.class_id);
}
}
#endif
//vector_Mat
@@ -239,6 +240,7 @@ void vector_Mat_to_Mat(std::vector<cv::Mat>& v_mat, cv::Mat& mat)
}
}
#ifdef HAVE_OPENCV_FEATURES2D
//vector_DMatch
void Mat_to_vector_DMatch(Mat& mat, vector<DMatch>& v_dm)
{
@@ -264,6 +266,7 @@ void vector_DMatch_to_Mat(vector<DMatch>& v_dm, Mat& mat)
mat.at< Vec<double, 4> >(i, 0) = Vec<double, 4>(dm.queryIdx, dm.trainIdx, dm.imgIdx, dm.distance);
}
}
#endif
void Mat_to_vector_vector_Point(Mat& mat, vector< vector< Point > >& vv_pt)
{
@@ -278,6 +281,7 @@ void Mat_to_vector_vector_Point(Mat& mat, vector< vector< Point > >& vv_pt)
}
}
#ifdef HAVE_OPENCV_FEATURES2D
void Mat_to_vector_vector_KeyPoint(Mat& mat, vector< vector< KeyPoint > >& vv_kp)
{
vector<Mat> vm;
@@ -329,6 +333,7 @@ void vector_vector_DMatch_to_Mat(vector< vector< DMatch > >& vv_dm, Mat& mat)
}
vector_Mat_to_Mat(vm, mat);
}
#endif
void Mat_to_vector_vector_char(Mat& mat, vector< vector< char > >& vv_ch)
{

View File

@@ -1,10 +1,9 @@
#include <jni.h>
#include "opencv2/opencv_modules.hpp"
#include "opencv2/core/core.hpp"
#include "opencv2/features2d/features2d.hpp"
#include "features2d_manual.hpp"
void Mat_to_vector_int(cv::Mat& mat, std::vector<int>& v_int);
void vector_int_to_Mat(std::vector<int>& v_int, cv::Mat& mat);
@@ -41,12 +40,15 @@ void vector_Point3d_to_Mat(std::vector<cv::Point3d>& v_point, cv::Mat& mat);
void vector_Vec4f_to_Mat(std::vector<cv::Vec4f>& v_vec, cv::Mat& mat);
void vector_Vec6f_to_Mat(std::vector<cv::Vec6f>& v_vec, cv::Mat& mat);
#ifdef HAVE_OPENCV_FEATURES2D
void Mat_to_vector_KeyPoint(cv::Mat& mat, std::vector<cv::KeyPoint>& v_kp);
void vector_KeyPoint_to_Mat(std::vector<cv::KeyPoint>& v_kp, cv::Mat& mat);
#endif
void Mat_to_vector_Mat(cv::Mat& mat, std::vector<cv::Mat>& v_mat);
void vector_Mat_to_Mat(std::vector<cv::Mat>& v_mat, cv::Mat& mat);
#ifdef HAVE_OPENCV_FEATURES2D
void Mat_to_vector_DMatch(cv::Mat& mat, std::vector<cv::DMatch>& v_dm);
void vector_DMatch_to_Mat(std::vector<cv::DMatch>& v_dm, cv::Mat& mat);
@@ -55,6 +57,7 @@ void vector_vector_KeyPoint_to_Mat(std::vector< std::vector< cv::KeyPoint > >& v
void Mat_to_vector_vector_DMatch(cv::Mat& mat, std::vector< std::vector< cv::DMatch > >& vv_dm);
void vector_vector_DMatch_to_Mat(std::vector< std::vector< cv::DMatch > >& vv_dm, cv::Mat& mat);
#endif
void Mat_to_vector_vector_char(cv::Mat& mat, std::vector< std::vector< char > >& vv_ch);
void vector_vector_char_to_Mat(std::vector< std::vector< char > >& vv_ch, cv::Mat& mat);

View File

@@ -1,6 +1,9 @@
#ifndef __OPENCV_FEATURES_2D_MANUAL_HPP__
#define __OPENCV_FEATURES_2D_MANUAL_HPP__
#include "opencv2/opencv_modules.hpp"
#ifdef HAVE_OPENCV_FEATURES2D
#include "opencv2/features2d/features2d.hpp"
namespace cv
@@ -10,6 +13,7 @@ class CV_EXPORTS_AS(FeatureDetector) javaFeatureDetector : public FeatureDetecto
{
public:
#if 0
//DO NOT REMOVE! The block is required for sources parser
CV_WRAP void detect( const Mat& image, CV_OUT vector<KeyPoint>& keypoints, const Mat& mask=Mat() ) const;
CV_WRAP void detect( const vector<Mat>& images, CV_OUT vector<vector<KeyPoint> >& keypoints, const vector<Mat>& masks=vector<Mat>() ) const;
CV_WRAP virtual bool empty() const;
@@ -152,6 +156,7 @@ class CV_EXPORTS_AS(DescriptorMatcher) javaDescriptorMatcher : public Descriptor
{
public:
#if 0
//DO NOT REMOVE! The block is required for sources parser
CV_WRAP virtual bool isMaskSupported() const;
CV_WRAP virtual void add( const vector<Mat>& descriptors );
CV_WRAP const vector<Mat>& getTrainDescriptors() const;
@@ -245,6 +250,7 @@ class CV_EXPORTS_AS(DescriptorExtractor) javaDescriptorExtractor : public Descri
{
public:
#if 0
//DO NOT REMOVE! The block is required for sources parser
CV_WRAP void compute( const Mat& image, vector<KeyPoint>& keypoints, Mat& descriptors ) const;
CV_WRAP void compute( const vector<Mat>& images, vector<vector<KeyPoint> >& keypoints, CV_OUT vector<Mat>& descriptors ) const;
CV_WRAP virtual int descriptorSize() const;
@@ -326,6 +332,7 @@ class CV_EXPORTS_AS(GenericDescriptorMatcher) javaGenericDescriptorMatcher : pub
{
public:
#if 0
//DO NOT REMOVE! The block is required for sources parser
CV_WRAP virtual void add( const vector<Mat>& images,
vector<vector<KeyPoint> >& keypoints );
CV_WRAP const vector<Mat>& getTrainImages() const;
@@ -411,6 +418,7 @@ public:
};
#if 0
//DO NOT REMOVE! The block is required for sources parser
enum
{
DRAW_OVER_OUTIMG = 1, // Output image matrix will not be created (Mat::create).
@@ -441,4 +449,6 @@ CV_EXPORTS_AS(drawMatches2) void drawMatches( const Mat& img1, const vector<KeyP
} //cv
#endif // HAVE_OPENCV_FEATURES2D
#endif // __OPENCV_FEATURES_2D_MANUAL_HPP__