Ubuntu18.04下载OpenCV包
时间: 2023-10-10 17:06:24 浏览: 72
opencv下载和安装包
可以通过以下步骤在Ubuntu18.04下载OpenCV包:
1. 打开终端,执行以下命令更新软件包列表:
```
sudo apt update
```
2. 安装OpenCV依赖库:
```
sudo apt install build-essential cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
sudo apt install libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libdc1394-22-dev
```
3. Clone OpenCV库到本地:
```
git clone https://github.com/opencv/opencv.git
```
4. 切换到指定版本的分支(可选):
```
cd opencv
git checkout 版本号
```
5. 创建并进入build目录:
```
mkdir build && cd build
```
6. 配置OpenCV:
```
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
```
7. 编译:
```
make -j4
```
8. 安装:
```
sudo make install
```
安装完成后,可以在/usr/local/include和/usr/local/lib目录下找到OpenCV的头文件和库文件。
阅读全文