OpenCV on Android Using Eclipse

帅比萌擦擦* 提交于 2020-01-09 09:16:27

问题


I'm having a hell of a time importing OpenCV into my Android project. I've already tried this tutorial:

http://opencv.itseez.com/doc/tutorials/introduction/android_binary_package/android_binary_package.html

and it did not work because Eclipse would not recognize the existing projects in the directory. So after much searching I came across this trunk:

https://code.ros.org/svn/opencv/trunk/opencv/

and was able to import it into my workspace in Eclipse. Eclipse now recognizes the sample projects, but now the problem is that there are no OpenCV library files. So all the calls to import different classes result in errors. Shouldn't there be a opencv.jar somewhere? I've seen various posts that mention having to build the library but unfortunately I don't have the slightest clue how to do that. I need something with step by step instructions. I'm running Windows 7 64-bit.

Thanks!


回答1:


You should download the latest OpenCV 4 Android here:

http://opencv.org/downloads.html

And read these tutorials to get you started (in this order roughly):

Introduction into Android Development

OpenCV4Android SDK

Android Development with OpenCV

OpenCV4Android Reference




回答2:


If you want to use OPEN CV in your android apps, for example if you need to read some strings from an image in your android and you are new in using OPEN CV. Then download the pre-built OpenCV library for Android from here:
http://sourceforge.net/projects/opencvlibrary/files/opencv-android/2.3/

After downloading, import OpenCV-2.3.1 into Eclipse using File-->Import...-->General-->Existing Project Into Workspace.

In your project's properties, Under Android, add the OpenCV2.3.1 library (press Add.. on the right and select OpenCV2.3.1).

            Good luck!



回答3:


You might want to take a look at this project: https://github.com/billmccord/OpenCV-Android

I was able to run opencv applications on my android phone with the help of this port.




回答4:


installed the Win-superpack? I recommend getting the latest .tar, extract and use it. Worked for me.




回答5:


I posted about this on a duplicate question. Make sure you have the android NDK installed! Or, consider using JavaCV instead. It is much easier to install.



来源:https://stackoverflow.com/questions/7991621/opencv-on-android-using-eclipse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!