我不知道为什么OpenCV示例在Galaxy S5设备中不起作用.我首先安装了OpenCV Manager,然后尝试安装演示项目,但每次出现此错误.
OpenCV Library package was not found! Try to install it? (Button : Yes/No)
当我点击“是”时,它会打开Play商店,但它会说
Item not found. (Button: Retry)
当Open OpenCV Manager Application设备看起来像是在屏幕下方.它在我的Galaxy S5设备上没有检测到硬件.那么如何检查为什么它没有检测到?我还尝试从OpenCV-Android-SDK / APK / Path安装所有其他库APK,但仍未检测到硬件.
While Same thing I done on Nexus 7 Tablet and it shows Hardware detected with Its Name.
Please help me to how to solve this error in Samsung Galaxy S5
解决方法:
我做了很多尝试,最后我得到了解决方案.我在没有OpenCV Managar参考图书馆项目的情况下运行OpenCV程序.我用一些技巧解决了这个问题.
我做了什么让我详细说明.
1)首先从Eclipse中卸载/删除包括OpenCV Manager在内的所有应用程序
2)再次导入所需的OpenCV_Lib和Projects.
3)将OpenCV_Lib引用到Project.
4)打开Android.mk(project_path / jni / android.mk)并将下面的变量OFF更改为ON
OPENCV_CAMERA_MODULES:=on
OPENCV_INSTALL_MODULES:=on
OPENCV_LIB_TYPE:=SHARED
include full_path/OpenCV-2.4.9-android-sdk/sdk/native/jni/OpenCV.mk
5)打开MainActivity或StartupActivity并放置此行.
static {
if (!OpenCVLoader.initDebug()) {
// Handle initialization error
}
}
6)用以下代码替换onResume.
@Override
protected void onResume() {
try {
Log.i(TAG, "onResume");
super.onResume();
mOpenCVCallBack.onManagerConnected(LoaderCallbackInterface.SUCCESS);
} catch (final Exception e) {
Uts.writeException(getApplicationContext(), e);
}
}
而不是运行你的代码.
我希望这可以帮助您在没有OpenCV Manager应用程序的情况下运行代码.