精华内容
下载资源
问答
  • ubuntu安装opencv
    千次阅读
    2021-12-23 20:48:18

    Ubuntu+vscode+Opencv+Opencv_contrib C++ support环境搭建流程

    之前我们介绍了Windows搭建vscode opencv contrib的流程。由于后期需要用到linux开发,所以需要在linux上搭建相应的环境。本文完整介绍了如何在ubuntu环境下进行opencv环境搭建的流程。

    系统要求:ubuntu20.04:
    软件要求:vscode latest, opencv 3.4.9, opencv_contrib 3.4.9, mingw-w64, cmake-gui工具。

    下载并安装vscode

    登陆https://code.visualstudio.com/下载.deb vscode。一般会下载到~/下载目录
    随后键入以下命令

    $ sudo pdg -i vscode
    

    完成安装。

    下载opencv opencv contrib
    据说ubuntu好用的下载器是uget + aria2组合可以加速,但在我的电脑上不work,下载opencv的速度很慢,这个下载过程请读者自行解决。
    opencv下载地址:https://github.com/opencv/opencv/archive/3.4.9.zip
    opencv_contrib下载地址: https://github.com/opencv/opencv_contrib/releases/tag/3.4.9

    下载cmake-gui工具和mingw-w64
    运行以下命令即可:

    $ sudo apt install cmake-qt-gui
    $ sudo apt install mingw-w64
    

    接下来就是如何编译opencv。为了让读者少踩坑,这里将一些编译前的准备工作介绍一下:

    编译opencv前的准备工作

    1. 手动下载ippicv_2019_lnx_intel64_general_20180723.tgz

    下载地址:https://raw.githubusercontent.com/opencv/opencv_3rdparty/ippicv/master_20180723/ippicv/ippicv_2019_lnx_intel64_general_20180723.tgz。如果下载速度过慢,可以使用github代下载服务:http://g.widora.cn/,永久免费,值得拥有。下载好后,解压文件并修改source文件夹里面的99bcc121813401857e2a8027ae9b3c81_1593744729.tgz文件名称修改为ippicv_2019_lnx_intel64_general_20180723.tgz

    下载好后,将/path/to/opencv3.4.9/sources/3rdparty/ippicv/ippcv.cmake中的第47行改为file:/path/to/ippicv_2019_lnx_intel64_general_20180723.tgz,含义是替换网络下载为本地下载。

    1. 安装opencv依赖
    $ sudo apt install cmake  
    $ sudo apt install build-essential libgtk2.0-dev libavcodec-dev libavformat-dev libjpeg.dev libtiff4.dev libswscale-dev libjasper-dev  
    $ sudo apt install git
    

    编译安装opencv

    打开cmake-gui,Browse Source/path/to/opencv3.4.9/sourcesBrowse Build/path/to/opencv3.4.9/build/x64/LinuxBuild,该文件夹需要自己创建。随后点击Configure按钮。CmakeSetup窗口默认就行(Windows下面需要指定mingw g++编译器,ubuntu默认即可,当然也可以切换成mingw g++编译器),如下所示

    随后
    1. 在搜索栏搜索EXTRA,将OPENCV_EXTRA_MODULE_PATH的值改成/path/to/opencv_contrib-3.4.9/modules
    2. 搜索world,修改BUILD_opencv_world的值为选中,如果默认选中就不管。

    然后再点击Configure --> Generate

    打开terminal,执行

    $ cd /path/to/opencv3.4.9/build/x64/LinuxBuild/
    $ sudo make -j8 # 编译,等待时间有点漫长,中间有些警告不管
    $ sudo make install # 进行安装
    

    随后可以在/usr/local/lib文件夹看到有libopencv的库了。

    在vscode中使用opencv

    这个过程和在windows下使用opencv类似,可参考我的另外一篇文章vscode-c++-opencv-opencv_contrib安装教程.pdf。不过似乎不用设置c_cpp_properties.json也不会报错。

    #include <vector>
    #include <iostream>
    #include <fstream>
    #include <cstring>
    #include <string>
    #include <io.h>
    #include <algorithm>
    #include <opencv2/core/utility.hpp>
    #include <opencv2/video/tracking.hpp>
    #include <opencv2/tracking/tracker.hpp>
    #include <opencv2/videoio.hpp>
    #include <opencv2/highgui.hpp>
    
    int main()
    {
        cv::Mat image = cv::imread("/path/to/test.jpg");
        cv::imshow("test", image);
        cv::waitKey(0);
        system("pause");
        return 0;
    }
    
    

    说一下在我的环境里面遇到的一些问题:

    1. io.h等一些头文件可能找不到的问题;

    解决方案:linux默认会在/usr/include下找头文件,如果找不到,就需要在/usr/include的子文件夹下搜该头文件,如下:

    $ cd /usr/include
    $ find ./ -name "io.h"
    # /usr/include/x86_64-linux-gnu/sys/io.h
    $ cp /usr/include/x86_64-linux-gnu/sys/io.h /usr/include # 拷贝到include路径下
    
    1. 编译参数

    初始编译选择g++-9,参数选择 “-g -c -o”,输出文件格式选择".o" 如下:

    # tasks.json
    "args": [
    	"-g",
    	"${file}",
    	"-c",
    	"-o",
    	"${fileDirname}/${fileBasenameNoExtension}.o",
    ],
    
    1. 链接参数
    g++ \
    -std=c++11 \
    -g \
    -o ./test_opencv \
    ./test_opencv.o \
    -I /usr/local/include \
    -I /usr/local/include/opencv \
    -I /usr/local/include/opencv2 \
    -I /home/wyx/software/opencv_contrib-3.4.9/modules/tracking/include \
    -l opencv_world
    
    1. 执行的问题

    执行的时候抛出
    ./test_opencv: error while loading shared libraries: libopencv_world.so.3.4: cannot open shared object file: No such file or directory错误。

    这个错误是说你的opencv_world库找不到,需要在linux的共享库配置文件里面修改,具体如下:

    $ cd /etc/ld.so.conf.d
    $ sudo vim opencv.conf
    # 在其中加入/usr/local/lib/,opencv安装好后会把libopencv_world.so文件放到这个路径下
    $ sudo ldconfig # 使配置生效
    

    应该就可以运行opencv程序了。

    更多相关内容
  • Ubuntu安装OpenCV

    千次阅读 2022-02-09 19:11:20
    # 安装最低要求(Ubuntu 18.04 作为参考) sudo apt update && sudo apt install -y cmake g++ wget unzip #安装依赖 sudo apt-get install build-essential libgtk2.0-dev libavcodec-dev libavformat-dev...

    1、安装准备

    # 安装最低要求(Ubuntu 18.04 作为参考)
    sudo apt update && sudo apt install -y cmake g++ wget unzip
    
    #安装依赖
    sudo apt-get install build-essential libgtk2.0-dev libavcodec-dev libavformat-dev libjpeg-dev libswscale-dev libtiff5-dev
    sudo apt-get install libgtk2.0-dev
    sudo apt-get install pkg-config
    
    

    2、下载opencv

    # mkdir OpencvRoute && cd OpencvRoute 
    # wget -O opencv.zip https://github.com/opencv/opencv/archive/4.x.zip
    # unzip opencv.zip
    # mv opencv-4.x opencv
    # cd opencv 
    # makdir build
    # cd build

     3、cmake

    sudo cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..

     4、编译

    sudo make -j8
    可以使用sudo make -j 8 、sudo make -j4 、sudo make 
    我这里就使用sudo make -j 8了

     5、安装

    sudo make install

     6、配置环境

     用gedit或者vim打开/etc/ld.so.conf
    在文件中加上一行 /usr/loacal/lib
    其中/user/loacal是opencv安装路径也就是makefile中指定的安装路

    sudo gedit /etc/ld.so.conf

     运行sudo ldconfig,
    修改bash.bashrc文件

    sudo gedit /etc/bash.bashrc 

     在文件末尾加入:
    PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
    export PKG_CONFIG_PATH

    然后在命令行中输入

     source /etc/bash.bashrc

    在命令行中输入如下命令:

    pkg-config opencv --modversion

     至此opencv的安装就完成了


    如果出现 找不到opencv.pc的问题

     手动创建opencv.pc:

    cd /usr/local/lib
    sudo mkdir pkgconfig && cd pkgconfig
    sudo gedit opencv.pc

    然后添加:

    prefix=/usr/local
    exec_prefix=${prefix}
    includedir=/usr/local/include
    libdir=/usr/local/lib
     
    Name: OpenCV
    Description: Open Source Computer Vision Library
    Version: 4.4.0
    Libs: -L${exec_prefix}/lib -lopencv_stitching -lopencv_superres -lopencv_videostab -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_dnn_objdetect -lopencv_dpm -lopencv_face -lopencv_photo -lopencv_freetype -lopencv_fuzzy -lopencv_hdf -lopencv_hfs -lopencv_img_hash -lopencv_line_descriptor -lopencv_optflow -lopencv_reg -lopencv_rgbd -lopencv_saliency -lopencv_stereo -lopencv_structured_light -lopencv_phase_unwrapping -lopencv_surface_matching -lopencv_tracking -lopencv_datasets -lopencv_text -lopencv_dnn -lopencv_plot -lopencv_xfeatures2d -lopencv_shape -lopencv_video -lopencv_ml -lopencv_ximgproc -lopencv_calib3d -lopencv_features2d -lopencv_highgui -lopencv_videoio -lopencv_flann -lopencv_xobjdetect -lopencv_imgcodecs -lopencv_objdetect -lopencv_xphoto -lopencv_imgproc -lopencv_core
    Libs.private: -ldl -lm -lpthread -lrt
    Cflags: -I${includedir}

    写个程序测试下:

    首先建立一个文件夹OpenCV_Code,下面新建一个cpp文件,名为test.cpp

    #include <stdio.h>
    #include <opencv2/opencv.hpp>
    using namespace cv;
    int main(int argc, char** argv )
    {
     if ( argc != 2 )
     {
       printf("usage: DisplayImage.out <Image_Path>\n");
       return -1;
     }
     Mat image;
     image = imread( argv[1], 1 );
     if ( !image.data )
     {
       printf("No image data \n");
       return -1;
     }
     namedWindow("Display Image", WINDOW_AUTOSIZE );
     imshow("Display Image", image);
     waitKey(0);
     return 0;
    }
    

    再此文件夹下继续新建一个文件,名为 CMakeLists.txt:

    cmake_minimum_required(VERSION 2.8)
    project( test )
    find_package( OpenCV REQUIRED )
    add_executable( test test.cpp )
    target_link_libraries( test ${OpenCV_LIBS} )
    
    $ cmake .
    $ make

    此时OpenCV_Code文件夹中已经产生了可执行文件test,下载Lina.jpg放在OpenCV_Code下,运行

    ./test Lina.jpg

    展开全文
  • ubuntu安装opencv

    千次阅读 2021-12-09 09:14:12
    Ubuntu18.04 环境下安装OpenCV。 一、官网下载 Opencv官网 在导航栏Library中选中Releases 然后点击Sources,自动下载到本地。 二、安装 安装命令 unzip OpenCV-3.4.5.zip cd opencv mkdir build cd build cmake...


    前言

    Ubuntu18.04 环境下安装OpenCV。

    一、官网下载

    Opencv官网
    在导航栏Library中选中Releases
    在这里插入图片描述
    然后点击Sources,自动下载到本地。
    在这里插入图片描述

    二、安装

    安装命令

    unzip OpenCV-3.4.5.zip
    cd opencv
    
    mkdir build 
    cd build
    cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..
    make -j${proc}
    make install
    

    查看是否opencv成功:

    pkg-config --modversion opencv # 出现版本号即成功
    

    将opencv加入环境变量:

    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/
    
    
    展开全文
  • Ubuntu 安装 OpenCV 4.5.5

    千次阅读 2022-05-03 16:26:15
    换源(可选) 换个源,加快下载速度。 sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak ...deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse # deb-s.

    Ubuntu 安装 OpenCV 4.5.5

    换源(可选)

    换个源,加快下载速度。

    Speed Up

    sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
    sudo gedit /etc/apt/sources.list
    

    清华源

    # 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
    

    阿里源

    deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
    # deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
    # deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
    # deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
    # deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
    # deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
    

    中科大源

    deb https://mirrors.ustc.edu.cn/ubuntu/ focal main restricted universe multiverse
    # deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal main restricted universe multiverse
    deb https://mirrors.ustc.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
    # deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
    deb https://mirrors.ustc.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
    # deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
    deb https://mirrors.ustc.edu.cn/ubuntu/ focal-security main restricted universe multiverse
    # deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal-security main restricted universe multiverse
    deb https://mirrors.ustc.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
    # deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
    

    网易163源

    deb http://mirrors.163.com/ubuntu/ focal main restricted universe multiverse
    deb http://mirrors.163.com/ubuntu/ focal-security main restricted universe multiverse
    deb http://mirrors.163.com/ubuntu/ focal-updates main restricted universe multiverse
    deb http://mirrors.163.com/ubuntu/ focal-proposed main restricted universe multiverse
    deb http://mirrors.163.com/ubuntu/ focal-backports main restricted universe multiverse
    # deb-src http://mirrors.163.com/ubuntu/ focal main restricted universe multiverse
    # deb-src http://mirrors.163.com/ubuntu/ focal-security main restricted universe multiverse
    # deb-src http://mirrors.163.com/ubuntu/ focal-updates main restricted universe multiverse
    # deb-src http://mirrors.163.com/ubuntu/ focal-proposed main restricted universe multiverse
    # deb-src http://mirrors.163.com/ubuntu/ focal-backports main restricted universe multiverse
    

    华为源

    deb http://repo.huaweicloud.com/ubuntu/ focal main restricted
    # deb-src http://repo.huaweicloud.com/ubuntu/ focal main restricted
    deb http://repo.huaweicloud.com/ubuntu/ focal-updates main restricted
    # deb-src http://repo.huaweicloud.com/ubuntu/ focal-updates main restricted
    deb http://repo.huaweicloud.com/ubuntu/ focal universe
    # deb-src http://repo.huaweicloud.com/ubuntu/ focal universe
    deb http://repo.huaweicloud.com/ubuntu/ focal-updates universe
    # deb-src http://repo.huaweicloud.com/ubuntu/ focal-updates universe
    deb http://repo.huaweicloud.com/ubuntu/ focal multiverse
    # deb-src http://repo.huaweicloud.com/ubuntu/ focal multiverse
    deb http://repo.huaweicloud.com/ubuntu/ focal-updates multiverse
    # deb-src http://repo.huaweicloud.com/ubuntu/ focal-updates multiverse
    deb http://repo.huaweicloud.com/ubuntu/ focal-backports main restricted universe multiverse
    # deb-src http://repo.huaweicloud.com/ubuntu/ focal-backports main restricted universe multiverse
    deb http://repo.huaweicloud.com/ubuntu focal-security main restricted
    # deb-src http://repo.huaweicloud.com/ubuntu focal-security main restricted
    deb http://repo.huaweicloud.com/ubuntu focal-security universe
    # deb-src http://repo.huaweicloud.com/ubuntu focal-security universe
    deb http://repo.huaweicloud.com/ubuntu focal-security multiverse
    # deb-src http://repo.huaweicloud.com/ubuntu focal-security multiverse
    

    换源后操作

    sudo apt-get update
    sudo apt-get upgrade
    

    update 和 upgrade 的区别:apt-get update 用于更新可获取软件及其版本信息,但仅仅给出一个可更新的list,具体更新软件操作需要通过 apt-get upgrad 命令。若不想更新应用,只执行 update 即可

    下载 OpenCV 4.5.5 源码

    https://github.com/opencv/opencv/releases/tag/4.5.5

    OpenCV 4.5.5 源码

    wget https://github.com/opencv/opencv/archive/refs/tags/4.5.5.zip
    

    环境准备

    解压

    如果是虚拟机,请勿在共享文件夹内进行操作。

    unzip opencv-4.5.5.zip	
    

    安装依赖

    sudo apt-get install cmake
    sudo apt-get install build-essential libgtk2.0-dev libavcodec-dev libavformat-dev libjpeg-dev libswscale-dev libtiff5-dev
    sudo apt-get install libgtk2.0-dev
    sudo apt-get install pkg-config
    

    编译安装

    opencv-4.5.5 文件夹中建立名为 build的文件夹,在build 目录下执行 cmakemake

    mkdir build
    
    cd build
    
    cmake -D WITH_TBB=ON -D WITH_EIGEN=ON -D OPENCV_GENERATE_PKGCONFIG=ON  -D BUILD_DOCS=ON -D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=OFF -D BUILD_EXAMPLES=OFF  -D WITH_OPENCL=OFF -D WITH_CUDA=OFF -D BUILD_opencv_gpu=OFF -D BUILD_opencv_gpuarithm=OFF -D BUILD_opencv_gpubgsegm=O -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
    
    make -j8
    sudo make install
    

    环境配置

    动态库配置

    sudo gedit /etc/ld.so.conf.d/opencv.conf
    

    添加

    /usr/local/lib
    

    保存后,终端内执行

    sudo ldconfig 
    

    更新 PKG_CONFIG_PATH

    sudo gedit /etc/bash.bashrc
    

    文末添加

    PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
    export PKG_CONFIG_PATH
    

    保存后,终端执行

    source /etc/bash.bashrc
    sudo updatedb
    

    若出现 sudo: updatedb: command not found,执行 sudo apt install mlocate 后再次操作即可。

    验证

    pkg-config

    pkg-config --modversion opencv4
    

    pkg-config

    程序验证

    代码

    test.cpp

    #include <iostream>
    #include <opencv2/core.hpp>
    #include <opencv2/imgcodecs.hpp>
    #include <opencv2/highgui.hpp>
    
    using namespace cv;
    using namespace std;
    
    /**
     * 读写与显示
     * @return
     */
    int main() {
        cout << CV_VERSION << endl;
        Mat src = cv::imread("image/lena.tif", IMREAD_GRAYSCALE);
        if (src.empty()) {
            cout << "Could not load image\n" << endl;
            return -1;
        }
        namedWindow("gray", WINDOW_AUTOSIZE);
        imshow("gray", src);
        waitKey(0);
    
        imwrite("../image/lena_scale.tif", src);
        return 0;
    }
    
    

    CMakeLists.txt

    cmake_minimum_required(VERSION 3.16)
    project(test)
    find_package(OpenCV REQUIRED)
    add_executable(test test.cpp)
    target_link_libraries(test ${OpenCV_LIBS})
    

    编译

    cmake .
    make
    

    编译

    运行

    运行

    展开全文
  • ubuntu 安装 opencvopencv-contrib

    千次阅读 2021-11-10 17:17:25
    首先在 https://github.com/opencv/opencv_contrib/ 和 https://github.com/opencv/opencv/ 中选择相同的分支 然后将opencv-contrib安装opencv
  • Ubuntu安装OpenCV (C++)

    千次阅读 2022-06-25 10:22:09
    OpenCV安装教程(Ubuntu
  • ubuntu 安装 opencv 【亲测有效】

    千次阅读 2022-08-11 01:42:22
    ubuntu 安装 opencv 【亲测有效】
  • Ubuntu安装opencv-python 爬坑两天总结出来的经验,亲试有效!!! 首先安装python sudo apt-get install python3 安装成功后可以使用相应的名称进入相应的版本,会详细的显示版本信息。 pip3安装opencv-python 先...
  • ubuntu安装opencv4

    千次阅读 2022-03-07 14:10:35
    安装opencv4 在Ubuntu比较简单,几步就行: (1)sudo apt-get install build-essential sudo apt-get install build-essential (2)sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev ...
  • Ubuntu 安装opencv2.4的过程

    千次阅读 2022-01-07 14:06:34
    环境:Ubuntu16.04 1、安装依赖项 # 安装编译工具 sudo apt-get install build-essential # 安装依赖包 sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-...
  • Ubuntu 安装 OpenCV(亲测有效)

    千次阅读 2021-02-16 15:18:05
    Ubuntu 安装 OpenCV(亲测有效) 1.安装准备: 1.1安装cmake sudo apt-get install cmake 1.2依赖环境 sudo apt-get install build-essential libgtk2.0-dev libavcodec-dev libavformat-dev libjpeg-dev ...
  • 记录一篇“如何安装ubuntu下C++接口的opencv”的文章。由于转载格式有问题,直接贴个链接:ubuntu安装opencv的正确方法 注意:本人根据此博客安装遇到的问题:2.3cmake,输入博客中2.3的命令,报错sudo:cmake not ...
  • 本文介绍的是如何安装ubuntu下C++接口的opencv 1.安装准备: 1.1安装cmake sudo apt-get install cmake 1.2依赖环境 sudo apt-get install build-essential libgtk2.0-dev libavcodec-dev libavformat-dev ...
  • ubuntu安装opencv-python

    千次阅读 2022-03-04 08:18:42
    opencv-python仅依赖numpy,因此安装之前请确保numpy已经安装。 二、命令安装 通过以下命令安装python3-opencv $ sudo apt-get install python3-opencv 验证是否安装成功 import cv2 as cv print(cv.__version__) ...
  • Ubuntu安装opencv4

    千次阅读 2020-04-30 18:20:00
    1、获取opencv安装包: 可以百度云盘搜索,也可以用git clone的...#获取opencv_contrib源码,根据自己需要,可以不安装 git clone git@github.com:opencv/opencv_contrib.git 2、安装依赖库 sudo apt-...............
  • ubuntu安装opencv4.X+opencv_contrib教程(c++)

    千次阅读 2022-02-15 11:02:15
    由于一些意外,连续在ubuntu20.04下装了好几次opencv,在此记录一下。 一.安装依赖 1.首先的必要项是cmake和g++,一般这两个用c++的都会有。 sudo apt update && sudo apt install -y cmake g++ wget unzip ...
  • Ubuntu安装opencv的扩展模块-viz模块

    千次阅读 2022-03-17 11:35:01
    由于特殊要求,有时候需要安装opencv的扩展模块,其官方的扩展模块都在opencv_contrib下,可以在官方GitHub上找到。 官网地址在这里:mirrors / opencv / opencv_contrib · GitCodehttps://gitcode.net/mirrors/...
  • cmake -DWITH_GTK_2_X=ON -DWITH_CUDA=OFF -DOPENCV_EXTRA_MODULES_PATH=/home/car/Downloads/installpkg/opencv-3.3.0/opencv_contrib-3.3.0/modules .. make -j8 sudo make install 以上的“/home/car/Downloads/...
  • ubuntu安装opencv的正确方法

    万次阅读 多人点赞 2019-08-10 08:31:57
    本文介绍的是如何安装ubuntu下C++接口的opencv 1.安装准备: 1.1安装cmake sudo apt-get install cmake 1.2依赖环境 sudo apt-get install build-essential libgtk2.0-dev libavcodec-dev libavformat-dev ...
  • Ubuntu安装opencv4.5(自己安装过程详细)

    千次阅读 多人点赞 2021-01-27 12:47:18
    1.下载opencvopencv官网下载source版,下载链接 http://opencv.org/releases.html。别下载错版本 下载过程就不多说了。 2.安装过程 2.1解压 unzip opencv-4.5.0.zip cd opencv-4.5.0 2.2安装依赖的库 sudo apt-...
  • Ubuntu源码安装OpenCV过程记录
  • 在各种平台上安装了不下10遍opencv后得出的opencv安装流程,包括c++和python
  • Ubuntu安装Opencv遇到的问题
  • Ubuntu 安装OpenCV python

    2017-04-10 22:07:34
    Ubuntu 安装OpenCV python,含opencv 2和opencv 3。
  • 1.首先确保有cmake与makesudo apt-get install cmakesudo apt-get ...安装依赖环境sudo apt-get install build-essential libgtk2.0-dev libavcodec-dev libavformat-dev libjpeg-dev libswscale-dev libtiff5-devsu...
  • ubuntu 安装opencv踩坑记录

    千次阅读 2021-12-11 10:15:03
    Package opencv was not found in the pkg-config search path. Perhaps you should add the directory containing `opencv.pc' to the PKG_CONFIG_PATH environment variable No package 'opencv' found 解决方法...
  • ubuntu安装Opencv3.2的开发环境,以及安装文件和文档。压缩包中包含:ippicv、opencv3.2、opencv_contrib3.2.
  • Ubuntu安装 opencv 3.4.1 遇到的问题

    千次阅读 2022-03-09 20:40:34
    OpenCV3.3编译安装+部分问题解决 - 灰信网(软件开发博客聚合) 缺少的包 解决方法 -- No package 'gtk+-3.0' found sudo apt-get install libgtk-3-dev -- No package 'gstreamer-base-1.0' found ...
  • linux-ubuntu环境下安装opencv3.2.0详细教程,亲测有效

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 46,115
精华内容 18,446
关键字:

ubuntu安装opencv