简体   繁体   English

OpenCV Android Studio设置问题

[英]OpenCV Android Studio Set-up problems

I am trying to use opencv in android studio but am having some problems. 我正在尝试在Android Studio中使用opencv,但遇到了一些问题。 I have searched the forums but couldn't find this exact problem. 我已经搜索了论坛,但找不到确切的问题。 I am clicking file > import module and entering the following file path: OpenCV-2.4.10-android-sdk\\sdk\\java 我单击文件>导入模块,然后输入以下文件路径:OpenCV-2.4.10-android-sdk \\ sdk \\ java

I then receive an import summary like this: 然后,我收到这样的导入摘要:

ECLIPSE ANDROID PROJECT IMPORT SUMMARY 月食安卓项目进口总结

Ignored Files: 忽略的文件:

The following files were not copied into the new Gradle project; 以下文件复制到新的Gradle项目中; you should evaluate whether these are still needed in your project and if so manually move them: 您应该评估项目中是否仍需要这些,如果需要,请手动移动它们:

  • javadoc\\ 的javadoc \\
  • javadoc\\allclasses-frame.html 的javadoc \\ allclasses,frame.html
  • javadoc\\allclasses-noframe.html 的javadoc \\ allclasses,noframe.html
  • javadoc\\constant-values.html 的javadoc \\恒values.html
  • javadoc\\help-doc.html 的javadoc \\帮助,doc.html
  • javadoc\\index-all.html 的javadoc \\指数all.html
  • javadoc\\index.html 的javadoc \\ index.html在
  • javadoc\\org\\ ... the summary includes a lot more libraries that are not included but I didn't want to list pointless additional information. javadoc \\ org \\ ...摘要包含许多未包含的库,但我不想列出无意义的其他信息。 ... ...

Moved Files: 移动的文件:

Android Gradle projects use a different directory structure than ADT Eclipse projects. Android Gradle项目使用与ADT Eclipse项目不同的目录结构。 Here's how the projects were restructured: 以下是项目重组的方式:

  • AndroidManifest.xml => openCVLibrary2410\\src\\main\\AndroidManifest.xml AndroidManifest.xml => openCVLibrary2410 \\ src \\ main \\ AndroidManifest.xml
  • lint.xml => openCVLibrary2410\\lint.xml lint.xml => openCVLibrary2410 \\ lint.xml
  • res\\ => openCVLibrary2410\\src\\main\\res\\ res \\ => openCVLibrary2410 \\ src \\ main \\ res \\
  • src\\ => openCVLibrary2410\\src\\main\\java\\ src \\ => openCVLibrary2410 \\ src \\ main \\ java \\
  • src\\org\\opencv\\engine\\OpenCVEngineInterface.aidl => openCVLibrary2410\\src\\main\\aidl\\org\\opencv\\engine\\OpenCVEngineInterface.aidl src \\ org \\ opencv \\ engine \\ OpenCVEngineInterface.aidl => openCVLibrary2410 \\ src \\ main \\ aidl \\ org \\ opencv \\ engine \\ OpenCVEngineInterface.aidl

Next Steps: 下一步:

You can now build the project. 您现在可以构建项目。 The Gradle project needs network connectivity to download dependencies. Gradle项目需要网络连接才能下载依赖项。

Bugs: 错误:

If for some reason your project does not build, and you determine that it is due to a bug or limitation of the Eclipse to Gradle importer, please file a bug at http://b.android.com with category Component-Tools. 如果由于某种原因您的项目无法构建,并且确定它是由于Eclipse到Gradle导入程序的错误或限制而引起的,请在http://b.android.com上将 Component-Tools类别归类为错误。

(This import summary is for your information only, and can be deleted after import once you are satisfied with the results.) (此导入摘要仅供参考,一旦对结果满意,可以在导入后将其删除。)

Can anyone help me with this issue please? 有人可以帮我解决这个问题吗?

Even if ".html" files are not copied the code will work. 即使未复制“ .html”文件,代码也将起作用。
But as you import the libraries you should get opencv in the dropdown after you type"import org." 但是,当您导入库时,在键入“ import org”后,应该在下拉菜单中获得opencv。 Instead of importing path:"OpenCV-2.4.10-android-sdk\\sdk\\java" import any one of the samples from the opencv sdk 4 android and the libraries will be imported automatically 而不是导入路径:“ OpenCV-2.4.10-android-sdk \\ sdk \\ java”从opencv sdk 4 android中导入任何一个示例,库将自动导入
eg:-(path:"OpenCV-2.4.11-android-sdk\\OpenCV-android-sdk\\samples\\15-puzzle") 例如:-(路径: “的OpenCV-2.4.11-Android的SDK \\的OpenCV-Android的SDK \\样品\\ 15拼图”)
then you can always remove the module from properties. 那么您始终可以从属性中删除该模块。
Its best to have version 2.4.11 最好拥有版本2.4.11

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM