[solved]How do I configure Qt 5.3 for Android opencv 2.4.9 ? (on mac os x)
-
I corrected some errors. Now deploying project but did not work application.
This is my application output:Starting remote process.D/dalvikvm( 7123): Zygote::ForkAndSpecialize : 0
E/cutils ( 7123): to chown(/mnt/shell/emulated/0, 0, 0)
E/cutils ( 7123): to chown(/mnt/shell/emulated/obb, 0, 0)
E/cutils ( 7123): to chown(/storage/emulated/0/Android, 0, 0)
E/cutils ( 7123): to chown(/storage/emulated/0/Android/obb, 0, 0)
D/dalvikvm( 7123): zygote get new systemTid : 7123
D/dalvikvm( 7123): Late-enabling CheckJNI
D/dalvikvm( 7123): threadid=2: interp stack at 0x4f6f6000
D/dalvikvm( 7123): threadid=3: interp stack at 0x4f7fe000
D/jdwp ( 7123): prepping for JDWP over ADB
D/jdwp ( 7123): ADB transport startup
D/dalvikvm( 7123): Elevating priority from 0 to -8
D/dalvikvm( 7123): threadid=4: interp stack at 0x4f906000
D/jdwp ( 7123): JDWP: thread running
D/jdwp ( 7123): acceptConnection
D/jdwp ( 7123): trying to receive file descriptor from ADB
D/dalvikvm( 7123): threadid=5: interp stack at 0x54646000
D/dalvikvm( 7123): zygote get thread init done
D/dalvikvm( 7123): create interp thread : stack size=32KB
D/dalvikvm( 7123): create new thread
D/dalvikvm( 7123): new thread created
D/dalvikvm( 7123): update thread list
D/dalvikvm( 7123): threadid=6: interp stack at 0x5464e000
D/dalvikvm( 7123): threadid=6: created from interp
D/dalvikvm( 7123): start new thread
D/dalvikvm( 7123): create interp thread : stack size=32KB
D/dalvikvm( 7123): create new thread
D/dalvikvm( 7123): new thread created
D/dalvikvm( 7123): update thread list
D/dalvikvm( 7123): threadid=6: notify debugger
D/dalvikvm( 7123): threadid=6 (ReferenceQueueDaemon): calling run()
D/dalvikvm( 7123): threadid=7: interp stack at 0x54756000
D/dalvikvm( 7123): threadid=7: created from interp
D/dalvikvm( 7123): start new thread
D/dalvikvm( 7123): create interp thread : stack size=32KB
D/dalvikvm( 7123): create new thread
D/dalvikvm( 7123): new thread created
D/dalvikvm( 7123): update thread list
D/dalvikvm( 7123): threadid=7: notify debugger
D/dalvikvm( 7123): threadid=7 (FinalizerDaemon): calling run()
D/dalvikvm( 7123): threadid=8: interp stack at 0x5485e000
D/dalvikvm( 7123): threadid=8: created from interp
D/dalvikvm( 7123): start new thread
D/dalvikvm( 7123): threadid=8: notify debugger
D/dalvikvm( 7123): threadid=8 (FinalizerWatchdogDaemon): calling run()
D/dalvikvm( 7123): threadid=9: interp stack at 0x54c64000
D/dalvikvm( 7123): threadid=10: interp stack at 0x54d6c000
D/dalvikvm( 7123): open_cached_dex_file : /data/app/org.qtproject.example.OpencvAndroTest2-1.apk /data/dalvik-cache/data@app@org.qtproject.example.OpencvAndroTest2-1.apk@classes.dex
D/skia ( 7123): Flag is not 10
D/skia ( 7123): Flag is not 10
D/skia ( 7123): Flag is not 10
D/skia ( 7123): Flag is not 10
D/skia ( 7123): Flag is not 10
D/skia ( 7123): Flag is not 10
D/skia ( 7123): Flag is not 10
D/skia ( 7123): Flag is not 10
D/dalvikvm( 7123): Trying to load lib /data/data/org.qtproject.example.OpencvAndroTest2/lib/libgnustl_shared.so 0x414215c8
D/dalvikvm( 7123): Added shared lib /data/data/org.qtproject.example.OpencvAndroTest2/lib/libgnustl_shared.so 0x414215c8
D/dalvikvm( 7123): No JNI_OnLoad found in /data/data/org.qtproject.example.OpencvAndroTest2/lib/libgnustl_shared.so 0x414215c8, skipping init
D/dalvikvm( 7123): Trying to load lib /data/data/org.qtproject.example.OpencvAndroTest2/lib/libopencv_java.so 0x414215c8
D/dalvikvm( 7123): Added shared lib /data/data/org.qtproject.example.OpencvAndroTest2/lib/libopencv_java.so 0x414215c8
D/dalvikvm( 7123): Trying to load lib /data/data/org.qtproject.example.OpencvAndroTest2/lib/libopencv_info.so 0x414215c8
D/dalvikvm( 7123): Added shared lib /data/data/org.qtproject.example.OpencvAndroTest2/lib/libopencv_info.so 0x414215c8
D/dalvikvm( 7123): No JNI_OnLoad found in /data/data/org.qtproject.example.OpencvAndroTest2/lib/libopencv_info.so 0x414215c8, skipping init
D/dalvikvm( 7123): Trying to load lib /data/data/org.qtproject.example.OpencvAndroTest2/lib/libQt5Core.so 0x414215c8
D/dalvikvm( 7123): Added shared lib /data/data/org.qtproject.example.OpencvAndroTest2/lib/libQt5Core.so 0x414215c8
D/dalvikvm( 7123): Trying to load lib /data/data/org.qtproject.example.OpencvAndroTest2/lib/libQt5Gui.so 0x414215c8
D/dalvikvm( 7123): Added shared lib /data/data/org.qtproject.example.OpencvAndroTest2/lib/libQt5Gui.so 0x414215c8
D/dalvikvm( 7123): No JNI_OnLoad found in /data/data/org.qtproject.example.OpencvAndroTest2/lib/libQt5Gui.so 0x414215c8, skipping init
D/dalvikvm( 7123): Trying to load lib /data/data/org.qtproject.example.OpencvAndroTest2/qt-reserved-files/plugins/platforms/android/libqtforandroid.so 0x414215c8
D/dalvikvm( 7123): Added shared lib /data/data/org.qtproject.example.OpencvAndroTest2/qt-reserved-files/plugins/platforms/android/libqtforandroid.so 0x414215c8
I/Qt ( 7123): qt start
D/dalvikvm( 7123): Trying to load lib /data/app-lib/org.qtproject.example.OpencvAndroTest2-1/libOpencvAndroTest2.so 0x414215c8
D/dalvikvm( 7123): Added shared lib /data/app-lib/org.qtproject.example.OpencvAndroTest2-1/libOpencvAndroTest2.so 0x414215c8
D/dalvikvm( 7123): No JNI_OnLoad found in /data/app-lib/org.qtproject.example.OpencvAndroTest2-1/libOpencvAndroTest2.so 0x414215c8, skipping init
E/cv::error()( 7123): OpenCV Error: Unspecified error (The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script) in cvNamedWindow, file /home/reports/ci/slave_desktop/50-SDK/opencv/modules/highgui/src/window.cpp, line 483
F/libc ( 7123): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 7139 (pencvAndroTest2)
D/libEGL ( 7123): loaded /vendor/lib/egl/libEGL_mtk.so
D/libEGL ( 7123): loaded /vendor/lib/egl/libGLESv1_CM_mtk.so
D/libEGL ( 7123): loaded /vendor/lib/egl/libGLESv2_mtk.soUnable to start "org.qtproject.example.OpencvAndroTest2".
-
There's something that puzzles me, why do you have
@CONFIG+=link_pkgconfig PKGCONFIG+=opencv@
since you already link to the static libraries ?
-
Did you do a full rebuild ?
-
Re-reading your error, it seems you are using a method that is not implement for android. Can you share the OpenCV code you are using ?
-
it's a simple code:
@#include "opencv2/opencv.hpp"
#include "opencv2/highgui/highgui.hpp"using namespace cv;
int main(int argc, char *argv[])
{
namedWindow("output",1);
Mat output = Mat::zeros(120,350,CV_8UC3);
putText(output,"Hello world :)", cvPoint(15,70), FONT_HERSHEY_PLAIN,3,cvScalar(0,255,0),4);
imshow("Output",output);
waitKey(0);
return 0;
}@ -
Wild guess but I'd say that either namedWindow, imshow or both are not implemented for android
-
Not really, since you are currently using OpenCV only code, you should rather ask on the OpenCV forum for their support on android
-
Did you resolve this? I'm about to try the same thing on Fedora.
-
Did you resolve this? I'm about to try the same thing on Fedora.
-
No, I couldn't yet. My main problem is sample code at the moment. I couldn't find sample code about this subject. But I found configurations from this "link":http://stackoverflow.com/questions/27562311/how-to-integrate-opencv-into-qt-creator-android-project
I hope that helps. -
No, I couldn't yet. My main problem is sample code at the moment. I couldn't find sample code about this subject. But I found configurations from this "link":http://stackoverflow.com/questions/27562311/how-to-integrate-opencv-into-qt-creator-android-project
I hope that helps. -
Finally, I found it. Configurations are my previous reply. And you must copy libnative_camera_r4.2.0.so(must be compatible with the your android version(this is important)) to project_root/android/libs/armeabi-v7a/ .
Then you can watch "this":https://www.youtube.com/watch?v=0ONxIy8itRA video for source code. -
Finally, I found it. Configurations are my previous reply. And you must copy libnative_camera_r4.2.0.so(must be compatible with the your android version(this is important)) to project_root/android/libs/armeabi-v7a/ .
Then you can watch "this":https://www.youtube.com/watch?v=0ONxIy8itRA video for source code. -
This is already solved but anyway here is how I do it all the time:
http://amin-ahmadi.com/2015/06/23/opencv-qt-android-adding-required-libraries-and-includes/