openCV3安装指南
Posted 转换无极限
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了openCV3安装指南相关的知识,希望对你有一定的参考价值。
这里主要对openCV官网的《Installation in Linux》文档进行了翻译和解释
原文见:https://docs.opencv.org/3.4.1/doc/tutorials/introduction/linux_install/linux_install.html#linux-installation
Required Packages(需求包)
- GCC 4.4.x or later
- CMake 2.6 or higher
- Git
- GTK+2.x or higher, including headers (libgtk2.0-dev)
- pkg-config
- Python 2.6 or later and Numpy 1.5 or later with developer packages (python-dev, python-numpy)
- ffmpeg or libav development packages: libavcodec-dev, libavformat-dev, libswscale-dev
- [optional] libtbb2 libtbb-dev
- [optional] libdc1394 2.x
- [optional] 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
第一行是编译器,第二行是必须包,第三号是可选的
第二步是下载源码,包括GIT和.zip包下载,zip源码链接为:http://github.com/opencv/opencv
解压后,切换到源码目录
新建build目录
mkdir build cd ./build
使用cmake生成Makefile文件
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
然后就是make和make install
make -j8 sudo make install
安装后的测试,请见下一节
以上是关于openCV3安装指南的主要内容,如果未能解决你的问题,请参考以下文章
ubuntu16.04安装opencv3.4.1及卸载,以及opencv与anaconda相关问题,import cv2,no module named cv2填坑指南
ubuntu16.04安装opencv3.4.1及卸载,以及opencv与anaconda相关问题,import cv2,no module named cv2填坑指南
ubuntu18.04+ opencv3.1+caffe-ssd安装