• 安装cuda加速的OpenCV


    安装前置依赖

    sudo apt-get install build-essential
    [required] sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
    [optional] sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
    

    CMake配置

    git clone https://github.com/opencv/opencv.git
    git clone https://github.com/opencv/opencv_contrib.git
    
    cd opencv
    mkdir build
    cd build
    
    cmake -DWITH_CUDA=ON -D ENABLE_FAST_MATH=1 -DCUDA_NVCC_FLAGS=--expt-relaxed-constexpr -DWITH_FFMPEG=1  -DINSTALL_C_EXAMPLES=OFF  -DBUILD_EXAMPLES=ON  -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules -DBUILD_opencv_cudaarithm=ON -DBUILD_opencv_cudabgsegm=ON -DBUILD_opencv_cudafeatures2d=OFF -DBUILD_opencv_cudafilters=ON -DBUILD_opencv_cudaimgproc=ON -DBUILD_opencv_cudalegacy=ON -DBUILD_opencv_cudaobjdetect=ON -DBUILD_opencv_cudaoptflow=ON -DBUILD_opencv_cudastereo=OFF -DBUILD_opencv_cudawarping=ON -DBUILD_opencv_cudacodec=ON -DBUILD_opencv_viz=OFF -DBUILD_opencv_stereo=OFF -DBUILD_opencv_tracking=OFF -DBUILD_opencv_sfm=OFF -D CUDA_FAST_MATH=1 -D WITH_CUBLAS=1  ..
    
    
    make install
    
  • 相关阅读:
    v-cloak无效解决方法
    堆栈,托管堆,堆,栈的区别
    2018-3-25至2018-8-9的日语笔记
    windows下远程连接redis
    windows cmd打开共享文件夹
    C#数据分组
    安装pyspider遇到的坑
    argument 1 must be 2-item sequence, not int
    python,pip环境变量设置
    python编程学习--Pygame
  • 原文地址:https://www.cnblogs.com/long5683/p/14799147.html
Copyright © 2020-2023  润新知