ubuntu安装opencv教程
时间: 2023-08-10 08:06:48 浏览: 127
Opencv安装教程
5星 · 资源好评率100%
安装OpenCV的步骤如下:
1. 下载OpenCV和OpenCV_contrib的压缩包,并将opencv_contrib文件夹放入解压后的opencv文件夹中。\[1\]
2. 安装必要的依赖项,可以使用以下命令:
```
sudo apt-get install build-essential cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
```
\[1\]
3. 进入opencv文件夹,在build文件夹下执行cmake命令:
```
cd opencv
mkdir build
cd build
cmake ..
```
\[2\]
4. 执行make命令进行编译:
```
make
```
\[3\]
5. 安装OpenCV库:
```
sudo make install
```
\[3\]
6. 配置OpenCV的编译环境,将OpenCV的库添加到路径中:
```
sudo gedit /etc/ld.so.conf.d/opencv.conf
```
在打开的文件中添加以下内容:
```
/usr/local/lib
```
保存并关闭文件。
7. 更新库配置:
```
sudo ldconfig
```
完成以上步骤后,您的Ubuntu系统就成功安装了OpenCV。请注意,这只是一个简单的安装教程,具体的步骤可能会因系统版本和其他因素而有所不同。建议您参考官方文档或其他详细的教程以获得更准确的安装步骤。
#### 引用[.reference_title]
- *1* [Ubuntu下Opencv的安装(亲测有效,超级简单!)](https://blog.csdn.net/qq_43193873/article/details/126144636)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [Ubuntu18.04安装OpenCV教程](https://blog.csdn.net/lqsdddd/article/details/127938672)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [Ubuntu 16.04 + OpenCV3.4.1 安装编译教程](https://blog.csdn.net/Hu_helloworld/article/details/80251237)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文