mirror of https://github.com/opencv/opencv.git
parent
2c1ec4245d
commit
2830551e89
28 changed files with 153 additions and 1597 deletions
@ -1,391 +0,0 @@ |
||||
package org.opencv.android; |
||||
|
||||
import java.io.File; |
||||
import java.util.StringTokenizer; |
||||
|
||||
import org.opencv.core.Core; |
||||
import org.opencv.engine.OpenCVEngineInterface; |
||||
|
||||
import android.content.ComponentName; |
||||
import android.content.Context; |
||||
import android.content.Intent; |
||||
import android.content.ServiceConnection; |
||||
import android.net.Uri; |
||||
import android.os.IBinder; |
||||
import android.os.RemoteException; |
||||
import android.util.Log; |
||||
|
||||
class AsyncServiceHelper |
||||
{ |
||||
public static boolean initOpenCV(String Version, final Context AppContext, |
||||
final LoaderCallbackInterface Callback) |
||||
{ |
||||
AsyncServiceHelper helper = new AsyncServiceHelper(Version, AppContext, Callback); |
||||
Intent intent = new Intent("org.opencv.engine.BIND"); |
||||
intent.setPackage("org.opencv.engine"); |
||||
if (AppContext.bindService(intent, helper.mServiceConnection, Context.BIND_AUTO_CREATE)) |
||||
{ |
||||
return true; |
||||
} |
||||
else |
||||
{ |
||||
AppContext.unbindService(helper.mServiceConnection); |
||||
InstallService(AppContext, Callback); |
||||
return false; |
||||
} |
||||
} |
||||
|
||||
protected AsyncServiceHelper(String Version, Context AppContext, LoaderCallbackInterface Callback) |
||||
{ |
||||
mOpenCVersion = Version; |
||||
mUserAppCallback = Callback; |
||||
mAppContext = AppContext; |
||||
} |
||||
|
||||
protected static final String TAG = "OpenCVManager/Helper"; |
||||
protected static final int MINIMUM_ENGINE_VERSION = 2; |
||||
protected OpenCVEngineInterface mEngineService; |
||||
protected LoaderCallbackInterface mUserAppCallback; |
||||
protected String mOpenCVersion; |
||||
protected Context mAppContext; |
||||
protected static boolean mServiceInstallationProgress = false; |
||||
protected static boolean mLibraryInstallationProgress = false; |
||||
|
||||
protected static boolean InstallServiceQuiet(Context context) |
||||
{ |
||||
boolean result = true; |
||||
try |
||||
{ |
||||
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(OPEN_CV_SERVICE_URL)); |
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); |
||||
context.startActivity(intent); |
||||
} |
||||
catch(Exception e) |
||||
{ |
||||
result = false; |
||||
} |
||||
|
||||
return result; |
||||
} |
||||
|
||||
protected static void InstallService(final Context AppContext, final LoaderCallbackInterface Callback) |
||||
{ |
||||
if (!mServiceInstallationProgress) |
||||
{ |
||||
Log.d(TAG, "Request new service installation"); |
||||
InstallCallbackInterface InstallQuery = new InstallCallbackInterface() { |
||||
private LoaderCallbackInterface mUserAppCallback = Callback; |
||||
public String getPackageName() |
||||
{ |
||||
return "OpenCV Manager"; |
||||
} |
||||
public void install() { |
||||
Log.d(TAG, "Trying to install OpenCV Manager via Google Play"); |
||||
|
||||
boolean result = InstallServiceQuiet(AppContext); |
||||
if (result) |
||||
{ |
||||
mServiceInstallationProgress = true; |
||||
Log.d(TAG, "Package installation started"); |
||||
} |
||||
else |
||||
{ |
||||
Log.d(TAG, "OpenCV package was not installed!"); |
||||
int Status = LoaderCallbackInterface.MARKET_ERROR; |
||||
Log.d(TAG, "Init finished with status " + Status); |
||||
Log.d(TAG, "Unbind from service"); |
||||
Log.d(TAG, "Calling using callback"); |
||||
mUserAppCallback.onManagerConnected(Status); |
||||
} |
||||
} |
||||
|
||||
public void cancel() |
||||
{ |
||||
Log.d(TAG, "OpenCV library installation was canceled"); |
||||
int Status = LoaderCallbackInterface.INSTALL_CANCELED; |
||||
Log.d(TAG, "Init finished with status " + Status); |
||||
Log.d(TAG, "Calling using callback"); |
||||
mUserAppCallback.onManagerConnected(Status); |
||||
} |
||||
|
||||
public void wait_install() |
||||
{ |
||||
Log.e(TAG, "Installation was not started! Nothing to wait!"); |
||||
} |
||||
}; |
||||
|
||||
Callback.onPackageInstall(InstallCallbackInterface.NEW_INSTALLATION, InstallQuery); |
||||
} |
||||
else |
||||
{ |
||||
Log.d(TAG, "Waiting current installation process"); |
||||
InstallCallbackInterface WaitQuery = new InstallCallbackInterface() { |
||||
private LoaderCallbackInterface mUserAppCallback = Callback; |
||||
public String getPackageName() |
||||
{ |
||||
return "OpenCV Manager"; |
||||
} |
||||
public void install() |
||||
{ |
||||
Log.e(TAG, "Nothing to install we just wait current installation"); |
||||
} |
||||
public void cancel() |
||||
{ |
||||
Log.d(TAG, "Waiting for OpenCV canceled by user"); |
||||
mServiceInstallationProgress = false; |
||||
int Status = LoaderCallbackInterface.INSTALL_CANCELED; |
||||
Log.d(TAG, "Init finished with status " + Status); |
||||
Log.d(TAG, "Calling using callback"); |
||||
mUserAppCallback.onManagerConnected(Status); |
||||
} |
||||
public void wait_install() |
||||
{ |
||||
InstallServiceQuiet(AppContext); |
||||
} |
||||
}; |
||||
|
||||
Callback.onPackageInstall(InstallCallbackInterface.INSTALLATION_PROGRESS, WaitQuery); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* URL of OpenCV Manager page on Google Play Market. |
||||
*/ |
||||
protected static final String OPEN_CV_SERVICE_URL = "market://details?id=org.opencv.engine"; |
||||
|
||||
protected ServiceConnection mServiceConnection = new ServiceConnection() |
||||
{ |
||||
public void onServiceConnected(ComponentName className, IBinder service) |
||||
{ |
||||
Log.d(TAG, "Service connection created"); |
||||
mEngineService = OpenCVEngineInterface.Stub.asInterface(service); |
||||
if (null == mEngineService) |
||||
{ |
||||
Log.d(TAG, "OpenCV Manager Service connection fails. May be service was not installed?"); |
||||
InstallService(mAppContext, mUserAppCallback); |
||||
} |
||||
else |
||||
{ |
||||
mServiceInstallationProgress = false; |
||||
try |
||||
{ |
||||
if (mEngineService.getEngineVersion() < MINIMUM_ENGINE_VERSION) |
||||
{ |
||||
Log.d(TAG, "Init finished with status " + LoaderCallbackInterface.INCOMPATIBLE_MANAGER_VERSION); |
||||
Log.d(TAG, "Unbind from service"); |
||||
mAppContext.unbindService(mServiceConnection); |
||||
Log.d(TAG, "Calling using callback"); |
||||
mUserAppCallback.onManagerConnected(LoaderCallbackInterface.INCOMPATIBLE_MANAGER_VERSION); |
||||
return; |
||||
} |
||||
|
||||
Log.d(TAG, "Trying to get library path"); |
||||
String path = mEngineService.getLibPathByVersion(mOpenCVersion); |
||||
if ((null == path) || (path.length() == 0)) |
||||
{ |
||||
if (!mLibraryInstallationProgress) |
||||
{ |
||||
InstallCallbackInterface InstallQuery = new InstallCallbackInterface() { |
||||
public String getPackageName() |
||||
{ |
||||
return "OpenCV library"; |
||||
} |
||||
public void install() { |
||||
Log.d(TAG, "Trying to install OpenCV lib via Google Play"); |
||||
try |
||||
{ |
||||
if (mEngineService.installVersion(mOpenCVersion)) |
||||
{ |
||||
mLibraryInstallationProgress = true; |
||||
Log.d(TAG, "Package installation started"); |
||||
Log.d(TAG, "Unbind from service"); |
||||
mAppContext.unbindService(mServiceConnection); |
||||
} |
||||
else |
||||
{ |
||||
Log.d(TAG, "OpenCV package was not installed!"); |
||||
Log.d(TAG, "Init finished with status " + LoaderCallbackInterface.MARKET_ERROR); |
||||
Log.d(TAG, "Unbind from service"); |
||||
mAppContext.unbindService(mServiceConnection); |
||||
Log.d(TAG, "Calling using callback"); |
||||
mUserAppCallback.onManagerConnected(LoaderCallbackInterface.MARKET_ERROR); |
||||
} |
||||
} catch (RemoteException e) { |
||||
e.printStackTrace();; |
||||
Log.d(TAG, "Init finished with status " + LoaderCallbackInterface.INIT_FAILED); |
||||
Log.d(TAG, "Unbind from service"); |
||||
mAppContext.unbindService(mServiceConnection); |
||||
Log.d(TAG, "Calling using callback"); |
||||
mUserAppCallback.onManagerConnected(LoaderCallbackInterface.INIT_FAILED); |
||||
} |
||||
} |
||||
public void cancel() { |
||||
Log.d(TAG, "OpenCV library installation was canceled"); |
||||
Log.d(TAG, "Init finished with status " + LoaderCallbackInterface.INSTALL_CANCELED); |
||||
Log.d(TAG, "Unbind from service"); |
||||
mAppContext.unbindService(mServiceConnection); |
||||
Log.d(TAG, "Calling using callback"); |
||||
mUserAppCallback.onManagerConnected(LoaderCallbackInterface.INSTALL_CANCELED); |
||||
} |
||||
public void wait_install() { |
||||
Log.e(TAG, "Installation was not started! Nothing to wait!"); |
||||
} |
||||
}; |
||||
|
||||
mUserAppCallback.onPackageInstall(InstallCallbackInterface.NEW_INSTALLATION, InstallQuery); |
||||
} |
||||
else |
||||
{ |
||||
InstallCallbackInterface WaitQuery = new InstallCallbackInterface() { |
||||
public String getPackageName() |
||||
{ |
||||
return "OpenCV library"; |
||||
} |
||||
|
||||
public void install() { |
||||
Log.e(TAG, "Nothing to install we just wait current installation"); |
||||
} |
||||
public void cancel() |
||||
{ |
||||
Log.d(TAG, "OpenCV library installation was canceled"); |
||||
mLibraryInstallationProgress = false; |
||||
Log.d(TAG, "Init finished with status " + LoaderCallbackInterface.INSTALL_CANCELED); |
||||
Log.d(TAG, "Unbind from service"); |
||||
mAppContext.unbindService(mServiceConnection); |
||||
Log.d(TAG, "Calling using callback"); |
||||
mUserAppCallback.onManagerConnected(LoaderCallbackInterface.INSTALL_CANCELED); |
||||
} |
||||
public void wait_install() { |
||||
Log.d(TAG, "Waiting for current installation"); |
||||
try |
||||
{ |
||||
if (!mEngineService.installVersion(mOpenCVersion)) |
||||
{ |
||||
Log.d(TAG, "OpenCV package was not installed!"); |
||||
Log.d(TAG, "Init finished with status " + LoaderCallbackInterface.MARKET_ERROR); |
||||
Log.d(TAG, "Calling using callback"); |
||||
mUserAppCallback.onManagerConnected(LoaderCallbackInterface.MARKET_ERROR); |
||||
} |
||||
else |
||||
{ |
||||
Log.d(TAG, "Waiting for package installation"); |
||||
} |
||||
|
||||
Log.d(TAG, "Unbind from service"); |
||||
mAppContext.unbindService(mServiceConnection); |
||||
|
||||
} catch (RemoteException e) { |
||||
e.printStackTrace(); |
||||
Log.d(TAG, "Init finished with status " + LoaderCallbackInterface.INIT_FAILED); |
||||
Log.d(TAG, "Unbind from service"); |
||||
mAppContext.unbindService(mServiceConnection); |
||||
Log.d(TAG, "Calling using callback"); |
||||
mUserAppCallback.onManagerConnected(LoaderCallbackInterface.INIT_FAILED); |
||||
} |
||||
} |
||||
}; |
||||
|
||||
mUserAppCallback.onPackageInstall(InstallCallbackInterface.INSTALLATION_PROGRESS, WaitQuery); |
||||
} |
||||
return; |
||||
} |
||||
else |
||||
{ |
||||
Log.d(TAG, "Trying to get library list"); |
||||
mLibraryInstallationProgress = false; |
||||
String libs = mEngineService.getLibraryList(mOpenCVersion); |
||||
Log.d(TAG, "Library list: \"" + libs + "\""); |
||||
Log.d(TAG, "First attempt to load libs"); |
||||
int status; |
||||
if (initOpenCVLibs(path, libs)) |
||||
{ |
||||
Log.d(TAG, "First attempt to load libs is OK"); |
||||
String eol = System.getProperty("line.separator"); |
||||
for (String str : Core.getBuildInformation().split(eol)) |
||||
Log.i(TAG, str); |
||||
|
||||
status = LoaderCallbackInterface.SUCCESS; |
||||
} |
||||
else |
||||
{ |
||||
Log.d(TAG, "First attempt to load libs fails"); |
||||
status = LoaderCallbackInterface.INIT_FAILED; |
||||
} |
||||
|
||||
Log.d(TAG, "Init finished with status " + status); |
||||
Log.d(TAG, "Unbind from service"); |
||||
mAppContext.unbindService(mServiceConnection); |
||||
Log.d(TAG, "Calling using callback"); |
||||
mUserAppCallback.onManagerConnected(status); |
||||
} |
||||
} |
||||
catch (RemoteException e) |
||||
{ |
||||
e.printStackTrace(); |
||||
Log.d(TAG, "Init finished with status " + LoaderCallbackInterface.INIT_FAILED); |
||||
Log.d(TAG, "Unbind from service"); |
||||
mAppContext.unbindService(mServiceConnection); |
||||
Log.d(TAG, "Calling using callback"); |
||||
mUserAppCallback.onManagerConnected(LoaderCallbackInterface.INIT_FAILED); |
||||
} |
||||
} |
||||
} |
||||
|
||||
public void onServiceDisconnected(ComponentName className) |
||||
{ |
||||
mEngineService = null; |
||||
} |
||||
}; |
||||
|
||||
private boolean loadLibrary(String AbsPath) |
||||
{ |
||||
boolean result = true; |
||||
|
||||
Log.d(TAG, "Trying to load library " + AbsPath); |
||||
try |
||||
{ |
||||
System.load(AbsPath); |
||||
Log.d(TAG, "OpenCV libs init was ok!"); |
||||
} |
||||
catch(UnsatisfiedLinkError e) |
||||
{ |
||||
Log.d(TAG, "Cannot load library \"" + AbsPath + "\""); |
||||
e.printStackTrace(); |
||||
result = false; |
||||
} |
||||
|
||||
return result; |
||||
} |
||||
|
||||
private boolean initOpenCVLibs(String Path, String Libs) |
||||
{ |
||||
Log.d(TAG, "Trying to init OpenCV libs"); |
||||
if ((null != Path) && (Path.length() != 0)) |
||||
{ |
||||
boolean result = true; |
||||
if ((null != Libs) && (Libs.length() != 0)) |
||||
{ |
||||
Log.d(TAG, "Trying to load libs by dependency list"); |
||||
StringTokenizer splitter = new StringTokenizer(Libs, ";"); |
||||
while(splitter.hasMoreTokens()) |
||||
{ |
||||
String AbsLibraryPath = Path + File.separator + splitter.nextToken(); |
||||
result &= loadLibrary(AbsLibraryPath); |
||||
} |
||||
} |
||||
else |
||||
{ |
||||
// If the dependencies list is not defined or empty.
|
||||
String AbsLibraryPath = Path + File.separator + "libopencv_java4.so"; |
||||
result = loadLibrary(AbsLibraryPath); |
||||
} |
||||
|
||||
return result; |
||||
} |
||||
else |
||||
{ |
||||
Log.d(TAG, "Library path \"" + Path + "\" is empty"); |
||||
return false; |
||||
} |
||||
} |
||||
} |
@ -1,141 +0,0 @@ |
||||
package org.opencv.android; |
||||
|
||||
import android.app.Activity; |
||||
import android.app.AlertDialog; |
||||
import android.content.Context; |
||||
import android.content.DialogInterface; |
||||
import android.content.DialogInterface.OnClickListener; |
||||
import android.util.Log; |
||||
|
||||
/** |
||||
* Basic implementation of LoaderCallbackInterface. |
||||
*/ |
||||
public abstract class BaseLoaderCallback implements LoaderCallbackInterface { |
||||
|
||||
public BaseLoaderCallback(Context AppContext) { |
||||
mAppContext = AppContext; |
||||
} |
||||
|
||||
public void onManagerConnected(int status) |
||||
{ |
||||
switch (status) |
||||
{ |
||||
/** OpenCV initialization was successful. **/ |
||||
case LoaderCallbackInterface.SUCCESS: |
||||
{ |
||||
/** Application must override this method to handle successful library initialization. **/ |
||||
} break; |
||||
/** OpenCV loader can not start Google Play Market. **/ |
||||
case LoaderCallbackInterface.MARKET_ERROR: |
||||
{ |
||||
Log.e(TAG, "Package installation failed!"); |
||||
AlertDialog MarketErrorMessage = new AlertDialog.Builder(mAppContext).create(); |
||||
MarketErrorMessage.setTitle("OpenCV Manager"); |
||||
MarketErrorMessage.setMessage("Package installation failed!"); |
||||
MarketErrorMessage.setCancelable(false); // This blocks the 'BACK' button
|
||||
MarketErrorMessage.setButton(AlertDialog.BUTTON_POSITIVE, "OK", new OnClickListener() { |
||||
public void onClick(DialogInterface dialog, int which) { |
||||
finish(); |
||||
} |
||||
}); |
||||
MarketErrorMessage.show(); |
||||
} break; |
||||
/** Package installation has been canceled. **/ |
||||
case LoaderCallbackInterface.INSTALL_CANCELED: |
||||
{ |
||||
Log.d(TAG, "OpenCV library installation was canceled by user"); |
||||
finish(); |
||||
} break; |
||||
/** Application is incompatible with this version of OpenCV Manager. Possibly, a service update is required. **/ |
||||
case LoaderCallbackInterface.INCOMPATIBLE_MANAGER_VERSION: |
||||
{ |
||||
Log.d(TAG, "OpenCV Manager Service is uncompatible with this app!"); |
||||
AlertDialog IncomatibilityMessage = new AlertDialog.Builder(mAppContext).create(); |
||||
IncomatibilityMessage.setTitle("OpenCV Manager"); |
||||
IncomatibilityMessage.setMessage("OpenCV Manager service is incompatible with this app. Try to update it via Google Play."); |
||||
IncomatibilityMessage.setCancelable(false); // This blocks the 'BACK' button
|
||||
IncomatibilityMessage.setButton(AlertDialog.BUTTON_POSITIVE, "OK", new OnClickListener() { |
||||
public void onClick(DialogInterface dialog, int which) { |
||||
finish(); |
||||
} |
||||
}); |
||||
IncomatibilityMessage.show(); |
||||
} break; |
||||
/** Other status, i.e. INIT_FAILED. **/ |
||||
default: |
||||
{ |
||||
Log.e(TAG, "OpenCV loading failed!"); |
||||
AlertDialog InitFailedDialog = new AlertDialog.Builder(mAppContext).create(); |
||||
InitFailedDialog.setTitle("OpenCV error"); |
||||
InitFailedDialog.setMessage("OpenCV was not initialised correctly. Application will be shut down"); |
||||
InitFailedDialog.setCancelable(false); // This blocks the 'BACK' button
|
||||
InitFailedDialog.setButton(AlertDialog.BUTTON_POSITIVE, "OK", new OnClickListener() { |
||||
|
||||
public void onClick(DialogInterface dialog, int which) { |
||||
finish(); |
||||
} |
||||
}); |
||||
|
||||
InitFailedDialog.show(); |
||||
} break; |
||||
} |
||||
} |
||||
|
||||
public void onPackageInstall(final int operation, final InstallCallbackInterface callback) |
||||
{ |
||||
switch (operation) |
||||
{ |
||||
case InstallCallbackInterface.NEW_INSTALLATION: |
||||
{ |
||||
AlertDialog InstallMessage = new AlertDialog.Builder(mAppContext).create(); |
||||
InstallMessage.setTitle("Package not found"); |
||||
InstallMessage.setMessage(callback.getPackageName() + " package was not found! Try to install it?"); |
||||
InstallMessage.setCancelable(false); // This blocks the 'BACK' button
|
||||
InstallMessage.setButton(AlertDialog.BUTTON_POSITIVE, "Yes", new OnClickListener() |
||||
{ |
||||
public void onClick(DialogInterface dialog, int which) |
||||
{ |
||||
callback.install(); |
||||
} |
||||
}); |
||||
|
||||
InstallMessage.setButton(AlertDialog.BUTTON_NEGATIVE, "No", new OnClickListener() { |
||||
|
||||
public void onClick(DialogInterface dialog, int which) |
||||
{ |
||||
callback.cancel(); |
||||
} |
||||
}); |
||||
|
||||
InstallMessage.show(); |
||||
} break; |
||||
case InstallCallbackInterface.INSTALLATION_PROGRESS: |
||||
{ |
||||
AlertDialog WaitMessage = new AlertDialog.Builder(mAppContext).create(); |
||||
WaitMessage.setTitle("OpenCV is not ready"); |
||||
WaitMessage.setMessage("Installation is in progress. Wait or exit?"); |
||||
WaitMessage.setCancelable(false); // This blocks the 'BACK' button
|
||||
WaitMessage.setButton(AlertDialog.BUTTON_POSITIVE, "Wait", new OnClickListener() { |
||||
public void onClick(DialogInterface dialog, int which) { |
||||
callback.wait_install(); |
||||
} |
||||
}); |
||||
WaitMessage.setButton(AlertDialog.BUTTON_NEGATIVE, "Exit", new OnClickListener() { |
||||
public void onClick(DialogInterface dialog, int which) { |
||||
callback.cancel(); |
||||
} |
||||
}); |
||||
|
||||
WaitMessage.show(); |
||||
} break; |
||||
} |
||||
} |
||||
|
||||
void finish() |
||||
{ |
||||
((Activity) mAppContext).finish(); |
||||
} |
||||
|
||||
protected Context mAppContext; |
||||
private final static String TAG = "OCV/BaseLoaderCallback"; |
||||
} |
@ -1,34 +0,0 @@ |
||||
package org.opencv.android; |
||||
|
||||
/** |
||||
* Installation callback interface. |
||||
*/ |
||||
public interface InstallCallbackInterface |
||||
{ |
||||
/** |
||||
* New package installation is required. |
||||
*/ |
||||
static final int NEW_INSTALLATION = 0; |
||||
/** |
||||
* Current package installation is in progress. |
||||
*/ |
||||
static final int INSTALLATION_PROGRESS = 1; |
||||
|
||||
/** |
||||
* Target package name. |
||||
* @return Return target package name. |
||||
*/ |
||||
public String getPackageName(); |
||||
/** |
||||
* Installation is approved. |
||||
*/ |
||||
public void install(); |
||||
/** |
||||
* Installation is canceled. |
||||
*/ |
||||
public void cancel(); |
||||
/** |
||||
* Wait for package installation. |
||||
*/ |
||||
public void wait_install(); |
||||
}; |
@ -1,40 +0,0 @@ |
||||
package org.opencv.android; |
||||
|
||||
/** |
||||
* Interface for callback object in case of asynchronous initialization of OpenCV. |
||||
*/ |
||||
public interface LoaderCallbackInterface |
||||
{ |
||||
/** |
||||
* OpenCV initialization finished successfully. |
||||
*/ |
||||
static final int SUCCESS = 0; |
||||
/** |
||||
* Google Play Market cannot be invoked. |
||||
*/ |
||||
static final int MARKET_ERROR = 2; |
||||
/** |
||||
* OpenCV library installation has been canceled by the user. |
||||
*/ |
||||
static final int INSTALL_CANCELED = 3; |
||||
/** |
||||
* This version of OpenCV Manager Service is incompatible with the app. Possibly, a service update is required. |
||||
*/ |
||||
static final int INCOMPATIBLE_MANAGER_VERSION = 4; |
||||
/** |
||||
* OpenCV library initialization has failed. |
||||
*/ |
||||
static final int INIT_FAILED = 0xff; |
||||
|
||||
/** |
||||
* Callback method, called after OpenCV library initialization. |
||||
* @param status status of initialization (see initialization status constants). |
||||
*/ |
||||
public void onManagerConnected(int status); |
||||
|
||||
/** |
||||
* Callback method, called in case the package installation is needed. |
||||
* @param callback answer object with approve and cancel methods and the package description. |
||||
*/ |
||||
public void onPackageInstall(final int operation, InstallCallbackInterface callback); |
||||
}; |
@ -1,33 +0,0 @@ |
||||
package org.opencv.engine; |
||||
|
||||
/** |
||||
* Class provides a Java interface for OpenCV Engine Service. It's synchronous with native OpenCVEngine class. |
||||
*/ |
||||
interface OpenCVEngineInterface |
||||
{ |
||||
/** |
||||
* @return Returns service version. |
||||
*/ |
||||
int getEngineVersion(); |
||||
|
||||
/** |
||||
* Finds an installed OpenCV library. |
||||
* @param OpenCV version. |
||||
* @return Returns path to OpenCV native libs or an empty string if OpenCV can not be found. |
||||
*/ |
||||
String getLibPathByVersion(String version); |
||||
|
||||
/** |
||||
* Tries to install defined version of OpenCV from Google Play Market. |
||||
* @param OpenCV version. |
||||
* @return Returns true if installation was successful or OpenCV package has been already installed. |
||||
*/ |
||||
boolean installVersion(String version); |
||||
|
||||
/** |
||||
* Returns list of libraries in loading order, separated by semicolon. |
||||
* @param OpenCV version. |
||||
* @return Returns names of OpenCV libraries, separated by semicolon. |
||||
*/ |
||||
String getLibraryList(String version); |
||||
} |
@ -1,10 +0,0 @@ |
||||
if(NOT ANDROID_PROJECTS_BUILD_TYPE STREQUAL "ANT") |
||||
message(STATUS "Android OpenCV Manager is ignored") |
||||
return() |
||||
endif() |
||||
|
||||
if(BUILD_ANDROID_SERVICE) |
||||
add_subdirectory(engine) |
||||
endif() |
||||
|
||||
install(FILES "readme.txt" DESTINATION "apk/" COMPONENT libs) |
@ -1,30 +0,0 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" |
||||
package="org.opencv.engine" |
||||
android:versionCode="345@ANDROID_PLATFORM_ID@" |
||||
android:versionName="3.45"> |
||||
|
||||
<uses-sdk android:minSdkVersion="@ANDROID_NATIVE_API_LEVEL@" android:targetSdkVersion="22"/> |
||||
<uses-feature android:name="android.hardware.touchscreen" android:required="false"/> |
||||
|
||||
<application |
||||
android:icon="@drawable/icon" |
||||
android:label="@string/app_name" android:allowBackup="true"> |
||||
|
||||
<service android:exported="true" android:name="OpenCVEngineService" android:process=":OpenCVEngineProcess"> |
||||
<intent-filter> |
||||
<action android:name="org.opencv.engine.BIND"></action> |
||||
</intent-filter> |
||||
</service> |
||||
|
||||
<activity |
||||
android:name="org.opencv.engine.manager.ManagerActivity" |
||||
android:label="@string/app_name" |
||||
android:screenOrientation="portrait"> |
||||
<intent-filter> |
||||
<action android:name="android.intent.action.MAIN" /> |
||||
<category android:name="android.intent.category.LAUNCHER" /> |
||||
</intent-filter> |
||||
</activity> |
||||
</application> |
||||
</manifest> |
@ -1,3 +0,0 @@ |
||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/${ANDROID_MANIFEST_FILE}" "${OpenCV_BINARY_DIR}/platforms/android/service/engine/.build/${ANDROID_MANIFEST_FILE}" @ONLY) |
||||
unset(__android_project_chain CACHE) |
||||
add_android_project(opencv_engine "${CMAKE_CURRENT_SOURCE_DIR}" SDK_TARGET 9 ${ANDROID_SDK_TARGET} IGNORE_JAVA ON IGNORE_MANIFEST ON COPY_LIBS ON) |
Before Width: | Height: | Size: 2.0 KiB |
@ -1,49 +0,0 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" |
||||
android:id="@+id/ScrollBox" |
||||
android:layout_width="fill_parent" |
||||
android:layout_height="fill_parent" > |
||||
|
||||
<LinearLayout |
||||
android:layout_width="fill_parent" |
||||
android:layout_height="wrap_content" |
||||
android:gravity="center_vertical|center_horizontal" |
||||
android:orientation="vertical" |
||||
android:scrollbarStyle="insideInset" > |
||||
|
||||
<TextView |
||||
android:id="@+id/textView4" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:text="@string/about" |
||||
android:textAppearance="?android:attr/textAppearanceLarge" /> |
||||
|
||||
<TextView |
||||
android:id="@+id/textViewIntro" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:autoLink="web" |
||||
android:text="@string/intro" |
||||
android:textAppearance="?android:attr/textAppearanceSmall" /> |
||||
|
||||
<TextView |
||||
android:id="@+id/textView5" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:textAppearance="?android:attr/textAppearanceSmall" /> |
||||
|
||||
<TextView |
||||
android:id="@+id/textView6" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:textAppearance="?android:attr/textAppearanceSmall" /> |
||||
|
||||
<Button |
||||
android:id="@+id/CheckEngineUpdate" |
||||
android:layout_width="wrap_content" |
||||
android:layout_height="wrap_content" |
||||
android:layout_gravity="center_vertical|center_horizontal" |
||||
android:text="@string/checkUpdate" /> |
||||
</LinearLayout> |
||||
|
||||
</ScrollView> |
@ -1,7 +0,0 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<resources> |
||||
<string name="app_name">OpenCV Manager</string> |
||||
<string name="about">About</string> |
||||
<string name="checkUpdate">Check for update</string> |
||||
<string name="intro">OpenCV library is used by other applications for image enhancement, panorama stitching, object detection, recognition and tracking and so on. OpenCV Manager provides the best version of the OpenCV for your hardware. See opencv.org for details.</string> |
||||
</resources> |
@ -1,118 +0,0 @@ |
||||
package org.opencv.engine; |
||||
|
||||
import java.io.File; |
||||
import java.util.Arrays; |
||||
import java.util.HashMap; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import java.util.Scanner; |
||||
import java.util.regex.Pattern; |
||||
import java.util.regex.Matcher; |
||||
import android.os.Build; |
||||
import android.text.TextUtils; |
||||
import android.util.Log; |
||||
|
||||
public class HardwareDetector { |
||||
private static String TAG = "OpenCVEngine/HardwareDetector"; |
||||
|
||||
public static final int ARCH_UNKNOWN = -1; |
||||
|
||||
public static final int ARCH_X86 = 0x01000000; |
||||
public static final int ARCH_X86_64 = 0x02000000; |
||||
public static final int ARCH_ARM = 0x04000000; |
||||
public static final int ARCH_ARMv7 = 0x10000000; |
||||
public static final int ARCH_ARMv8 = 0x20000000; |
||||
public static final int ARCH_MIPS = 0x40000000; |
||||
public static final int ARCH_MIPS_64 = 0x80000000; |
||||
|
||||
// Return CPU flags list
|
||||
public static List<String> getFlags() { |
||||
Map<String, String> raw = getRawCpuInfo(); |
||||
String f = raw.get("flags"); |
||||
if (f == null) |
||||
f = raw.get("Features"); |
||||
if (f == null) |
||||
return Arrays.asList(); |
||||
return Arrays.asList(TextUtils.split(f, " ")); |
||||
} |
||||
|
||||
// Return CPU arch
|
||||
public static int getAbi() { |
||||
List<String> abis = Arrays.asList(Build.CPU_ABI, Build.CPU_ABI2); |
||||
Log.i(TAG, "ABIs: " + abis.toString()); |
||||
if (abis.contains("x86_64")) { |
||||
return ARCH_X86_64; |
||||
} else if (abis.contains("x86")) { |
||||
return ARCH_X86; |
||||
} else if (abis.contains("arm64-v8a")) { |
||||
return ARCH_ARMv8; |
||||
} else if (abis.contains("armeabi-v7a") |
||||
|| abis.contains("armeabi-v7a-hard")) { |
||||
return ARCH_ARMv7; |
||||
} else if (abis.contains("armeabi")) { |
||||
return ARCH_ARM; |
||||
} else if (abis.contains("mips64")) { |
||||
return ARCH_MIPS_64; |
||||
} else if (abis.contains("mips")) { |
||||
return ARCH_MIPS; |
||||
} |
||||
return ARCH_UNKNOWN; |
||||
} |
||||
|
||||
// Return hardware platform name
|
||||
public static String getHardware() { |
||||
Map<String, String> raw = getRawCpuInfo(); |
||||
return raw.get("Hardware"); |
||||
} |
||||
|
||||
// Return processor count
|
||||
public static int getProcessorCount() { |
||||
int result = 0; |
||||
try { |
||||
Pattern pattern = Pattern.compile("(\\d)+(-(\\d+))?"); |
||||
Scanner s = new Scanner( |
||||
new File("/sys/devices/system/cpu/possible")); |
||||
if (s.hasNextLine()) { |
||||
String line = s.nextLine(); |
||||
Log.d(TAG, "Got CPUs: " + line); |
||||
Matcher m = pattern.matcher(line); |
||||
while (m.find()) { |
||||
int start = Integer.parseInt(m.group(1)); |
||||
int finish = start; |
||||
if (m.group(3) != null) { |
||||
finish = Integer.parseInt(m.group(3)); |
||||
} |
||||
result += finish - start + 1; |
||||
Log.d(TAG, "Got CPU range " + start + " ~ " + finish); |
||||
} |
||||
} |
||||
} catch (Exception e) { |
||||
Log.e(TAG, "Failed to read cpu count"); |
||||
e.printStackTrace(); |
||||
} |
||||
return result; |
||||
|
||||
} |
||||
|
||||
// Return parsed cpuinfo contents
|
||||
public static Map<String, String> getRawCpuInfo() { |
||||
Map<String, String> map = new HashMap<String, String>(); |
||||
try { |
||||
Scanner s = new Scanner(new File("/proc/cpuinfo")); |
||||
while (s.hasNextLine()) { |
||||
String line = s.nextLine(); |
||||
String[] vals = line.split(": "); |
||||
if (vals.length > 1) { |
||||
map.put(vals[0].trim(), vals[1].trim()); |
||||
} else { |
||||
Log.d(TAG, "Failed to parse cpuinfo: " + line); |
||||
} |
||||
} |
||||
} catch (Exception e) { |
||||
Log.e(TAG, "Failed to read cpuinfo"); |
||||
e.printStackTrace(); |
||||
} |
||||
return map; |
||||
} |
||||
|
||||
} |
@ -1,31 +0,0 @@ |
||||
package org.opencv.engine; |
||||
|
||||
import android.content.Context; |
||||
import android.content.Intent; |
||||
import android.net.Uri; |
||||
import android.util.Log; |
||||
|
||||
public class MarketConnector { |
||||
protected static final String OpenCVPackageNamePreffix = "org.opencv.lib"; |
||||
private static final String TAG = "OpenCVEngine/MarketConnector"; |
||||
protected Context mContext; |
||||
|
||||
public MarketConnector(Context context) { |
||||
mContext = context; |
||||
} |
||||
|
||||
public boolean InstallAppFromMarket(String AppID) { |
||||
Log.d(TAG, "Installing app: " + AppID); |
||||
boolean result = true; |
||||
try { |
||||
Uri uri = Uri.parse("market://details?id=" + AppID); |
||||
Intent intent = new Intent(Intent.ACTION_VIEW, uri); |
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); |
||||
mContext.startActivity(intent); |
||||
} catch (Exception e) { |
||||
Log.e(TAG, "Installation failed"); |
||||
result = false; |
||||
} |
||||
return result; |
||||
} |
||||
} |
@ -1,33 +0,0 @@ |
||||
package org.opencv.engine; |
||||
|
||||
/** |
||||
* Class provides Java interface to OpenCV Engine Service. Is synchronous with native OpenCVEngine class. |
||||
*/ |
||||
interface OpenCVEngineInterface |
||||
{ |
||||
/** |
||||
* @return Return service version |
||||
*/ |
||||
int getEngineVersion(); |
||||
|
||||
/** |
||||
* Find installed OpenCV library |
||||
* @param OpenCV version |
||||
* @return Returns path to OpenCV native libs or empty string if OpenCV was not found |
||||
*/ |
||||
String getLibPathByVersion(String version); |
||||
|
||||
/** |
||||
* Try to install defined version of OpenCV from Google Play (Android Market). |
||||
* @param OpenCV version |
||||
* @return Returns true if installation was successful or OpenCV package has been already installed |
||||
*/ |
||||
boolean installVersion(String version); |
||||
|
||||
/** |
||||
* Return list of libraries in loading order separated by ";" symbol |
||||
* @param OpenCV version |
||||
* @return Returns OpenCV libraries names separated by symbol ";" in loading order |
||||
*/ |
||||
String getLibraryList(String version); |
||||
} |
@ -1,165 +0,0 @@ |
||||
package org.opencv.engine; |
||||
|
||||
import android.app.Service; |
||||
import android.content.Intent; |
||||
import android.content.pm.PackageManager.NameNotFoundException; |
||||
import android.content.res.XmlResourceParser; |
||||
import android.os.IBinder; |
||||
import android.os.RemoteException; |
||||
import android.util.Log; |
||||
import android.text.TextUtils; |
||||
import java.io.File; |
||||
import java.lang.reflect.Field; |
||||
import java.util.ArrayList; |
||||
import java.util.Arrays; |
||||
import java.util.List; |
||||
import org.xmlpull.v1.XmlPullParser; |
||||
|
||||
public class OpenCVEngineService extends Service { |
||||
private static final String TAG = "OpenCVEngine/Service"; |
||||
private IBinder mEngineInterface = null; |
||||
private List<LibVariant> variants = new ArrayList<LibVariant>(); |
||||
|
||||
private class LibVariant { |
||||
public String version; |
||||
public List<String> files; |
||||
|
||||
public void parseFile(XmlResourceParser p) { |
||||
try { |
||||
int eventType = p.getEventType(); |
||||
while (eventType != XmlPullParser.END_DOCUMENT) { |
||||
if (eventType == XmlPullParser.START_TAG) { |
||||
if (p.getName().equals("library")) { |
||||
parseLibraryTag(p); |
||||
} else if (p.getName().equals("file")) { |
||||
parseFileTag(p); |
||||
} |
||||
} |
||||
eventType = p.next(); |
||||
} |
||||
} catch (Exception e) { |
||||
Log.e(TAG, "Failed to parse xml library descriptor"); |
||||
} |
||||
} |
||||
|
||||
private void parseLibraryTag(XmlResourceParser p) { |
||||
version = p.getAttributeValue(null, "version"); |
||||
files = new ArrayList<String>(); |
||||
} |
||||
|
||||
private void parseFileTag(XmlResourceParser p) { |
||||
files.add(p.getAttributeValue(null, "name")); |
||||
} |
||||
|
||||
public boolean hasAllFiles(String path) { |
||||
boolean result = true; |
||||
List<String> actualFiles = Arrays.asList((new File(path)).list()); |
||||
for (String f : files) |
||||
result &= actualFiles.contains(f); |
||||
return result; |
||||
} |
||||
|
||||
public boolean isCompatible(String v) { |
||||
String[] expected = v.split("\\."); |
||||
String[] actual = version.split("\\."); |
||||
int i = 0; |
||||
for (; i < Math.min(expected.length, actual.length); ++i) { |
||||
int diff = Integer.valueOf(expected[i]) |
||||
- Integer.valueOf(actual[i]); |
||||
if (diff > 0 || (diff != 0 && i == 0)) { |
||||
// requested version is greater than actual OR major version differs
|
||||
return false; |
||||
} else if (diff < 0) { |
||||
// version is compatible
|
||||
return true; |
||||
} |
||||
} |
||||
if (expected.length > i) { |
||||
// requested version is longer than actual - 2.4.11.2 and 2.4.11
|
||||
return false; |
||||
} |
||||
return true; |
||||
} |
||||
|
||||
public String getFileList() { |
||||
return TextUtils.join(";", files); |
||||
} |
||||
} |
||||
|
||||
public void onCreate() { |
||||
Log.d(TAG, "Service starting"); |
||||
for (Field field : R.xml.class.getDeclaredFields()) { // Build error here means that all config.xml files are missing (configuration problem)
|
||||
Log.d(TAG, "Found config: " + field.getName()); |
||||
final LibVariant lib = new LibVariant(); |
||||
try { |
||||
final int id = field.getInt(R.xml.class); |
||||
final XmlResourceParser p = getResources().getXml(id); |
||||
lib.parseFile(p); |
||||
} catch (IllegalArgumentException e) { |
||||
e.printStackTrace(); |
||||
} catch (IllegalAccessException e) { |
||||
e.printStackTrace(); |
||||
} |
||||
if (lib.version != null |
||||
&& lib.files.size() != 0 |
||||
&& lib.hasAllFiles(getApplication().getApplicationInfo().nativeLibraryDir)) { |
||||
variants.add(lib); |
||||
Log.d(TAG, "Added config: " + lib.version); |
||||
} |
||||
} |
||||
super.onCreate(); |
||||
mEngineInterface = new OpenCVEngineInterface.Stub() { |
||||
|
||||
@Override |
||||
public boolean installVersion(String version) |
||||
throws RemoteException { |
||||
// DO NOTHING
|
||||
return false; |
||||
} |
||||
|
||||
@Override |
||||
public String getLibraryList(String version) throws RemoteException { |
||||
Log.i(TAG, "getLibraryList(" + version + ")"); |
||||
for (LibVariant lib : variants) { |
||||
Log.i(TAG, "checking " + lib.version + " ..."); |
||||
if (lib.isCompatible(version)) |
||||
return lib.getFileList(); |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public String getLibPathByVersion(String version) |
||||
throws RemoteException { |
||||
// TODO: support API 8
|
||||
return getApplication().getApplicationInfo().nativeLibraryDir; |
||||
} |
||||
|
||||
@Override |
||||
public int getEngineVersion() throws RemoteException { |
||||
int version = 3450; |
||||
try { |
||||
version = getPackageManager().getPackageInfo(getPackageName(), 0).versionCode; |
||||
} catch (NameNotFoundException e) { |
||||
e.printStackTrace(); |
||||
} |
||||
return version / 1000; |
||||
} |
||||
}; |
||||
} |
||||
|
||||
public IBinder onBind(Intent intent) { |
||||
Log.i(TAG, "Service onBind called for intent " + intent.toString()); |
||||
return mEngineInterface; |
||||
} |
||||
|
||||
public boolean onUnbind(Intent intent) { |
||||
Log.i(TAG, "Service onUnbind called for intent " + intent.toString()); |
||||
return true; |
||||
} |
||||
|
||||
public void OnDestroy() { |
||||
Log.i(TAG, "OpenCV Engine service destruction"); |
||||
} |
||||
|
||||
} |
@ -1,113 +0,0 @@ |
||||
package org.opencv.engine.manager; |
||||
|
||||
import org.opencv.engine.MarketConnector; |
||||
import org.opencv.engine.HardwareDetector; |
||||
import org.opencv.engine.OpenCVEngineInterface; |
||||
import org.opencv.engine.OpenCVEngineService; |
||||
import org.opencv.engine.R; |
||||
import android.app.Activity; |
||||
import android.content.ComponentName; |
||||
import android.content.Context; |
||||
import android.content.Intent; |
||||
import android.content.ServiceConnection; |
||||
import android.os.Bundle; |
||||
import android.os.IBinder; |
||||
import android.os.RemoteException; |
||||
import android.text.TextUtils; |
||||
import android.util.Log; |
||||
import android.view.View; |
||||
import android.view.View.OnClickListener; |
||||
import android.widget.Button; |
||||
import android.widget.TextView; |
||||
import android.widget.Toast; |
||||
|
||||
public class ManagerActivity extends Activity { |
||||
protected static final String TAG = "OpenCVEngine/Activity"; |
||||
protected MarketConnector mMarket; |
||||
protected TextView mVersionText; |
||||
protected boolean mExtraInfo = false; |
||||
|
||||
/** Called when the activity is first created. */ |
||||
@Override |
||||
public void onCreate(Bundle savedInstanceState) { |
||||
super.onCreate(savedInstanceState); |
||||
|
||||
setContentView(R.layout.main); |
||||
|
||||
final Class<OpenCVEngineService> c = OpenCVEngineService.class; |
||||
final String packageName = c.getPackage().getName(); |
||||
|
||||
mMarket = new MarketConnector(this); |
||||
|
||||
Button updateButton = (Button) findViewById(R.id.CheckEngineUpdate); |
||||
updateButton.setOnClickListener(new OnClickListener() { |
||||
public void onClick(View v) { |
||||
if (!mMarket.InstallAppFromMarket(packageName)) { |
||||
Toast toast = Toast.makeText(getApplicationContext(), |
||||
"Google Play is not available", Toast.LENGTH_SHORT); |
||||
toast.show(); |
||||
} |
||||
} |
||||
}); |
||||
|
||||
TextView aboutText = (TextView) findViewById(R.id.textView4); |
||||
aboutText.setText("About (" + packageName + ")"); |
||||
|
||||
if (mExtraInfo) { |
||||
TextView extraText = (TextView) findViewById(R.id.textView6); |
||||
extraText.setText( |
||||
"CPU count: " |
||||
+ HardwareDetector.getProcessorCount() |
||||
+ "\nABI: 0x" |
||||
+ Integer.toHexString(HardwareDetector.getAbi()) |
||||
+ "\nFlags: " |
||||
+ TextUtils.join(";", HardwareDetector.getFlags()) |
||||
+ "\nHardware: " |
||||
+ HardwareDetector.getHardware()); |
||||
} |
||||
|
||||
mVersionText = (TextView) findViewById(R.id.textView5); |
||||
if (!bindService(new Intent(this, c), |
||||
new OpenCVEngineServiceConnection(), Context.BIND_AUTO_CREATE)) { |
||||
Log.e(TAG, "Failed to bind to service:" + c.getName()); |
||||
mVersionText.setText("not available"); |
||||
} else { |
||||
Log.d(TAG, "Successfully bound to service:" + c.getName()); |
||||
mVersionText.setText("available"); |
||||
} |
||||
|
||||
} |
||||
|
||||
protected class OpenCVEngineServiceConnection implements ServiceConnection { |
||||
public void onServiceDisconnected(ComponentName name) { |
||||
Log.d(TAG, "Handle: service disconnected"); |
||||
} |
||||
|
||||
public void onServiceConnected(ComponentName name, IBinder service) { |
||||
Log.d(TAG, "Handle: service connected"); |
||||
OpenCVEngineInterface engine = OpenCVEngineInterface.Stub |
||||
.asInterface(service); |
||||
if (engine == null) { |
||||
Log.e(TAG, "Cannot connect to OpenCV Manager Service!"); |
||||
unbindService(this); |
||||
return; |
||||
} |
||||
Log.d(TAG, "Successful connection"); |
||||
try { |
||||
String[] vars = { "2.4", "3.0" }; |
||||
String res = new String(); |
||||
for (String piece : vars) { |
||||
res += "\n\t" + piece + " -> " |
||||
+ engine.getLibraryList(piece); |
||||
} |
||||
mVersionText.setText("Path: " |
||||
+ engine.getLibPathByVersion(null) + res); |
||||
} catch (RemoteException e) { |
||||
e.printStackTrace(); |
||||
Log.e(TAG, "Call failed"); |
||||
} |
||||
unbindService(this); |
||||
} |
||||
}; |
||||
|
||||
} |
@ -1,25 +0,0 @@ |
||||
How to select the proper version of OpenCV Manager |
||||
-------------------------------------------------- |
||||
|
||||
Since version 1.7 several packages of OpenCV Manager are built. Every package is targeted for some |
||||
specific hardware platform and includes corresponding OpenCV binaries. So, in all cases OpenCV |
||||
Manager uses built-in version of OpenCV. The new package selection logic in most cases simplifies |
||||
OpenCV installation on end user devices. In most cases OpenCV Manager may be installed automatically |
||||
from Google Play. |
||||
|
||||
If Google Play is not available (i.e. on emulator, developer board, etc), you can install it |
||||
manually using adb tool: |
||||
|
||||
adb install <path-to-OpenCV-sdk>/apk/OpenCV_<version>_Manager_<app_version>_<platform>.apk |
||||
|
||||
Example: OpenCV_3.4.5-dev_Manager_3.45_armeabi-v7a.apk |
||||
|
||||
Use the list of platforms below to determine proper OpenCV Manager package for your device: |
||||
|
||||
- armeabi (ARMv5, ARMv6) |
||||
- armeabi-v7a (ARMv7-A + NEON) |
||||
- arm64-v8a |
||||
- mips |
||||
- mips64 |
||||
- x86 |
||||
- x86_64 |
Loading…
Reference in new issue