system used: MAC, remote server: Linux (UBuntu).
installing opencv to the server can accelerate the training speed and enhance the test function to a certain extent. Look up a few methods on the net all write too complex, oneself close test after feasible use the simplest language description record at this.
connect to the server with a terminal on the macbook and download opencv package from github:
git clone https://github.com/Itseez/opencv.git
git clone https://github.com/Itseez/opencv_contrib.git
download completed, opencv and opencv_contrib folders can be seen in your download directory, move opencv_contrib directory to opencv directory.
add the required dependency libraries:
sudo apt-get install build-essential
sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
done, use the CD command to enter the opencv directory, and then create a new folder:
mkdir build
goes into the build directory and starts compiling —
1. If your server has no anaconda pre-installed, execute:
cmake -D CMAKE_INSTALL_PREFIX=/usr/local -D CMAKE_BUILD_TYPE=Release -D OPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules ..
2. If you have anaconda on your server, there may be some conflicts. If you use the command above, a Makefile:160: recipe for target ‘all’ failed with an error. Just change it to:
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D BUILD_SHARED_LIBS=OFF -D WITH_OPENMP=ON -D ENABLE_PRECOMPILED_HEADERS=OFF ..
is followed by:
make -j8
After
is compiled, execute:
sudo make install
this way, we can use OPencv in Ubuntu for all languages. You can see the results of the opencv compilation under /usr/local/lib.
cd /usr/local/lib
ls
you can see that there is a large number of lib oepncv, on the stable!
p>
Read More:
- recipe for target ‘scripts/extract-cert‘ failed
- Recipe for target’Project 1.exe’ failed Cause analysis and solution
- Opencv problem: opencv error: assertion failed (! Empty()) in detectmultiscale
- [opencv + openvino] opencv-vino4.5.1 + opencv contrib installation
- Error report of xv6 operating system make Makefile:192 : * * solutions to receive comments before first target. Stop
- How to solve the problem of Cannot find module’npmlog’ when installing nodejs under Linux
- Error resolution-“Error in configuration process, project files may be invalid” appears when Cmake compiles openCV
- Linux running Makefile, G + + / GCC error: suffix or operations invalid for ‘vbroadcasts’
- Installing opencv Python in docker container
- Modify the screen resolution after installing Ubuntu 16.04 (xrandr: Failed to get size of gamma for output default)
- Solution to “the grub PC ‘package failed to install into / target / when installing Ubuntu server
- Installing swig on Linux
- Linux CentOS installing protobuf
- The problem of recipe terminated with error. Retry building the project. Occurs when vscode configures latex
- Installing GCC reduced version GCC 4.4.6 under Linux
- Opencv2.4.9 + ffmpeg1.2.12 installation configuration and problem solution under Ubuntu 14.04
- Opencv detection yolov4 target detection video stream error
- Installing open CV under Linux system
- Installing and uninstalling nodejs in Linux
- Installing zookeeper under Linux system