如何运行OpenCV相关的应用程序,而不使用Android中的OpenCV管理器[英] how to run openCV related app , without using OpenCV manager in android

本文是小编为大家收集整理的关于如何运行OpenCV相关的应用程序,而不使用Android中的OpenCV管理器的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。

问题描述

在我的 android 应用程序中,我使用 OpenCV 库的静态加载即

OpenCVLoader.initDebug()

在模拟器上运行时返回true,但在(移动)设备上运行时返回false.

如果我使用

OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_3, this, mLoaderCallback)

如果已经安装了 OpenCV 管理器 .apk,那么上面的代码在模拟器和设备中工作正常.在这里我想运行 openCV realted 应用程序,没有安装 OpenCV manager.apk.

请帮帮我.提前致谢.

推荐答案

好吧,你说的是 OpenCV 库的 Static initialization.

见这个官方Opencv 关于此事的帮助.

也看看这些StackOverflow 主题并尝试编译您的代码.

干杯.

其他推荐答案

对于那里的 Android Studio 用户,我写了一篇博客文章,详细介绍了我为解决 OpenCV Manager 应用程序安装提示所做的工作:

http://usefuljavanotes.weebly.com/blog/how-to-use-opencv-without-opencv-manager

这是一个 GitHub 存储库,其中包含我在博文中实现的代码.请随意下载并在您的系统上进行测试:

https://github.com/JamieLee629/OpenCVTest

博文中未提及的其他 OpenCV 代码部分由 Code Onion 博客提供:

http://blog.codeonion.com/2016/04/09/show-camera-on-android-app-using-opencv-for-android/

我使用这些来源编译了这个答案:https://stackoverflow.com/a/45684065/6030520https://stackoverflow.com/a/35135495/6030520https://stackoverflow.com/a/20259621/6030520

本文地址:https://www.itbaoku.cn/post/102543.html

问题描述

In my android application, i use static loading of OpenCV library i.e

OpenCVLoader.initDebug()

it will return true when run on emulator, but return false when run on (mobile) device.

if i use

OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_3, this, mLoaderCallback)

if OpenCV manager .apk alredy installed,then above code work fine in emulator and device. here i want run openCV realted app, with out intall OpenCV manager.apk.

please help me. thanks in advance.

推荐答案

Ok what you are talking is Static initialization of the OpenCV library.

See this Official Opencv help regarding this matter.

Also have a look at these StackOverflow topic and try compiling your code.

Cheers.

其他推荐答案

For the Android Studio users out there, I made a blog post detailing what I did to get around the OpenCV Manager App Installation prompt:

http://usefuljavanotes.weebly.com/blog/how-to-use-opencv-without-opencv-manager

Here is a GitHub repo that includes the code I implemented in the blog post. Feel free to download it and test it on your system:

https://github.com/JamieLee629/OpenCVTest

The other OpenCV parts of the code not mentioned in the blog post were courtesy of Code Onion Blog:

http://blog.codeonion.com/2016/04/09/show-camera-on-android-app-using-opencv-for-android/

I compiled this answer using these sources: https://stackoverflow.com/a/45684065/6030520, https://stackoverflow.com/a/35135495/6030520, https://stackoverflow.com/a/20259621/6030520