将OpenCV添加到新的Android项目中有一些麻烦 [英] I'm having some trouble adding OpenCV to a new Android project
问题描述
我已经对Android中的几个示例OpenCV项目进行了修改,但是我在一个新的Android项目中成功使用OpenCV有一些问题。
I have made modifications to several example OpenCV projects within Android, however I am having some issues with using OpenCV successfully in a new Android project.
文档在Android上使用OpenCV 说完成以下步骤将OpenCV添加到Android项目中 -
The documentation on using OpenCV with Android says to complete the following steps to add OpenCV to an Android project -
- 确保Android项目是在与OpenCV相同的工作空间中
- 通过转到属性> Android>库>添加并选择OpenCV库项目
- ensure the Android project is in the same workspace as OpenCV
- add a reference to the OpenCV project by going to Properties > Android > Library > Add and choosing the OpenCV Library project
我已经遵循了这两个步骤,但是当我编译我的应用程序时,我收到控制台错误 -
I have followed both of these steps, however when I compile my application I receive the console error -
找不到OpenCV-2.3.1.apk!
Could not find OpenCV-2.3.1.apk!
推荐答案
创建新的Android项目时,您唯一需要做的是
When creating a new Android project, the only thing you need to do is
- 添加对OpenCV项目的引用通过转到属性> Android>库>添加和选择OpenCV Library项目
您不应该将OpenCV Library项目明确添加到新的Android项目的构建路径中:
You should not then explicitly add OpenCV Library project into your new Android project's build path:
- 通过转到属性> Java构建路径>项目>添加...添加对OpenCV项目的另一个引用
如果你后面的步骤,你会得到确切的错误无法找到问题中描述的OpenCV-2.3.1.apk!。
If you do latter step, you will get the exact error Could not find OpenCV-2.3.1.apk! described in the question.
查看新的Android项目的构建路径,并删除OpenCV项目(如果存在),然后再尝试一下,看看是否有帮助。
Check out the New Android project's build path and remove OpenCV project if it exists, then give it another try and see if this helps.
这篇关于将OpenCV添加到新的Android项目中有一些麻烦的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!