树莓派4b ubuntu18.04 opencv
时间: 2023-10-09 17:04:51 浏览: 158
树莓派4b上安装Ubuntu18.04和OpenCV的过程如下:
1. 首先,你需要下载Ubuntu18.04的操作系统并安装到树莓派4b上。
2. 安装OpenCV的依赖包。你可以使用以下命令来安装所需的依赖包:
```
sudo apt-get install build-essential 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
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev liblapacke-dev
sudo apt-get install libxvidcore-dev libx264-dev
sudo apt-get install libatlas-base-dev gfortran
sudo apt-get install ffmpeg
```
3. 下载并解压OpenCV和OpenCV_contrib。你可以在以下链接中找到下载地址:
OpenCV: https://opencv.org/opencv-4-1-1/
OpenCV_contrib: https://github.com/opencv/opencv_contrib/releases/tag/4.1.1
4. 将下载的opencv_contrib-4.1.1文件夹放在opencv-4.1.1文件夹里。
5. 使用以下命令进入opencv-4.1.1文件夹,并解压下载的文件:
```
cd opencv-4.1.1
unzip opencv-4.1.1.zip
unzip opencv-4.1.1.zip
```
6. 进入解压后的文件夹,并使用cmake进行配置和编译:
```
cd opencv-4.1.1
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D OPENCV_EXTRA_MODULES_PATH=../opencv_contrib-4.1.1/modules ..
make -j4
sudo make install
```
7. 安装完成后,你可以使用OpenCV来进行图像处理和计算机视觉相关的开发了。
请注意,上述步骤仅适用于树莓派4b上的Ubuntu18.04操作系统。如果你使用其他版本的Ubuntu或不同的操作系统,请参考相应的安装指南。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [基于树莓派4B Ubuntu18.04LTS 的OpenCV4.1.1 开发环境部署](https://blog.csdn.net/weixin_49818157/article/details/127861522)[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^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* [Ubuntu18.04安装opencv 3.2.0的解决方法](https://download.csdn.net/download/weixin_38637983/12842575)[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^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文