Major OpenCV-Android for Windows Installing and Running Issues.

442 views
Skip to first unread message

epsilonorion

unread,
Apr 8, 2012, 5:15:30 PM4/8/12
to android...@googlegroups.com
I first installed the OpenCV-Android setup as described in the following tutorial.

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

This went with no issues.  Everything is installed and I have tested the applications with an AVD.  I went to test on my Droid X and ran into issues where all I had was a black screen for the viewer.  After doing some research I found that this was a known issue that some people have had problems with.  I continued attempts, including getting the NDK setup for native programming using the following tutorial.

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

This had its own issues which are posted below under the ERROR tag.

After doing more research I attempted an install following the different tutorials found under a standford class website.  I decided to try this route since they were using a Motorola Droid (OG) for their purposes.

>> http://www.stanford.edu/class/ee368/Android/

Tutorial 1 went off with no issues and the histogram view worked great.  However, I am having issues with tutorial 2 given that it is outdated.  I have attempted installing OpenCV-Android according to the tutorial and the OpenCV Trunk website.  I installed CMake, GNU Make, and the NDK and set their paths inside the wincfg.cmd file.  I know of a way to build the standard OpenCV package using visual studio, however I haven't found a method for building and android package with visual studio or eclipse.  I used the command prompt through windows and ran the cmake_android.cmd script.  OpenCV-Android built with no warnings, however, I did not see the jni directory anywhere (as mentioned in the tutorial).  This script does not seem to generate a CMakeLists file to edit, so I got stuck there.  I then tried to install using cygwin and the cmake_android.sh script, however, it seems to be heavily tied to the Linux kernel.  At this point, I decided to check the OpenCV Superpack file from the website which I have used before for OpenCV applications for windows.  The pre-compiled build for android did have a jni directory. 

My problem comes down to, what is the best way to get the OpenCV Android libraries and such setup for working?  Going straight windows building doesn't give me options, however cygwin has its own limitations.  I can go with the prebuilt Superpack, however I can not change anything if desired.  Has anyone with Windows gone a route beyond the Superpack?  Thank you for any help you provide.

ERROR

04-08 21:15:01.485: I/Sample::Activity(360): Instantiated new class org.opencv.samples.tutorial3.Sample3Native
04-08 21:15:01.485: I/Sample::Activity(360): onCreate
04-08 21:15:01.546: W/dalvikvm(360): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lorg/opencv/samples/tutorial3/Sample3View;
04-08 21:15:01.546: D/AndroidRuntime(360): Shutting down VM
04-08 21:15:01.546: W/dalvikvm(360): threadid=1: thread exiting with uncaught exception (group=0x40015560)
04-08 21:15:01.585: E/AndroidRuntime(360): FATAL EXCEPTION: main
04-08 21:15:01.585: E/AndroidRuntime(360): java.lang.ExceptionInInitializerError
04-08 21:15:01.585: E/AndroidRuntime(360):     at org.opencv.samples.tutorial3.Sample3Native.onCreate(Sample3Native.java:21)
04-08 21:15:01.585: E/AndroidRuntime(360):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
04-08 21:15:01.585: E/AndroidRuntime(360):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
04-08 21:15:01.585: E/AndroidRuntime(360):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
04-08 21:15:01.585: E/AndroidRuntime(360):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)
04-08 21:15:01.585: E/AndroidRuntime(360):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
04-08 21:15:01.585: E/AndroidRuntime(360):     at android.os.Handler.dispatchMessage(Handler.java:99)
04-08 21:15:01.585: E/AndroidRuntime(360):     at android.os.Looper.loop(Looper.java:123)
04-08 21:15:01.585: E/AndroidRuntime(360):     at android.app.ActivityThread.main(ActivityThread.java:3683)
04-08 21:15:01.585: E/AndroidRuntime(360):     at java.lang.reflect.Method.invokeNative(Native Method)
04-08 21:15:01.585: E/AndroidRuntime(360):     at java.lang.reflect.Method.invoke(Method.java:507)
04-08 21:15:01.585: E/AndroidRuntime(360):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
04-08 21:15:01.585: E/AndroidRuntime(360):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
04-08 21:15:01.585: E/AndroidRuntime(360):     at dalvik.system.NativeStart.main(Native Method)
04-08 21:15:01.585: E/AndroidRuntime(360): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load native_sample: findLibrary returned null
04-08 21:15:01.585: E/AndroidRuntime(360):     at java.lang.Runtime.loadLibrary(Runtime.java:429)
04-08 21:15:01.585: E/AndroidRuntime(360):     at java.lang.System.loadLibrary(System.java:554)
04-08 21:15:01.585: E/AndroidRuntime(360):     at org.opencv.samples.tutorial3.Sample3View.<clinit>(Sample3View.java:27)
04-08 21:15:01.585: E/AndroidRuntime(360):     ... 14 more

Reply all
Reply to author
Forward
0 new messages