Merge branch 2.4

Conflicts:
	android/service/engine/AndroidManifest.xml - use file from 2.4
	modules/contrib/src/detection_based_tracker.cpp - move #include <pthread.h> as in 2.4
	modules/java/android_test/src/org/opencv/test/OpenCVTestRunner.java - use file from 2.4
This commit is contained in:
Andrey Kamaev
2012-11-20 19:12:00 +04:00
39 changed files with 462 additions and 249 deletions

View File

@@ -1,5 +0,0 @@
#Wed Jun 29 04:36:40 MSD 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.source=1.5

View File

@@ -1,5 +1,4 @@
#Wed Jun 29 04:36:40 MSD 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.source=1.5
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.source=1.6

View File

@@ -4,6 +4,9 @@ import java.io.File;
import java.io.IOException;
import junit.framework.Assert;
import org.opencv.android.BaseLoaderCallback;
import org.opencv.android.LoaderCallbackInterface;
import org.opencv.android.OpenCVLoader;
import org.opencv.android.Utils;
import org.opencv.core.Mat;
@@ -20,8 +23,7 @@ import android.util.Log;
public class OpenCVTestRunner extends InstrumentationTestRunner {
static { System.loadLibrary("opencv_java"); }
private static final long MANAGER_TIMEOUT = 3000;
public static String LENA_PATH;
public static String CHESS_PATH;
public static String LBPCASCADE_FRONTALFACE_PATH;
@@ -30,6 +32,26 @@ public class OpenCVTestRunner extends InstrumentationTestRunner {
private AndroidTestRunner androidTestRunner;
private static String TAG = "opencv_test_java";
private BaseLoaderCallback mLoaderCallback = new BaseLoaderCallback(getContext()) {
@Override
public void onManagerConnected(int status) {
switch (status) {
case LoaderCallbackInterface.SUCCESS:
{
Log("OpenCV loaded successfully");
synchronized (this) {
notify();
}
} break;
default:
{
super.onManagerConnected(status);
} break;
}
}
};
public static String getTempFileName(String extension)
{
File cache = context.getCacheDir();
@@ -56,6 +78,25 @@ public class OpenCVTestRunner extends InstrumentationTestRunner {
@Override
public void onStart() {
// try to load internal libs
if (!OpenCVLoader.initDebug()) {
// There is no internal OpenCV libs
// Using OpenCV Manager for initialization;
Log("Internal OpenCV library not found. Using OpenCV Manager for initialization");
OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_3, getContext(), mLoaderCallback);
synchronized (this) {
try {
wait(MANAGER_TIMEOUT);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
} else {
Log("OpenCV library found inside test package. Using it!");
}
context = getContext();
Assert.assertTrue("Context can't be 'null'", context != null);
LENA_PATH = Utils.exportResource(context, R.drawable.lena);
@@ -69,8 +110,6 @@ public class OpenCVTestRunner extends InstrumentationTestRunner {
//List<TestCase> testCases = androidTestRunner.getTestCases();
//Collections.shuffle(testCases); //shuffle the tests order
// Note: VideoCapture tests turned off by flag field in VideoCaptureTest class
super.onStart();
}