We’re going to install Open CV library (v3.4.0) in ubuntu 18.04 LTS. It’s easy to follow commands. After install, check it as testing C++ code.
Open terminal window. And update apt-get.
Install & build library. Notice the dependency between libraries.
Download source codes and unpack.
Using cmake, create a Makefile.
Installation OpenCV 3.4
Now the installation is complete. The last sentence brings you to “3.4.0”.
Here is the example C++ code to check the installation is problem-free.
Download any image and put it into your work directory. Don’t forget to rename your image file. When you compile the C++ code, you should use these compile options. It seems to be easier if using Makefile.
g++ main.cpp `pkg-config — cflags — libs opencv`
Finally you can see image!!