RobD3862
Posts: 1
Joined: Mon Jun 22, 2020 1:37 pm

Qt creator and Opencv

Mon Jun 22, 2020 1:51 pm

Hi I am looking to build a gui with Qt creator and OpenCV. I have Pi4 B+ I had Qt creator built for cross compile from a VM but I could not get OpenCV to work with it, I had no headers I tried a number of fixes but none worked. I am starting fresh and wonder which way would be best to combine Qt and OpenCV for the Pi. Should I build both for cross compile in a VM or build on the pi. I have OpenCV 4.3.0 working on the Pi at present. Any pointers would be welcome I am not that experienced with the pi and this type of set up and am wondering what should I set the the build to help both programs to work together?

Heater
Posts: 15949
Joined: Tue Jul 17, 2012 3:02 pm

Re: Qt creator and Opencv

Mon Jun 22, 2020 11:03 pm

Personally I would not try to cross compile all this. Cross compiling makes the whole process a thousand times more difficult. Also why not use Qt 5?

Just install Qt 5 and opencv on to the Pi. You will need to install the opencv development package:

Code: Select all

$ sudo apt-get install libopencv-dev 
If you do "apt-cache search opencv | grep dev" that will show you a bunch of other opencv packages you may need for various functionalities.

Similarly for Qt:

Code: Select all

$sudo apt-get install qt5-default
[code]
Or is it:
[code]
$sudo apt-get install qt5-qtbase5-dev  qtbase5-dev-tools
[code]
I forget now.

Of course you could also use the qtcreator IDE:
[code]
$ sudo apt-get install qtcreator
Which will pull in everything for Qt you need.
Memory in C++ is a leaky abstraction .

Return to “General discussion”