Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Arm architecture opencv qt not working properly
Forum Updated to NodeBB v4.3 + New Features

Arm architecture opencv qt not working properly

Scheduled Pinned Locked Moved Unsolved General and Desktop
10 Posts 3 Posters 788 Views 2 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.
  • N Offline
    N Offline
    NoobDude12343
    wrote on last edited by NoobDude12343
    #1

    I'm trying to run my assignment on nano jetson, in doing so, i need to install opencv and qt, everything work fine (there's errors, still i manage to fix it all), after i run, the widget window open, but when i click in the button (on that widget) to open the image, nothing happended, i suspect i've done something wrong in the installing procedure, here's what i've done, please notify me if you see s.t suspicious:

    • i download opencv5.1.1 from git, extract it
    • install cmake and qt creator
    • configure cmake, i select native compiler, choose gcc++: aarch64-linux-gnu-g++, gcc: aarch64-linux-gnu-g++

    basically, i've done exactly like this tutorial https://www.youtube.com/watch?v=qA46fvP3O5A&t=197s

    my code:
    i add these in .pro file:
    #INCLUDEPATH += "usr/local/include/opencv4"
    LIBS += pkg-config --libs opencv4

    i add this function to mainwindow.cpp
    void MainWindow::on_pushButton_clicked()
    {
    cv::Mat test_image = cf::imread("test_img.jpg",0);

          if(!test_image.data)
          {
                    QMesaageBox msg;
                    msg.setText("could not load image");
                    msg.exe();
         }
         cv::namedWindow("test image", cv::WINDOW_AUTOSIZE);
         cv::imshow("test image", test_image);
    

    }

    the image is in my project folder

    the code doesn't give out any error, but when i hitton the show image button, it just didn't work. i'm devastated

    Pl45m4P 1 Reply Last reply
    0
    • N NoobDude12343

      I'm trying to run my assignment on nano jetson, in doing so, i need to install opencv and qt, everything work fine (there's errors, still i manage to fix it all), after i run, the widget window open, but when i click in the button (on that widget) to open the image, nothing happended, i suspect i've done something wrong in the installing procedure, here's what i've done, please notify me if you see s.t suspicious:

      • i download opencv5.1.1 from git, extract it
      • install cmake and qt creator
      • configure cmake, i select native compiler, choose gcc++: aarch64-linux-gnu-g++, gcc: aarch64-linux-gnu-g++

      basically, i've done exactly like this tutorial https://www.youtube.com/watch?v=qA46fvP3O5A&t=197s

      my code:
      i add these in .pro file:
      #INCLUDEPATH += "usr/local/include/opencv4"
      LIBS += pkg-config --libs opencv4

      i add this function to mainwindow.cpp
      void MainWindow::on_pushButton_clicked()
      {
      cv::Mat test_image = cf::imread("test_img.jpg",0);

            if(!test_image.data)
            {
                      QMesaageBox msg;
                      msg.setText("could not load image");
                      msg.exe();
           }
           cv::namedWindow("test image", cv::WINDOW_AUTOSIZE);
           cv::imshow("test image", test_image);
      

      }

      the image is in my project folder

      the code doesn't give out any error, but when i hitton the show image button, it just didn't work. i'm devastated

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on last edited by Pl45m4
      #2

      @NoobDude12343 said in Arm architecture opencv qt not working properly:

      LIB += pkg-config --libs opencv4

      It is LIBS not LIB

      • https://doc.qt.io/qt-5/third-party-libraries.html#library-files

      Do you include the right headers?


      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      1 Reply Last reply
      0
      • N Offline
        N Offline
        NoobDude12343
        wrote on last edited by
        #3

        sorry, my bad, it's a typo @Pl45m4 i believe i include the right headers

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

          Hi,

          @NoobDude12343 said in Arm architecture opencv qt not working properly:

          the image is in my project folder

          But your binary is not(for good reasons) and you are using a relative path for your file. Either copy the image beside your executable or use a QFileDialog to retrieve the path to the image.

          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
          1
          • N Offline
            N Offline
            NoobDude12343
            wrote on last edited by
            #5

            @SGaist pardon my slow-ness, but how can i copy the image beside my executable? and i get the path to my image by going diretly to that folder and open it in terminal, doing so, it will reveal my directory path, thus, i copied it. Am i mistaking something? thanks for your time

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

              No no, just use cp to copy your image from its current folder to where your executable is built.

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

                @SGaist i did just that, still nothing happended... perhap the problem lied somewhere else?

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

                  In your code add some checks to ensure that the file is there.

                  Maybe a silly question but, did you copy the file on your target ?

                  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
                  • N Offline
                    N Offline
                    NoobDude12343
                    wrote on last edited by
                    #9

                    thanks dude, i figure it out. Still coudn't open the image after click the button, but i when i tried other code, it worked. overall i have achieved my code to test whether or not qt opencv worked on my jetson

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

                      What did you implement to make it work ?

                      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