OpenCV——Install in Linux OS
2017-05-09 16:18
330 查看
1. download and install some dependences below first
BRIEF OPERATION
[common when you have a stable net invironment]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
[compiler] sudo apt-get install build-essential
[required] sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
[optional] sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
2. then download opencv3.2.zip && ippicv_linux_20151201.tgz(search on baidu,which will be used soon)
3. make a new folder named ‘build’ and then cd into it
4. run below command to develop and generate
sudo cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..
5. just makesudo make -j4
j4 means make by 4 thread,which can accelarates your process.The number of thread takes from your PC’s hardware.
Maybe you will meet problems when you make,if so,please run a step4-alike command:
sudo cmake -D CMAKE_BUILD_TYPE=RELEASE -D WITH_EIGEN=OFF -DCMAKE_INSTALL_PREFIX = /usr/local/opencv/3.20 ..
6. just make install
sudo make install
7. after those above,you have done all of work in thory.Then you can find and test your mechine by a simple example like shown:
#include <opencv2/opencv.hpp> using namespace cv; int main() { Mat srcImage = imread("test.png"); namedWindow("test"); imshow("test",srcImage); waitKey(0); return 0; }
8.compile and run the test
g++ test.cpp `pkg-config --cflags --libs opencv` -o test ./test
9.DeError
if you don’t be warning for errors while compiling but running,then you must follow me
//opoen the configuration file sudo gedit /etc/ld.so.conf //add a new line /usr/loacal/lib //update configuration sudo ldconfig //open an another anyway file sudo gedit /etc/bash.bashrc //add lines as below following the present part PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig export PKG_CONFIG_PATH //then update the contains source /etc/bash.bashrc
then you have done what you can do best and your machine can run normally in most cases
相关文章推荐
- Install Mysql in Linux OS
- Install openCV in Linux
- Install OpenCv for python in Linux
- Install a new Linux Kernel (3.10.56) in Guest OS (Dom U)
- install pyssh module in linux OS
- How to install multi OS(Windows/Linux) in one PC box and boot them easily
- How should we learn configure software in linux OS
- qmail install in SUSE linux
- hwo to install apache+mysql+php in linux as 5
- install fms in linux: error: if you have warned ERROR: Your distribution, unknown, is not supported by this
- Install CodeBlocks in Linux
- Install vmware tools in debian linux
- install vmware tools in fedora7.0 linux(install successly)
- configure make make install in linux
- [OS]Assembly in Linux Kernel
- How to install oracle 10g for Linux in ubuntu
- Install VMware Tools in Linux
- (原創) 如何在Linux下編譯OpenCV? (OS) (Linux) (CentOS) (Image Processing) (C/C++)
- after install oracle 10g express edition in linux
- install mysql and gcc in linux as 4.5 use INSTALL-BINARY version