openCV/OpenCV-android-sdk/samples/tutorial-2-mixedprocessing 工程
- ::17.984: D/OpenCV/StaticHelper(): Trying to get library list
- ::17.984: E/OpenCV/StaticHelper(): OpenCV error: Cannot load info library for OpenCV
- ::17.984: D/OpenCV/StaticHelper(): Library list: ""
- ::17.984: D/OpenCV/StaticHelper(): First attempt to load libs
- ::17.984: D/OpenCV/StaticHelper(): Trying to init OpenCV libs
- ::17.984: D/OpenCV/StaticHelper(): Trying to load library opencv_java
- ::17.984: D/OpenCV/StaticHelper(): Cannot load library "opencv_java"
- ::17.994:
- ::17.994: W/System.err(): at java.lang.Runtime.loadLibrary(Runtime.java:)
- ::17.994: W/System.err(): at java.lang.System.loadLibrary(System.java:)
- ::17.994: W/System.err(): at org.opencv.android.StaticHelper.loadLibrary(StaticHelper.java:)
- ::17.994: W/System.err(): at org.opencv.android.StaticHelper.initOpenCVLibs(StaticHelper.java:)
- ::17.994: W/System.err(): at org.opencv.android.StaticHelper.initOpenCV(StaticHelper.java:)
- ::17.994: W/System.err(): at org.opencv.android.OpenCVLoader.initDebug(OpenCVLoader.java:)
- ::17.994: W/System.err(): at org.opencv.samples.tutorial2.Tutorial2Activity.onResume(Tutorial2Activity.java:)
- ::17.994: W/System.err(): at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:)
- ::17.994: W/System.err(): at android.app.Activity.performResume(Activity.java:)
- ::17.994: W/System.err(): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:)
- ::17.994: W/System.err(): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:)
- ::17.994: W/System.err(): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:)
- ::17.994: W/System.err(): at android.app.ActivityThread.access$(ActivityThread.java:)
- ::17.994: W/System.err(): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:)
- ::17.994: W/System.err(): at android.os.Handler.dispatchMessage(Handler.java:)
- ::17.994: W/System.err(): at android.os.Looper.loop(Looper.java:)
- ::17.994: W/System.err(): at android.app.ActivityThread.main(ActivityThread.java:)
- ::17.994: W/System.err(): at java.lang.reflect.Method.invokeNative(Native Method)
- ::17.994: W/System.err(): at java.lang.reflect.Method.invoke(Method.java:)
- ::17.994: W/System.err(): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:)
- ::17.994: W/System.err(): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:)
- ::17.994: W/System.err(): at dalvik.system.NativeStart.main(Native Method)
- ::17.994: D/OpenCV/StaticHelper(): First attempt to load libs fails
- ::17.994: D/OCVSample::Activity(): Internal OpenCV library not found. Using OpenCV Manager for initialization
- ::18.004: D/OpenCVManager/Helper(): Service connection created
- ::18.004: D/OpenCVManager/Helper(): Trying to get library path
- ::18.034: D/OpenCVManager/Helper(): Trying to get library list
- ::18.054: D/OpenCVManager/Helper(): Library list: ""
- ::18.054: D/OpenCVManager/Helper(): First attempt to load libs
- ::18.054: D/OpenCVManager/Helper(): Trying to init OpenCV libs
- ::18.054: D/OpenCVManager/Helper(): Trying to load library /data/app-lib/org.opencv.engine3-/libopencv_java.so
- ::18.054: D/dalvikvm(): Trying to load lib /data/app-lib/org.opencv.engine3-/libopencv_java.so 0x41f4beb0
- ::18.084: D/dalvikvm(): Added shared lib /data/app-lib/org.opencv.engine3-/libopencv_java.so 0x41f4beb0
- ::18.084: D/OpenCVManager/Helper(): OpenCV libs init was ok!
- ::18.084: D/OpenCVManager/Helper(): First attempt to load libs is OK
- ::18.084: I/OpenCVManager/Helper(): General configuration for OpenCV 3.0.-rc1 =====================================
- ::18.084: I/OpenCVManager/Helper(): Version control: 3.0.-rc1
- ::18.084: I/OpenCVManager/Helper(): Platform:
- ::18.084: I/OpenCVManager/Helper(): Host: Darwin 13.2. i386
- ::18.084: I/OpenCVManager/Helper(): Target: Linux armv7-a
- ::18.084: I/OpenCVManager/Helper(): CMake: 2.8.12.2
- ::18.084: I/OpenCVManager/Helper(): CMake generator: Ninja
- ::18.084: I/OpenCVManager/Helper(): CMake build tool: /usr/local/bin/ninja
- ::18.084: I/OpenCVManager/Helper(): Configuration: Release
- ::18.084: I/OpenCVManager/Helper(): C/C++:
- ::18.084: I/OpenCVManager/Helper(): Built as dynamic libs?: NO
- ::18.084: I/OpenCVManager/Helper(): C++ Compiler: /usr/local/bin/ccache /opt/android/android-ndk-r8e/toolchains/arm-linux-androideabi-4.7/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-g++ (ver 4.7)
- ::18.084: I/OpenCVManager/Helper(): C++ flags (Release): -fexceptions -frtti -fpic -Wno-psabi --sysroot=/opt/android/android-ndk-r8e/platforms/android-/arch-arm -funwind-tables -finline-limit= -fsigned-char -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=neon -fdata-sections -ffunction-sections -Wa,--noexecstack -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -fdiagnostics-show-option -fomit-frame-pointer -mfpu=neon -fvisibility=hidden -fvisibility-inlines-hidden -mthumb -fomit-frame-pointer -fno-strict-aliasing -O3 -DNDEBUG -DNDEBUG
- ::18.084: I/OpenCVManager/Helper(): C++ flags (Debug): -fexceptions -frtti -fpic -Wno-psabi --sysroot=/opt/android/android-ndk-r8e/platforms/android-/arch-arm -funwind-tables -finline-limit= -fsigned-char -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=neon -fdata-sections -ffunction-sections -Wa,--noexecstack -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -fdiagnostics-show-option -fomit-frame-pointer -mfpu=neon -fvisibility=hidden -fvisibility-inlines-hidden -marm -fno-omit-frame-pointer -fno-strict-aliasing -O0 -g -DDEBUG -D_DEBUG -O0 -DDEBUG -D_DEBUG
- ::18.084: I/OpenCVManager/Helper(): C Compiler: /usr/local/bin/ccache /opt/android/android-ndk-r8e/toolchains/arm-linux-androideabi-4.7/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-gcc
- ::18.084: I/OpenCVManager/Helper(): C flags (Release): -fexceptions -fpic -Wno-psabi --sysroot=/opt/android/android-ndk-r8e/platforms/android-/arch-arm -funwind-tables -finline-limit= -fsigned-char -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=neon -fdata-sections -ffunction-sections -Wa,--noexecstack -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -fdiagnostics-show-option -fomit-frame-pointer -mfpu=neon -fvisibility=hidden -mthumb -fomit-frame-pointer -fno-strict-aliasing -O3 -DNDEBUG -DNDEBUG
- ::18.084: I/OpenCVManager/Helper(): C flags (Debug): -fexceptions -fpic -Wno-psabi --sysroot=/opt/android/android-ndk-r8e/platforms/android-/arch-arm -funwind-tables -finline-limit= -fsigned-char -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=neon -fdata-sections -ffunction-sections -Wa,--noexecstack -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -fdiagnostics-show-option -fomit-frame-pointer -mfpu=neon -fvisibility=hidden -marm -fno-omit-frame-pointer -fno-strict-aliasing -O0 -g -DDEBUG -D_DEBUG -O0 -DDEBUG -D_DEBUG
- ::18.084: I/OpenCVManager/Helper(): Linker flags (Release): -Wl,--fix-cortex-a8 -Wl,--no-undefined -Wl,--gc-sections -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now
- ::18.084: I/OpenCVManager/Helper(): Linker flags (Debug): -Wl,--fix-cortex-a8 -Wl,--no-undefined -Wl,--gc-sections -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now
- ::18.084: I/OpenCVManager/Helper(): Precompiled headers: NO
- ::18.084: I/OpenCVManager/Helper(): OpenCV modules:
- ::18.084: I/OpenCVManager/Helper(): To be built: hal core flann imgproc ml photo video androidcamera imgcodecs shape videoio highgui objdetect superres ts features2d calib3d java stitching videostab
- ::18.084: I/OpenCVManager/Helper(): Disabled: world
- ::18.084: I/OpenCVManager/Helper(): Disabled by dependency: -
- ::18.084: I/OpenCVManager/Helper(): Unavailable: cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev python2 viz
- ::18.084: I/OpenCVManager/Helper(): Android:
- ::18.084: I/OpenCVManager/Helper(): Android ABI: armeabi-v7a with NEON
- ::18.084: I/OpenCVManager/Helper(): STL type: gnustl_static
- ::18.084: I/OpenCVManager/Helper(): Native API level: android-
- ::18.084: I/OpenCVManager/Helper(): SDK target: android-
- ::18.084: I/OpenCVManager/Helper(): Android NDK: /opt/android/android-ndk-r8e (toolchain: arm-linux-androideabi-4.7)
- ::18.084: I/OpenCVManager/Helper(): android tool: /opt/android/android-sdk-macosx/tools/android (Android SDK Tools, revision 24.1..)
- ::18.084: I/OpenCVManager/Helper(): Google Play package: YES
- ::18.084: I/OpenCVManager/Helper(): Android examples: YES
- ::18.084: I/OpenCVManager/Helper(): GUI:
- ::18.084: I/OpenCVManager/Helper(): GTK+: NO
- ::18.084: I/OpenCVManager/Helper(): GThread : NO
- ::18.084: I/OpenCVManager/Helper(): GtkGlExt: NO
- ::18.084: I/OpenCVManager/Helper(): OpenGL support: NO
- ::18.084: I/OpenCVManager/Helper(): VTK support: NO
- ::18.084: I/OpenCVManager/Helper(): Media I/O:
- ::18.084: I/OpenCVManager/Helper(): ZLib: z (ver 1.2.)
- ::18.084: I/OpenCVManager/Helper(): JPEG: build (ver )
- ::18.084: I/OpenCVManager/Helper(): WEBP: build (ver 0.3.)
- ::18.084: I/OpenCVManager/Helper(): PNG: build (ver 1.5.)
- ::18.084: I/OpenCVManager/Helper(): TIFF: build (ver - 4.0.)
- ::18.084: I/OpenCVManager/Helper(): JPEG : build (ver 1.900.)
- ::18.084: I/OpenCVManager/Helper(): OpenEXR: build (ver 1.7.)
- ::18.084: I/OpenCVManager/Helper(): GDAL: NO
- ::18.084: I/OpenCVManager/Helper(): Video I/O:
- ::18.084: I/OpenCVManager/Helper(): AndroidNativeCamera: YES, use prebuilt libraries
- ::18.084: I/OpenCVManager/Helper(): Other third-party libraries:
- ::18.084: I/OpenCVManager/Helper(): Use IPP: NO
- ::18.084: I/OpenCVManager/Helper(): Use Eigen: NO
- ::18.084: I/OpenCVManager/Helper(): Use TBB: YES (ver 4.1 interface )
- ::18.084: I/OpenCVManager/Helper(): Use OpenMP: NO
- ::18.084: I/OpenCVManager/Helper(): Use GCD NO
- ::18.084: I/OpenCVManager/Helper(): Use Concurrency NO
- ::18.084: I/OpenCVManager/Helper(): Use C=: NO
- ::18.084: I/OpenCVManager/Helper(): Use Cuda: NO
- ::18.084: I/OpenCVManager/Helper(): Use OpenCL: NO
- ::18.084: I/OpenCVManager/Helper(): Python :
- ::18.084: I/OpenCVManager/Helper(): Interpreter: /usr/bin/python2. (ver 2.7.)
- ::18.084: I/OpenCVManager/Helper(): Python :
- ::18.094: I/OpenCVManager/Helper(): Interpreter: NO
- ::18.094: I/OpenCVManager/Helper(): Python (for build): /usr/bin/python2.
- ::18.094: I/OpenCVManager/Helper(): Java:
- ::18.094: I/OpenCVManager/Helper(): ant: /usr/local/bin/ant (ver 1.9.)
- ::18.094: I/OpenCVManager/Helper(): Java wrappers: YES
- ::18.094: I/OpenCVManager/Helper(): Java tests: YES
- ::18.094: I/OpenCVManager/Helper(): Matlab:
- ::18.094: I/OpenCVManager/Helper(): mex: NO
- ::18.094: I/OpenCVManager/Helper(): Documentation:
- ::18.094: I/OpenCVManager/Helper(): Doxygen: NO
- ::18.094: I/OpenCVManager/Helper(): PlantUML: NO
- ::18.094: I/OpenCVManager/Helper(): Tests and samples:
- ::18.094: I/OpenCVManager/Helper(): Tests: YES
- ::18.094: I/OpenCVManager/Helper(): Performance tests: YES
- ::18.094: I/OpenCVManager/Helper(): C/C++ Examples: NO
- ::18.094: I/OpenCVManager/Helper(): Install path: /builds/master_pack-android/build/o4a/install
- ::18.094: I/OpenCVManager/Helper(): cvconfig.h is in: /builds/master_pack-android/build/o4a
- ::18.094: I/OpenCVManager/Helper(): -----------------------------------------------------------------
- ::18.094: D/OpenCVManager/Helper(): Init finished with status
- ::18.094: D/OpenCVManager/Helper(): Unbind from service
- ::18.094: D/OpenCVManager/Helper(): Calling using callback
- ::18.094: I/OCVSample::Activity(): OpenCV loaded successfully
- ::18.094: D/AndroidRuntime(): Shutting down VM
- ::18.094: W/dalvikvm(): threadid=: thread exiting with uncaught exception (group=0x415a9898)
里边有warning:
W/System.err(): java.lang.UnsatisfiedLinkError: Couldn't load opencv_java from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/org.opencv.samples.tutorial2-2.apk"],nativeLibraryDirectories=[/data/app-lib/org.opencv.samples.tutorial2-2, /vendor/lib, /system/lib]]]: findLibrary returned null
是获取本地liabrary失效,改为通过OpenCVManager获取opencv_java 库。成功
以下error是OpenCV初始化成功以后,又加载了mixed_sample库。报错。
- ::18.104: E/AndroidRuntime(): FATAL EXCEPTION: main
- ::18.104: E/AndroidRuntime(): java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/org.opencv.samples.tutorial2-2.apk"],nativeLibraryDirectories=[/data/app-lib/org.opencv.samples.tutorial2-, /vendor/lib, /system/lib]]]: findLibrary returned null
- ::18.104: E/AndroidRuntime(): at java.lang.Runtime.loadLibrary(Runtime.java:)
- ::18.104: E/AndroidRuntime(): at java.lang.System.loadLibrary(System.java:)
- ::18.104: E/AndroidRuntime(): at org.opencv.samples.tutorial2.Tutorial2Activity$.onManagerConnected(Tutorial2Activity.java:)
- ::18.104: E/AndroidRuntime(): at org.opencv.android.AsyncServiceHelper$.onServiceConnected(AsyncServiceHelper.java:)
- ::18.104: E/AndroidRuntime(): at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:)
- ::18.104: E/AndroidRuntime(): at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:)
- ::18.104: E/AndroidRuntime(): at android.os.Handler.handleCallback(Handler.java:)
- ::18.104: E/AndroidRuntime(): at android.os.Handler.dispatchMessage(Handler.java:)
- ::18.104: E/AndroidRuntime(): at android.os.Looper.loop(Looper.java:)
- ::18.104: E/AndroidRuntime(): at android.app.ActivityThread.main(ActivityThread.java:)
- ::18.104: E/AndroidRuntime(): at java.lang.reflect.Method.invokeNative(Native Method)
- ::18.104: E/AndroidRuntime(): at java.lang.reflect.Method.invoke(Method.java:)
- ::18.104: E/AndroidRuntime(): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:)
- ::18.104: E/AndroidRuntime(): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:)
- ::18.104: E/AndroidRuntime(): at dalvik.system.NativeStart.main(Native Method)
case LoaderCallbackInterface.SUCCESS:
{
Log.i(TAG, "OpenCV loaded successfully"); // Load native library after(!) OpenCV initialization
System.loadLibrary("mixed_sample"); //如果注释了这个加载。会导致菜单功能的最后一项不可用。
mOpenCvCameraView.enableView();
} break;
在目录下执行ndk-build。生成了obj文件夹。并且在libs/armeabi-v7a/目录下生成了libmixed_sample.so
再运行工程。成功
06-04 11:10:16.054: D/dalvikvm(10433): Trying to load lib /data/app-lib/org.opencv.samples.tutorial2-1/libmixed_sample.so 0x41f52568
06-04 11:10:16.054: D/dalvikvm(10433): Shared lib '/data/app-lib/org.opencv.samples.tutorial2-1/libmixed_sample.so' already loaded in same CL 0x41f52568