ubutnu20.04安装opencv3
时间: 2024-04-25 21:21:16 浏览: 77
适用于Ubuntu 20.04的opencv-3.3.1资源
5星 · 资源好评率100%
要在Ubuntu 20.04上安装OpenCV 3,您可以按照以下步骤进行操作:
1. 首先,更新您的系统:
```
sudo apt-get update
```
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 libdc1394-22-dev
```
3. 获取OpenCV和contrib的源代码:
```
git clone https://github.com/opencv/opencv.git
git clone https://github.com/opencv/opencv_contrib.git
```
4. 解压源代码并重命名文件夹:
```
cd opencv
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..
```
5. 编译并安装OpenCV:
```
make -j8
sudo make install
```
这样,您就成功地在Ubuntu 20.04上安装了OpenCV 3。请注意,上述步骤假设您已经安装了git和cmake。如果您没有安装,请使用以下命令安装:
```
sudo apt-get install git cmake
```
希望这可以帮助到您!\[1\]\[2\]
#### 引用[.reference_title]
- *1* [ubuntu20.04安装opencv和contrib](https://blog.csdn.net/weixin_42579969/article/details/129590121)[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_down1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [Ubuntu20.04 安装opencv](https://blog.csdn.net/qq_45577269/article/details/124636197)[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_down1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [[SLAM14讲踩坑笔记]ch5 ubuntu20.04安装opencv3报错以及安装方案](https://blog.csdn.net/weixin_43838897/article/details/128613883)[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_down1,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文