ubuntu18.04安装opencv3.4.4
时间: 2023-03-19 22:21:00 浏览: 116
安装OpenCV 3.4.4的步骤很简单:1.下载OpenCV 3.4.4源码:https://opencv.org/releases.html2.解压源码:tar -xvzf OpenCV-3.4.4.tar.gz3.安装所需的依赖:sudo apt-get install build-essential cmake git pkg-config libgtk-3-dev4.创建一个新的编译文件夹:mkdir opencv-3.4.4-build5.进入编译文件夹:cd opencv-3.4.4-build6.运行CMake:cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..7.编译OpenCV:make -j48.安装OpenCV:sudo make install
相关问题
在ubuntu18.04上安装opencv3.4.4
我建议你在Ubuntu 18.04上安装OpenCV 3.4.4,可以参考以下步骤:1. 使用终端安装OpenCV 3.4.4:sudo apt-get install libopencv-dev python-opencv。2. 安装CMake:sudo apt-get install cmake。3. 下载OpenCV 3.4.4源码:wget https://github.com/opencv/opencv/archive/3.4.4.zip。4. 解压缩源码:unzip 3.4.4.zip。5. 进入OpenCV 3.4.4目录:cd opencv-3.4.4。6. 运行CMake:cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..。7. 编译OpenCV:make -j4。8. 安装OpenCV:sudo make install。
ubuntu18.04安装opencv
在 Ubuntu 18.04 上安装 OpenCV 的过程如下:
1. 更新系统并安装依赖项:
```
sudo apt update
sudo apt upgrade
sudo apt install build-essential cmake git pkg-config libgtk-3-dev
sudo apt install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
sudo apt install libxvidcore-dev libx264-dev
sudo apt install libjpeg-dev libpng-dev libtiff-dev gfortran openexr
sudo apt install libatlas-base-dev python3-dev python3-numpy
```
2. 下载 OpenCV 源码:
```
git clone https://github.com/opencv/opencv.git
git clone https://github.com/opencv/opencv_contrib.git
```
3. 编译并安装 OpenCV:
```
cd opencv
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_C_EXAMPLES=ON \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D OPENCV_GENERATE_PKGCONFIG=ON \
-D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules \
-D BUILD_EXAMPLES=ON ..
```
然后执行
```
make -j4
sudo make install
sudo ldconfig
```
完成后,您可以使用 Python 或 C++ 来使用 OpenCV。请注意,编译和安装 OpenCV 可能需要较长时间,并占用较大空间。
阅读全文