merged the trunk r8704:8716

This commit is contained in:
Marina Kolpakova
2012-06-28 16:13:29 +00:00
parent 2777ebb8a0
commit 680a44189c
83 changed files with 2402 additions and 2052 deletions

View File

@@ -162,8 +162,6 @@ else()
endif()
add_dependencies(${the_module} ${api_target})
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wmissing-declarations)
# Additional target properties
set_target_properties(${the_module} PROPERTIES
OUTPUT_NAME "${the_module}"

View File

@@ -569,12 +569,27 @@ public class MatTest extends OpenCVTestCase {
}
public void testMatMatRect() {
dst = new Mat(gray255_32f, new Rect(2, 2, 7, 7));
Mat m = new Mat(7, 6, CvType.CV_32SC1);
m.put(0, 0,
0, 1, 2, 3, 4, 5,
10, 11, 12, 13, 14, 15,
20, 21, 22, 23, 24, 25,
30, 31, 32, 33, 34, 35,
40, 41, 42, 43, 44, 45,
50, 51, 52, 53, 54, 55,
60, 61, 62, 63, 64, 65 );
truth = new Mat(7, 7, CvType.CV_32FC1, new Scalar(255));
dst = new Mat(m, new Rect(1, 2, 3, 4));
truth = new Mat(4, 3, CvType.CV_32SC1);
truth.put(0, 0,
21, 22, 23,
31, 32, 33,
41, 42, 43,
51, 52, 53 );
assertFalse(dst.empty());
assertMatEqual(truth, dst, EPS);
assertMatEqual(truth, dst);
}
public void testMatSizeInt() {

View File

@@ -11,10 +11,6 @@ class_ignore_list = (
"FileNode", "FileStorage", "KDTree",
#highgui
"VideoWriter", "VideoCapture",
#features2d
#"KeyPoint", "MSER", "StarDetector", "SURF", "DMatch",
#ml
#"EM",
)
const_ignore_list = (
@@ -364,9 +360,10 @@ ManualFuncs = {
'cpp_code' :
"""
// C++: minMaxLoc(Mat src, double* minVal, double* maxVal=0, Point* minLoc=0, Point* maxLoc=0, InputArray mask=noArray())
JNIEXPORT jdoubleArray JNICALL Java_org_opencv_core_Core_n_1minMaxLocManual (JNIEnv*, jclass, jlong, jlong);
JNIEXPORT jdoubleArray JNICALL Java_org_opencv_core_Core_n_1minMaxLocManual
(JNIEnv* env, jclass cls, jlong src_nativeObj, jlong mask_nativeObj)
(JNIEnv* env, jclass, jlong src_nativeObj, jlong mask_nativeObj)
{
try {
LOGD("Core::n_1minMaxLoc()");
@@ -434,9 +431,10 @@ JNIEXPORT jdoubleArray JNICALL Java_org_opencv_core_Core_n_1minMaxLocManual
'cpp_code' :
"""
// C++: Size getTextSize(const string& text, int fontFace, double fontScale, int thickness, int* baseLine);
JNIEXPORT jdoubleArray JNICALL Java_org_opencv_core_Core_n_1getTextSize (JNIEnv*, jclass, jstring, jint, jdouble, jint, jintArray);
JNIEXPORT jdoubleArray JNICALL Java_org_opencv_core_Core_n_1getTextSize
(JNIEnv* env, jclass cls, jstring text, jint fontFace, jdouble fontScale, jint thickness, jintArray baseLine)
(JNIEnv* env, jclass, jstring text, jint fontFace, jdouble fontScale, jint thickness, jintArray baseLine)
{
try {
LOGD("Core::n_1getTextSize()");
@@ -1014,7 +1012,7 @@ extern "C" {
# java native method args
jn_args = []
# jni (cpp) function args
jni_args = [ArgInfo([ "env", "env", "", [], "" ]), ArgInfo([ "cls", "cls", "", [], "" ])]
jni_args = [ArgInfo([ "env", "env", "", [], "" ]), ArgInfo([ "cls", "", "", [], "" ])]
j_prologue = []
j_epilogue = []
c_prologue = []
@@ -1252,6 +1250,7 @@ extern "C" {
clazz = self.classes[fi.classname].jname
cpp_code.write ( Template( \
"""
JNIEXPORT $rtype JNICALL Java_org_opencv_${module}_${clazz}_$fname ($argst);
JNIEXPORT $rtype JNICALL Java_org_opencv_${module}_${clazz}_$fname
($args)
@@ -1282,7 +1281,8 @@ JNIEXPORT $rtype JNICALL Java_org_opencv_${module}_${clazz}_$fname
module = self.module, \
clazz = clazz.replace('_', '_1'), \
fname = (fi.jname + '_' + str(suffix_counter)).replace('_', '_1'), \
args = ", ".join(["%s %s" % (type_dict[a.ctype].get("jni_type"), a.name) for a in jni_args]), \
args = ", ".join(["%s %s" % (type_dict[a.ctype].get("jni_type"), a.name) for a in jni_args]), \
argst = ", ".join([type_dict[a.ctype].get("jni_type") for a in jni_args]), \
prologue = "\n ".join(c_prologue), \
epilogue = " ".join(c_epilogue), \
ret = ret, \
@@ -1374,14 +1374,15 @@ JNIEXPORT $rtype JNICALL Java_org_opencv_${module}_${clazz}_$fname
// native support for java finalize()
// static void %(cls)s::delete( __int64 self )
//
JNIEXPORT void JNICALL Java_org_opencv_%(module)s_%(j_cls)s_delete(JNIEnv*, jclass, jlong);
JNIEXPORT void JNICALL Java_org_opencv_%(module)s_%(j_cls)s_delete
(JNIEnv* env, jclass cls, jlong self)
(JNIEnv*, jclass, jlong self)
{
delete (%(cls)s*) self;
}
""" % {"module" : module, "cls" : name, "j_cls" : ci.jname}
""" % {"module" : module, "cls" : name, "j_cls" : ci.jname.replace('_', '_1')}
)

File diff suppressed because it is too large Load Diff

View File

@@ -20,17 +20,19 @@ extern "C" {
// VideoCapture::VideoCapture()
//
JNIEXPORT jlong JNICALL Java_org_opencv_highgui_VideoCapture_n_1VideoCapture__
(JNIEnv* env, jclass);
JNIEXPORT jlong JNICALL Java_org_opencv_highgui_VideoCapture_n_1VideoCapture__
(JNIEnv* env, jclass cls)
(JNIEnv* env, jclass)
{
try {
#ifdef DEBUG
LOGD("highgui::VideoCapture_n_1VideoCapture__()");
#endif // DEBUG
VideoCapture* _retval_ = new VideoCapture( );
return (jlong) _retval_;
} catch(cv::Exception e) {
#ifdef DEBUG
@@ -55,17 +57,19 @@ JNIEXPORT jlong JNICALL Java_org_opencv_highgui_VideoCapture_n_1VideoCapture__
// VideoCapture::VideoCapture(int device)
//
JNIEXPORT jlong JNICALL Java_org_opencv_highgui_VideoCapture_n_1VideoCapture__I
(JNIEnv* env, jclass, jint device);
JNIEXPORT jlong JNICALL Java_org_opencv_highgui_VideoCapture_n_1VideoCapture__I
(JNIEnv* env, jclass cls, jint device)
(JNIEnv* env, jclass, jint device)
{
try {
#ifdef DEBUG
LOGD("highgui::VideoCapture_n_1VideoCapture__I()");
#endif // DEBUG
VideoCapture* _retval_ = new VideoCapture( device );
return (jlong) _retval_;
} catch(cv::Exception e) {
#ifdef DEBUG
@@ -91,9 +95,11 @@ JNIEXPORT jlong JNICALL Java_org_opencv_highgui_VideoCapture_n_1VideoCapture__I
// double VideoCapture::get(int propId)
//
JNIEXPORT jdouble JNICALL Java_org_opencv_highgui_VideoCapture_n_1get
(JNIEnv* env, jclass, jlong self, jint propId);
JNIEXPORT jdouble JNICALL Java_org_opencv_highgui_VideoCapture_n_1get
(JNIEnv* env, jclass cls, jlong self, jint propId)
(JNIEnv* env, jclass, jlong self, jint propId)
{
try {
#ifdef DEBUG
@@ -101,7 +107,7 @@ JNIEXPORT jdouble JNICALL Java_org_opencv_highgui_VideoCapture_n_1get
#endif // DEBUG
VideoCapture* me = (VideoCapture*) self; //TODO: check for NULL
double _retval_ = me->get( propId );
return _retval_;
} catch(cv::Exception e) {
#ifdef DEBUG
@@ -127,9 +133,11 @@ JNIEXPORT jdouble JNICALL Java_org_opencv_highgui_VideoCapture_n_1get
// bool VideoCapture::grab()
//
JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1grab
(JNIEnv* env, jclass, jlong self);
JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1grab
(JNIEnv* env, jclass cls, jlong self)
(JNIEnv* env, jclass, jlong self)
{
try {
#ifdef DEBUG
@@ -137,7 +145,7 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1grab
#endif // DEBUG
VideoCapture* me = (VideoCapture*) self; //TODO: check for NULL
bool _retval_ = me->grab( );
return _retval_;
} catch(cv::Exception e) {
#ifdef DEBUG
@@ -163,9 +171,11 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1grab
// bool VideoCapture::isOpened()
//
JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1isOpened
(JNIEnv* env, jclass, jlong self);
JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1isOpened
(JNIEnv* env, jclass cls, jlong self)
(JNIEnv* env, jclass, jlong self)
{
try {
#ifdef DEBUG
@@ -173,7 +183,7 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1isOpened
#endif // DEBUG
VideoCapture* me = (VideoCapture*) self; //TODO: check for NULL
bool _retval_ = me->isOpened( );
return _retval_;
} catch(cv::Exception e) {
#ifdef DEBUG
@@ -198,9 +208,11 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1isOpened
// bool VideoCapture::open(int device)
//
JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1open__JI
(JNIEnv* env, jclass, jlong self, jint device);
JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1open__JI
(JNIEnv* env, jclass cls, jlong self, jint device)
(JNIEnv* env, jclass, jlong self, jint device)
{
try {
#ifdef DEBUG
@@ -208,7 +220,7 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1open__JI
#endif // DEBUG
VideoCapture* me = (VideoCapture*) self; //TODO: check for NULL
bool _retval_ = me->open( device );
return _retval_;
} catch(cv::Exception e) {
#ifdef DEBUG
@@ -234,9 +246,11 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1open__JI
// bool VideoCapture::read(Mat image)
//
JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1read
(JNIEnv* env, jclass, jlong self, jlong image_nativeObj);
JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1read
(JNIEnv* env, jclass cls, jlong self, jlong image_nativeObj)
(JNIEnv* env, jclass, jlong self, jlong image_nativeObj)
{
try {
#ifdef DEBUG
@@ -245,7 +259,7 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1read
VideoCapture* me = (VideoCapture*) self; //TODO: check for NULL
Mat& image = *((Mat*)image_nativeObj);
bool _retval_ = me->read( image );
return _retval_;
} catch(cv::Exception e) {
#ifdef DEBUG
@@ -271,9 +285,11 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1read
// void VideoCapture::release()
//
JNIEXPORT void JNICALL Java_org_opencv_highgui_VideoCapture_n_1release
(JNIEnv* env, jclass, jlong self);
JNIEXPORT void JNICALL Java_org_opencv_highgui_VideoCapture_n_1release
(JNIEnv* env, jclass cls, jlong self)
(JNIEnv* env, jclass, jlong self)
{
try {
#ifdef DEBUG
@@ -281,7 +297,7 @@ JNIEXPORT void JNICALL Java_org_opencv_highgui_VideoCapture_n_1release
#endif // DEBUG
VideoCapture* me = (VideoCapture*) self; //TODO: check for NULL
me->release( );
return;
} catch(cv::Exception e) {
#ifdef DEBUG
@@ -307,9 +323,11 @@ JNIEXPORT void JNICALL Java_org_opencv_highgui_VideoCapture_n_1release
// bool VideoCapture::retrieve(Mat image, int channel = 0)
//
JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1retrieve__JJI
(JNIEnv* env, jclass, jlong self, jlong image_nativeObj, jint channel);
JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1retrieve__JJI
(JNIEnv* env, jclass cls, jlong self, jlong image_nativeObj, jint channel)
(JNIEnv* env, jclass, jlong self, jlong image_nativeObj, jint channel)
{
try {
#ifdef DEBUG
@@ -318,7 +336,7 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1retrieve__JJI
VideoCapture* me = (VideoCapture*) self; //TODO: check for NULL
Mat& image = *((Mat*)image_nativeObj);
bool _retval_ = me->retrieve( image, channel );
return _retval_;
} catch(cv::Exception e) {
#ifdef DEBUG
@@ -340,9 +358,11 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1retrieve__JJI
JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1retrieve__JJ
(JNIEnv* env, jclass, jlong self, jlong image_nativeObj);
JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1retrieve__JJ
(JNIEnv* env, jclass cls, jlong self, jlong image_nativeObj)
(JNIEnv* env, jclass, jlong self, jlong image_nativeObj)
{
try {
#ifdef DEBUG
@@ -351,7 +371,7 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1retrieve__JJ
VideoCapture* me = (VideoCapture*) self; //TODO: check for NULL
Mat& image = *((Mat*)image_nativeObj);
bool _retval_ = me->retrieve( image );
return _retval_;
} catch(cv::Exception e) {
#ifdef DEBUG
@@ -377,9 +397,11 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1retrieve__JJ
// bool VideoCapture::set(int propId, double value)
//
JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1set
(JNIEnv* env, jclass, jlong self, jint propId, jdouble value);
JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1set
(JNIEnv* env, jclass cls, jlong self, jint propId, jdouble value)
(JNIEnv* env, jclass, jlong self, jint propId, jdouble value)
{
try {
#ifdef DEBUG
@@ -387,7 +409,7 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1set
#endif // DEBUG
VideoCapture* me = (VideoCapture*) self; //TODO: check for NULL
bool _retval_ = me->set( propId, value );
return _retval_;
} catch(cv::Exception e) {
#ifdef DEBUG
@@ -408,14 +430,17 @@ JNIEXPORT jboolean JNICALL Java_org_opencv_highgui_VideoCapture_n_1set
}
JNIEXPORT jstring JNICALL Java_org_opencv_highgui_VideoCapture_n_1getSupportedPreviewSizes
(JNIEnv *env, jclass cls, jlong self)
(JNIEnv *env, jclass, jlong self);
JNIEXPORT jstring JNICALL Java_org_opencv_highgui_VideoCapture_n_1getSupportedPreviewSizes
(JNIEnv *env, jclass, jlong self)
{
try {
#ifdef DEBUG
LOGD("highgui::VideoCapture_n_1set()");
#endif // DEBUG
VideoCapture* me = (VideoCapture*) self; //TODO: check for NULL
union {double prop; const char* name;} u;
union {double prop; const char* name;} u;
u.prop = me->get(CV_CAP_PROP_SUPPORTED_PREVIEW_SIZES_STRING);
return env->NewStringUTF(u.name);
} catch(cv::Exception e) {
@@ -444,7 +469,10 @@ JNIEXPORT jstring JNICALL Java_org_opencv_highgui_VideoCapture_n_1getSupportedPr
//
JNIEXPORT void JNICALL Java_org_opencv_highgui_VideoCapture_n_1delete
(JNIEnv* env, jclass cls, jlong self)
(JNIEnv*, jclass, jlong self);
JNIEXPORT void JNICALL Java_org_opencv_highgui_VideoCapture_n_1delete
(JNIEnv*, jclass, jlong self)
{
delete (VideoCapture*) self;
}

View File

@@ -21,7 +21,7 @@
extern "C" {
JNIEXPORT jint JNICALL
JNI_OnLoad(JavaVM* vm, void* reserved)
JNI_OnLoad(JavaVM* vm, void* )
{
JNIEnv* env;
if (vm->GetEnv((void**) &env, JNI_VERSION_1_6) != JNI_OK)
@@ -51,7 +51,7 @@ JNI_OnLoad(JavaVM* vm, void* reserved)
}
JNIEXPORT void JNICALL
JNI_OnUnload(JavaVM *vm, void *reserved)
JNI_OnUnload(JavaVM*, void*)
{
//do nothing
}

View File

@@ -25,7 +25,10 @@ extern "C" {
*/
JNIEXPORT void JNICALL Java_org_opencv_android_Utils_nBitmapToMat
(JNIEnv * env, jclass cls, jobject bitmap, jlong m_addr)
(JNIEnv * env, jclass, jobject bitmap, jlong m_addr);
JNIEXPORT void JNICALL Java_org_opencv_android_Utils_nBitmapToMat
(JNIEnv * env, jclass, jobject bitmap, jlong m_addr)
{
AndroidBitmapInfo info;
void* pixels = 0;
@@ -73,7 +76,10 @@ JNIEXPORT void JNICALL Java_org_opencv_android_Utils_nBitmapToMat
* Method: void nMatToBitmap(long m_addr, Bitmap b)
*/
JNIEXPORT void JNICALL Java_org_opencv_android_Utils_nMatToBitmap
(JNIEnv * env, jclass cls, jlong m_addr, jobject bitmap)
(JNIEnv * env, jclass, jlong m_addr, jobject bitmap);
JNIEXPORT void JNICALL Java_org_opencv_android_Utils_nMatToBitmap
(JNIEnv * env, jclass, jlong m_addr, jobject bitmap)
{
AndroidBitmapInfo info;
void* pixels = 0;

View File

@@ -108,7 +108,7 @@ public class Mat {
public Mat(Mat m, Rect roi)
{
nativeObj = n_Mat(m.nativeObj, roi.x, roi.x + roi.width, roi.y, roi.y + roi.height);
nativeObj = n_Mat(m.nativeObj, roi.y, roi.y + roi.height, roi.x, roi.x + roi.width);
return;
}