OpenCV

查询指令

# 查看 opencv 已安装的库
pkg-config opencv --libs

# 查看 opencv 已安装的版本
pkg-config opencv --modversion    

编译安装

Linux

[compiler] 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

https://github.com/opencv/opencv/releases Source Code https://github.com/opencv/opencv_contrib/releases tar.gz

find ./ -type f -print0 xargs -0 md5sum

opencv-3.4.2/.cache/

https://github.com/opencv/opencv_3rdparty/branches/all

<md5效验码>-<filenam>

.cache
    |__.gitignore
    |__data
    |    |__face_landmark_model.data
    |__ippicv
    |    |__ippicv_2017u3_lnx_intel64_general_20180518.tgz
    |__xfeatures2d
         |__boostdesc
         |    |__boostdesc_bgm_hd.i
         |    |__boostdesc_bgm.i
         |    |__boostdesc_bgm_bi.i
         |    |__boostdesc_binboost_064.i
         |    |__boostdesc_binboost_128.i
         |    |__boostdesc_lbgm.i
         |    |__boostdesc_binboost_256.i
         |__vgg
              |__vgg_generated_48.i
              |__vgg_generated_64.i
              |__vgg_generated_80.i
              |__vgg_generated_120.i

Video_Codec_SDK_9.0.20

opencv-3.4.2/modules/cudacodec/src precomp.hpp、video_decoder.hpp、cuvid_video_source.hpp、frame_queue.hpp、video_parser.hpp

#if CUDA_VERSION >= 9000
    #include <dynlink_nvcuvid.h>
#else
    #include <nvcuvid.h>
#endif
#if CUDA_VERSION >= 9000 && CUDA_VERSION < 10000
    #include <dynlink_nvcuvid.h>
#else
    #include "nvcuvid.h"
#endif

Windows 交叉编译 Android OpenCV

编译工具

cmake

MinGW-W64

添加到系统环境变量PATH

ant

cmake_gui -> add entry

CMake Error at cmake/android/OpenCVDetectAndroidSDK.cmake:184 (message):
  Android SDK: Can't build Android projects as requested by
  BUILD_ANDROID_PROJECTS=ON variable.

  Use BUILD_ANDROID_PROJECTS=OFF to prepare Android project files without
  building them
Call Stack (most recent call first):
  CMakeLists.txt:645 (include)

BUILD_ANDROID_PROJECTS: ON -> OFF

添加 opencv-contrib

Table of Contents