乐趣区

关于docker:ubuntu1804在docker容器中编译opencv320

  1. 创立目录并 clone 代码

    mkdir opencv
    cd opencv
    
    git clone https://github.com/opencv/opencv.git
    cd opencv
    git checkout 3.2.0
    mkdir build
    cd ..
    
    git clone https://github.com/opencv/opencv_contrib.git
    cd opencv_contrib
    git checkout 3.2.0
    cd ..
    
  2. 遇到 ippicv_linux_20151201.tgz 下载不胜利

    • github 间接搜寻 ippicv
    • git clone https://github.com/lonesoul/i…
    • 将其中的 ippicv_linux_20151201.tgz 文件拷贝到 opencv/opencv/3rdparty/ippicv/downloads/linux-808b791a6eac9ed78d32a7666804320e 上面进行替换
  3. 遇到 boostdesc_bgm.i 等找不到

    • git clone https://github.com/opencv/ope…
    • git checkout contrib_xfeatures2d_boostdesc_20161012
    • 将缺失的文件, 拷贝到 opencv/opencv_contrib/modules/xfeatures2d/src
  4. 相似的问题能够参考下面两种解决思路
  5. 编译

    cd opencv/opencv/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=/home/mywork/opencv/opencv_contrib/modules \
     -D BUILD_EXAMPLES=ON ..
    
退出移动版