neuronalmotion / qtrpi

An easy-to-use environment to cross-compile Qt applications for Raspberry Pi from your desktop.
MIT License
104 stars 40 forks source link

Adding OpenCV library to qtrpi #78

Closed bagumondigi closed 6 years ago

bagumondigi commented 6 years ago

I have successful cross-compiled by follow instruction of 1st video, Thank you for your work, I'm very appreciate that :+1: Currently, I'm also working on opencv with Qt, I installed opencv on my host and also done a simple project (load image). So, I want to add opencv to qtrpi and using raspberry to load image but I don't know how to do that. I have read the 'Tutorial of init-qtrpi-full.sh' but I could not imagine the way to go ( The truth is I do not have much experience in library installation, the installation of opencv I did before is completely depend on step by step tutorial :( .. ) So, could you please teach me how to add opencv library to qtrpi ? thank you.

GuillaumeLazar commented 6 years ago

The QtRpi project only provides an easy-to-use way to cross-compile Qt for the RaspberryPi. OpenCV is clearly out of the scope of QtRpi.

Your task is not easy if you lack of experience in library and cross-compilation. However here are some tips to get Qt + OpenCV on Rpi:

  1. Keep in mind that all tasks (prepare, compilation, ..) can be done directly on your Rpi. The cross-compilation is only here to provide a convenient (and faster) way to develop and build your application.
  2. So you can do your first experiments on the Rpi directly. You will at first, avoid the cross-compile difficulties. Use only QtRpi for the Qt part for now.
  3. Prepare the Rpi (depedencies) and build OpenCV on the Rpi.
  4. Build an easy C++/OpenCV on your Rpi.
  5. Build an easy C++/Qt/OpenCV on your Rpi.
  6. Now that you know how to do it on a Rpi, you can update the file prepare-sysroot-full.sh with all your OpenCV stuff
  7. You should now be able to cross-compile a C++/Qt/OpenCV appliaction from your host

You should search for some generic tutorials to compile OpenCV on a raspberry pi (without the Qt or the cross-compilation part for now).

bagumondigi commented 6 years ago

Thank you, I will test these points :)