Merged upstream master

This commit is contained in:
Hilton Bristow
2014-03-04 11:14:03 +10:00
808 changed files with 31931 additions and 96605 deletions

View File

@@ -18,6 +18,8 @@ class_ignore_list = (
const_ignore_list = (
"CV_CAP_OPENNI",
"CV_CAP_PROP_OPENNI_",
"CV_CAP_INTELPERC",
"CV_CAP_PROP_INTELPERC_"
"WINDOW_AUTOSIZE",
"CV_WND_PROP_",
"CV_WINDOW_",
@@ -396,7 +398,7 @@ JNIEXPORT jdoubleArray JNICALL Java_org_opencv_core_Core_n_1minMaxLocManual
return result;
} catch(cv::Exception e) {
} catch(const cv::Exception& e) {
LOGD("Core::n_1minMaxLoc() catched cv::Exception: %s", e.what());
jclass je = env->FindClass("org/opencv/core/CvException");
if(!je) je = env->FindClass("java/lang/Exception");
@@ -469,7 +471,7 @@ JNIEXPORT jdoubleArray JNICALL Java_org_opencv_core_Core_n_1getTextSize
return result;
} catch(cv::Exception e) {
} catch(const cv::Exception& e) {
LOGD("Core::n_1getTextSize() catched cv::Exception: %s", e.what());
jclass je = env->FindClass("org/opencv/core/CvException");
if(!je) je = env->FindClass("java/lang/Exception");

View File

@@ -2,8 +2,7 @@
from __future__ import print_function
import os, sys, re, string, fnmatch
allmodules = ["core", "flann", "imgproc", "ml", "highgui", "video", "features2d", "calib3d", "objdetect", "legacy", "contrib", "cuda", "androidcamera", "java", "python", "stitching", "ts", "photo", "nonfree", "videostab", "ocl", "softcascade", "superres"]
allmodules = ["core", "flann", "imgproc", "ml", "highgui", "video", "features2d", "calib3d", "objdetect", "legacy", "contrib", "cuda", "androidcamera", "java", "python", "stitching", "ts", "photo", "nonfree", "videostab", "softcascade", "superres"]
verbose = False
show_warnings = True
show_errors = True

View File

@@ -467,7 +467,7 @@ JNIEXPORT jint JNICALL Java_org_opencv_core_Mat_n_1dims
LOGD("%s", method_name);
Mat* me = (Mat*) self; //TODO: check for NULL
return me->dims;
} catch(cv::Exception e) {
} catch(const cv::Exception& e) {
throwJavaException(env, &e, method_name);
} catch (...) {
throwJavaException(env, 0, method_name);

View File

@@ -48,7 +48,7 @@ JNIEXPORT void JNICALL Java_org_opencv_android_Utils_nBitmapToMat2
}
AndroidBitmap_unlockPixels(env, bitmap);
return;
} catch(cv::Exception e) {
} catch(const cv::Exception& e) {
AndroidBitmap_unlockPixels(env, bitmap);
LOGE("nBitmapToMat catched cv::Exception: %s", e.what());
jclass je = env->FindClass("org/opencv/core/CvException");
@@ -130,7 +130,7 @@ JNIEXPORT void JNICALL Java_org_opencv_android_Utils_nMatToBitmap2
}
AndroidBitmap_unlockPixels(env, bitmap);
return;
} catch(cv::Exception e) {
} catch(const cv::Exception& e) {
AndroidBitmap_unlockPixels(env, bitmap);
LOGE("nMatToBitmap catched cv::Exception: %s", e.what());
jclass je = env->FindClass("org/opencv/core/CvException");

View File

@@ -22,6 +22,7 @@ public class NativeCameraView extends CameraBridgeViewBase {
private Thread mThread;
protected VideoCapture mCamera;
protected NativeCameraFrame mFrame;
public NativeCameraView(Context context, int cameraId) {
super(context, cameraId);
@@ -97,6 +98,8 @@ public class NativeCameraView extends CameraBridgeViewBase {
if (mCamera.isOpened() == false)
return false;
mFrame = new NativeCameraFrame(mCamera);
java.util.List<Size> sizes = mCamera.getSupportedPreviewSizes();
/* Select the size that fits surface considering maximum size allowed */
@@ -127,9 +130,8 @@ public class NativeCameraView extends CameraBridgeViewBase {
private void releaseCamera() {
synchronized (this) {
if (mCamera != null) {
mCamera.release();
}
if (mFrame != null) mFrame.release();
if (mCamera != null) mCamera.release();
}
}
@@ -153,6 +155,11 @@ public class NativeCameraView extends CameraBridgeViewBase {
mRgba = new Mat();
}
public void release() {
if (mGray != null) mGray.release();
if (mRgba != null) mRgba.release();
}
private VideoCapture mCapture;
private Mat mRgba;
private Mat mGray;
@@ -167,7 +174,7 @@ public class NativeCameraView extends CameraBridgeViewBase {
break;
}
deliverAndDrawFrame(new NativeCameraFrame(mCamera));
deliverAndDrawFrame(mFrame);
} while (!mStopThread);
}

View File

@@ -37,6 +37,10 @@ public class OpenCVLoader
*/
public static final String OPENCV_VERSION_2_4_7 = "2.4.7";
/**
* OpenCV Library version 2.4.8.
*/
public static final String OPENCV_VERSION_2_4_8 = "2.4.8";
/**
* Loads and initializes OpenCV library from current application package. Roughly, it's an analog of system.loadLibrary("opencv_java").
@@ -44,7 +48,17 @@ public class OpenCVLoader
*/
public static boolean initDebug()
{
return StaticHelper.initOpenCV();
return StaticHelper.initOpenCV(false);
}
/**
* Loads and initializes OpenCV library from current application package. Roughly, it's an analog of system.loadLibrary("opencv_java").
* @param InitCuda load and initialize CUDA runtime libraries.
* @return Returns true is initialization of OpenCV was successful.
*/
public static boolean initDebug(boolean InitCuda)
{
return StaticHelper.initOpenCV(InitCuda);
}
/**

View File

@@ -7,11 +7,21 @@ import android.util.Log;
class StaticHelper {
public static boolean initOpenCV()
public static boolean initOpenCV(boolean InitCuda)
{
boolean result;
String libs = "";
if(InitCuda)
{
loadLibrary("cudart");
loadLibrary("nppc");
loadLibrary("nppi");
loadLibrary("npps");
loadLibrary("cufft");
loadLibrary("cublas");
}
Log.d(TAG, "Trying to get library list");
try
@@ -52,7 +62,7 @@ class StaticHelper {
try
{
System.loadLibrary(Name);
Log.d(TAG, "OpenCV libs init was ok!");
Log.d(TAG, "Library " + Name + " loaded");
}
catch(UnsatisfiedLinkError e)
{

View File

@@ -87,7 +87,6 @@ public class TermCriteria {
@Override
public String toString() {
if (this == null) return "null";
return "{ type: " + type + ", maxCount: " + maxCount + ", epsilon: " + epsilon + "}";
}
}