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:
@@ -583,7 +583,7 @@ namespace cv
|
||||
virtual ~StereoVar();
|
||||
|
||||
//! the stereo correspondence operator that computes disparity map for the specified rectified stereo pair
|
||||
CV_WRAP_AS(compute) virtual void operator()(const Mat& left, const Mat& right, Mat& disp);
|
||||
CV_WRAP_AS(compute) virtual void operator()(const Mat& left, const Mat& right, CV_OUT Mat& disp);
|
||||
|
||||
CV_PROP_RW int levels;
|
||||
CV_PROP_RW double pyrScale;
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#if defined(__linux__) || defined(LINUX) || defined(__APPLE__) || defined(ANDROID)
|
||||
#include "opencv2/contrib/detection_based_tracker.hpp"
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
#if defined(DEBUG) || defined(_DEBUG)
|
||||
#undef DEBUGLOGS
|
||||
#define DEBUGLOGS 1
|
||||
@@ -12,7 +14,6 @@
|
||||
|
||||
#ifdef ANDROID
|
||||
#include <android/log.h>
|
||||
#include <pthread.h>
|
||||
#define LOG_TAG "OBJECT_DETECTOR"
|
||||
#define LOGD0(...) ((void)__android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__))
|
||||
#define LOGI0(...) ((void)__android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__))
|
||||
|
||||
@@ -204,11 +204,11 @@ CV_EXPORTS ErrorCallback redirectError( ErrorCallback errCallback,
|
||||
#ifdef __GNUC__
|
||||
#define CV_Error( code, msg ) cv::error( cv::Exception(code, msg, __func__, __FILE__, __LINE__) )
|
||||
#define CV_Error_( code, args ) cv::error( cv::Exception(code, cv::format args, __func__, __FILE__, __LINE__) )
|
||||
#define CV_Assert( expr ) if((expr)) ; else cv::error( cv::Exception(CV_StsAssert, #expr, __func__, __FILE__, __LINE__) )
|
||||
#define CV_Assert( expr ) if(!!(expr)) ; else cv::error( cv::Exception(CV_StsAssert, #expr, __func__, __FILE__, __LINE__) )
|
||||
#else
|
||||
#define CV_Error( code, msg ) cv::error( cv::Exception(code, msg, "", __FILE__, __LINE__) )
|
||||
#define CV_Error_( code, args ) cv::error( cv::Exception(code, cv::format args, "", __FILE__, __LINE__) )
|
||||
#define CV_Assert( expr ) if((expr)) ; else cv::error( cv::Exception(CV_StsAssert, #expr, "", __FILE__, __LINE__) )
|
||||
#define CV_Assert( expr ) if(!!(expr)) ; else cv::error( cv::Exception(CV_StsAssert, #expr, "", __FILE__, __LINE__) )
|
||||
#endif
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
#define CV_XADD(addr,delta) _InterlockedExchangeAdd(const_cast<void*>(reinterpret_cast<volatile void*>(addr)), delta)
|
||||
#elif defined __GNUC__
|
||||
|
||||
#if defined __clang__ && __clang_major__ >= 3
|
||||
#if defined __clang__ && __clang_major__ >= 3 && !defined __ANDROID__
|
||||
#ifdef __ATOMIC_SEQ_CST
|
||||
#define CV_XADD(addr, delta) __c11_atomic_fetch_add((_Atomic(int)*)(addr), (delta), __ATOMIC_SEQ_CST)
|
||||
#else
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user