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. QT using OpenCV and camera with mobile phone

QT using OpenCV and camera with mobile phone

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
16 Posts 5 Posters 5.4k Views
  • 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.
  • D Offline
    D Offline
    Domididongo
    wrote on last edited by
    #1

    Hi, I want to make a mobile app witch uses the camera from the mobile phone and the OpenCV library for processing tasks on the gathered images. I am working on an MacBook Air with macOS Sierra version 10.12.2.

    I actually want to test my applications on the computer by using the webcam. And if the application works, than let the application run on the mobile simulator, than the device.

    For setting up OpenCV in OS X i used the following tutorial.

    It works fine and I also have access to my webcam an can use it. But if I want to build it for my mobile application, it sais: 'opencv development package not found'

    Also I have the question if there is a tutorial or a guide somewhere, where I can find how to set up my application, so it runs on the OS X with the webcam and on IOS, or any other mobile device, with the camera?

    benlauB 1 Reply Last reply
    0
    • D Domididongo

      Hi, I want to make a mobile app witch uses the camera from the mobile phone and the OpenCV library for processing tasks on the gathered images. I am working on an MacBook Air with macOS Sierra version 10.12.2.

      I actually want to test my applications on the computer by using the webcam. And if the application works, than let the application run on the mobile simulator, than the device.

      For setting up OpenCV in OS X i used the following tutorial.

      It works fine and I also have access to my webcam an can use it. But if I want to build it for my mobile application, it sais: 'opencv development package not found'

      Also I have the question if there is a tutorial or a guide somewhere, where I can find how to set up my application, so it runs on the OS X with the webcam and on IOS, or any other mobile device, with the camera?

      benlauB Offline
      benlauB Offline
      benlau
      Qt Champions 2016
      wrote on last edited by
      #2

      @Domididongo said in QT using OpenCV and camera with mobile phone:

      It works fine and I also have access to my webcam an can use it. But if I want to build it for my mobile application, it sais: 'opencv development package not found'

      You need to install OpenCV for Android / iOS. Depend on where you got the library, it may not come with pkg-config, so probably you need to setup the library per platform.

      1 Reply Last reply
      3
      • D Offline
        D Offline
        Domididongo
        wrote on last edited by
        #3

        How can I set up different library bindings in qmake?

        1 Reply Last reply
        0
        • GTDevG Offline
          GTDevG Offline
          GTDev
          wrote on last edited by
          #4

          You can add configuration blocks to the .pro file of your project for platform-specific settings, e.g. like this:

          android {
            # put settings here for Android configuration
          }
          
          ios {
            # put settings here for iOS configuration
          }
          

          You can use this feature to link different libraries for each platform (there are also conditions for other platforms, e.g. win32, macx, ...)

          Best,
          GT

          Senior Developer at Felgo - https://felgo.com/qt

          Develop mobile Apps for iOS & Android with Qt
          Felgo is an official Qt Technology Partner

          1 Reply Last reply
          3
          • D Offline
            D Offline
            Domididongo
            wrote on last edited by Domididongo
            #5

            I have now added this:

            osx{

            INCLUDEPATH += /usr/local/Cellar/opencv3/3.2.0/include/
            LIBS += -L/usr/local/Cellar/opencv3/3.2.0/lib -lopencv_core -lopencv_highgui -lopencv_imgproc -lopencv_flann -lopencv_features2d -lopencv_imgcodecs -lopencv_ml -lopencv_video -lopencv_videoio
            }

            ios{
            LIBS +=
            -F /usr/local/Frameworks/ios
            -framework opencv2

            }

            for the OS X part it works fine. But for the IOS it tells me:
            .../opencv2 does not contain bitcode.Your must rebuild it with bitcode enabled (Xcode setting EBALE_BITCODE).

            I tried to open the gilded Xcode project and set the Enable Bitcode to NO. But it won't help

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

              Hi,

              Did you compile OpenCV for iOS ?

              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
              • D Offline
                D Offline
                Domididongo
                wrote on last edited by
                #7

                I builded the framework like it was said here.

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

                  Which version of Xcode are you 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
                  • D Offline
                    D Offline
                    Domididongo
                    wrote on last edited by Domididongo
                    #9

                    I am using Xcode version 8.2.1 and cmake version 3.6.2

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

                      cmake or qmake ?

                      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
                      • D Offline
                        D Offline
                        Domididongo
                        wrote on last edited by
                        #11

                        cmake! for building the framework. The QT version I am using is QT5.8.0

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

                          Ok

                          As for the bitcode problem, I'd modify their python script to ensure that it's building with bitcode enabled.

                          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
                          • D Offline
                            D Offline
                            Domididongo
                            wrote on last edited by
                            #13

                            I looked in the '.../opencv/platforms/ios/build_framework.py' file. But which line should I change to enable Bitcode.

                            In line 47 is the class Builder, if I change 'self.bitcodedisabled = bitcodedisabled' to 'self.bitcodedisabled = 0' should that work?

                            jsulmJ 1 Reply Last reply
                            0
                            • D Domididongo

                              I looked in the '.../opencv/platforms/ios/build_framework.py' file. But which line should I change to enable Bitcode.

                              In line 47 is the class Builder, if I change 'self.bitcodedisabled = bitcodedisabled' to 'self.bitcodedisabled = 0' should that work?

                              jsulmJ Offline
                              jsulmJ Offline
                              jsulm
                              Lifetime Qt Champion
                              wrote on last edited by
                              #14

                              @Domididongo said in QT using OpenCV and camera with mobile phone:

                              self.bitcodedisabled = 0

                              self.bitcodedisabled = False
                              

                              https://forum.qt.io/topic/113070/qt-code-of-conduct

                              1 Reply Last reply
                              0
                              • D Offline
                                D Offline
                                Domididongo
                                wrote on last edited by
                                #15

                                So I changed now in line 276:
                                parser.add_argument('--disable-bitcode', default=False, dest='bitcodedisabled', action='store_false', help='disable bitcode (enabled by default)')

                                the action='store_true' to action='store_false',

                                and in line 58:
                                self.bitcodedisabled = bitcodedisabled to self.bitcodedisabled = False

                                but still getting the same error:
                                does not contain bitcode...

                                is there somewhere else something i have to change?

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

                                  Try adding set(CMAKE_XCODE_ATTRIBUTE_BITCODE_GENERATION_MODE "bitcode") to the iOS.cmake file.

                                  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

                                  • Login

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