Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. [solved]How do I configure Qt 5.3 for Android opencv 2.4.9 ? (on mac os x)
Forum Updated to NodeBB v4.3 + New Features

[solved]How do I configure Qt 5.3 for Android opencv 2.4.9 ? (on mac os x)

Scheduled Pinned Locked Moved Mobile and Embedded
21 Posts 4 Posters 12.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    ismail_gz
    wrote on last edited by
    #5

    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.so

    Unable to start "org.qtproject.example.OpencvAndroTest2".

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #6

      There's something that puzzles me, why do you have

      @CONFIG+=link_pkgconfig PKGCONFIG+=opencv@

      since you already link to the static libraries ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • I Offline
        I Offline
        ismail_gz
        wrote on last edited by
        #7

        You're right but I already deleted that line. Despite this occurred error.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #8

          Did you do a full rebuild ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • I Offline
            I Offline
            ismail_gz
            wrote on last edited by
            #9

            Yes, I did

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #10

              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 ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • I Offline
                I Offline
                ismail_gz
                wrote on last edited by
                #11

                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;
                }@

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #12

                  Wild guess but I'd say that either namedWindow, imshow or both are not implemented for android

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • I Offline
                    I Offline
                    ismail_gz
                    wrote on last edited by
                    #13

                    Could you recommend a sample code.

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #14

                      Not really, since you are currently using OpenCV only code, you should rather ask on the OpenCV forum for their support on android

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      0
                      • J Offline
                        J Offline
                        johnthesoftware
                        wrote on last edited by
                        #15

                        Did you resolve this? I'm about to try the same thing on Fedora.

                        1 Reply Last reply
                        0
                        • J Offline
                          J Offline
                          johnthesoftware
                          wrote on last edited by
                          #16

                          Did you resolve this? I'm about to try the same thing on Fedora.

                          1 Reply Last reply
                          0
                          • I Offline
                            I Offline
                            ismail_gz
                            wrote on last edited by
                            #17

                            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.

                            1 Reply Last reply
                            0
                            • I Offline
                              I Offline
                              ismail_gz
                              wrote on last edited by
                              #18

                              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.

                              1 Reply Last reply
                              0
                              • I Offline
                                I Offline
                                ismail_gz
                                wrote on last edited by
                                #19

                                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.

                                1 Reply Last reply
                                0
                                • I Offline
                                  I Offline
                                  ismail_gz
                                  wrote on last edited by
                                  #20

                                  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.

                                  1 Reply Last reply
                                  0
                                  • A Offline
                                    A Offline
                                    amahta
                                    wrote on last edited by
                                    #21

                                    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/

                                    Thou shalt programme
                                    http://www.amin-ahmadi.com

                                    1 Reply Last reply
                                    0

                                    • Login

                                    • Login or register to search.
                                    • First post
                                      Last post
                                    0
                                    • Categories
                                    • Recent
                                    • Tags
                                    • Popular
                                    • Users
                                    • Groups
                                    • Search
                                    • Get Qt Extensions
                                    • Unsolved