Opencv - Android 配置安装
1、道具们:
windows 7 64位
OpenCV-2.4.6-android-sdk-r2 ( http://sourceforge.net/projects/opencvlibrary/files/opencv-android/
Adt-bundle-windows-x86_64 With a single download,the ADT Bundle includes everything you need to begin developing apps
- Eclipse + ADT plugin Android SDK Tools
- Android Platform-tools
- The latest Android platform
- The latest Android system image for the emulator
- 说白了,就是个不用配置安卓环境版的eclipse :)
- http://developer.android.com/sdk/index.html
android-ndk-r8e-windows-x86_64[8]
cygwin 由于是初来乍到,这个软件也是按照参考里面安装的,具体什么用处还不得而知,不过貌似要装并且配置path
cdt 一个给eclipse用c\C++的东西
2、安装过程[1、2]:
step1 :Sun JDK 6 (Sun JDK 7 is also possible)
step2 :Android SDK
step3 :Android SDK components
step4 :Eclipse IDE(在opecnv的文档网站中教程是[1]是用的Eclipse IDE做范例,其实就我的体会来说ADT Bundle就完全可以,并且[2]中的Eclipse也都是用的Bundle)
step5 :cygwin
访问http://cygwin.com/index.html下载最新的Cygwin,最好安装全部的Cygwin组件。
step6 :Android NDK
这个NDK还是很重要的,因为opencv-android包里的sample的face-detection和toturial2是用C\C++语言写了部分代码的,一开始下载最新的NDK-r9,但是build时就会出现一个莫名其妙的错误“package intallation failed”, 到我配置成功(2013/10/05)之前,r9对OpenCV-2.4.6-android支持的还不是很好,所以就像一开始在道具那章节里写的,我用的是r8e。
step7 :CDT plugin for Eclipse
原文如下:If you selected for installation the NDK plugins component of Eclipse ADT plugin (see the picture above) your Eclipse IDE should already have CDT plugin (that means C/C++ Development Tooling). There are several possible ways to integrate compilation of C++ code by Android NDK into Eclipse compilation process. We recommend the approach based on Eclipse CDTBuilder.
3、Troubleshooting
Q1 :假如出现这句话:OPENCV MANAGER PACKAGE NOT FOUND. TRY TO INSTALL IT?
A1 :[1]的底部就有解决办法,一般“\OpenCV-2.4.6-android-sdk\apk”这个路径下就是OpenCV Manager的apk啦,但是ADT如何安装软件呢?那就去看看[5][6]吧。
Q2 :假如OpenCV Manager 的apk安装不好使怎么办 ?
A2 :那就看看[7]吧,建立AVD虚拟机时都会告诉你用的什么cpu构架,那么在“\OpenCV-2.4.6-android-sdk\apk”中选择对应的cpu架构的apk就OK啦。
Q3:NDK一般在官网上只会挂出来最新的SDK,NDK神马的,so老一点的NDK哪里下载呢?
A3:看看[8]吧
4、主要参考:
[2] http://docs.opencv.org/doc/tutorials/introduction/android_binary_package/O4A_SDK.html
[3] http://underthehood.blog.51cto.com/2531780/670169(第三部分的1节)
[4] http://stackoverflow.com/questions/11684674/open-cv-samples-prompt-for-opencv-manager-download
[5] http://stackoverflow.com/questions/10111747/how-to-install-apk-file-using-android-avd
[6] http://stackoverflow.com/questions/10111747/how-to-install-apk-file-using-android-avd
[7] http://stackoverflow.com/questions/11873098/error-running-android-app-that-uses-opencv
[8] http://stackoverflow.com/questions/18393873/old-versions-of-android-ndk?answertab=votes#tab-top