用AS的SDK+NDK工具进行编译(OK)!
POWERSHELL编译命令行:
(base) PS D:\OpenCV_Build_Anroid_20191219\build_for_android> C:\Users\jy\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\cmake.exe -G “Ninja” …\opencv-master\ -DANDROID_NDK=C:\Users\jy\AppData\Local\And
roid\Sdk\ndk-bundle -DCMAKE_TOOLCHAIN_FILE=C:\Users\jy\AppData\Local\Android\Sdk\ndk-bundle\build\cmake\android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=21 -DANDROID_SDK=C:\Users\jy\Ap
pData\Local\Android\Sdk -DWITH_TBB=ON -DCMAKE_C_FLAGS=-Ofast -DCMAKE_CXX_FLAGS=-Ofast -DOPENCV_EXTRA_MODULES_PATH=D:\OpenCV_Build_Anroid_20191219\opencv_contrib-master\modules
(base) PS D:\OpenCV_Build_Anroid_20191219\build_for_android> C:\Users\jy\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\ninja.exe -j2 install
– General configuration for OpenCV 4.2.0-pre =====================================
– Version control: unknown
– Extra modules:
– Location (extra): D:/OpenCV_Build_Anroid_20191219/opencv_contrib-master/modules
– Version control (extra): unknown
– Platform:
– Timestamp: 2019-12-20T02:33:25Z
– Host: Windows 10.0.16299 AMD64
– Target: Android 1 aarch64
– CMake: 3.6.0-rc2
– CMake generator: Ninja
– CMake build tool: C:/Users/jy/AppData/Local/Continuum/anaconda3/Library/bin/ninja.exe
– Configuration: Release
– CPU/HW features:
– Baseline: NEON FP16
– Built as dynamic libs?: NO
– C++ Compiler: C:/Users/jy/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe (ver 8.0)
– C++ flags (Release): -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -fno-addrsig -Wa,–noexecstack -Wformat -Werror=format-security -Ofast -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Winconsistent-missing-override -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -fdiagnostics-show-option -Qunused-arguments -fvisibility=hidden -fvisibility-inlines-hidden -O2 -DNDEBUG -DNDEBUG
– C++ flags (Debug): -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -fno-addrsig -Wa,–noexecstack -Wformat -Werror=format-security -Ofast -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Winconsistent-missing-override -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -fdiagnostics-show-option -Qunused-arguments -fvisibility=hidden -fvisibility-inlines-hidden -O0 -fno-limit-debug-info -fno-experimental-isel -DDEBUG -D_DEBUG
– C Compiler: C:/Users/jy/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe
– C flags (Release): -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -fno-addrsig -Wa,–noexecstack -Wformat -Werror=format-security -Ofast -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Winconsistent-missing-override -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -fdiagnostics-show-option -Qunused-arguments -fvisibility=hidden -fvisibility-inlines-hidden -O2 -DNDEBUG -DNDEBUG
– C flags (Debug): -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -fno-addrsig -Wa,–noexecstack -Wformat -Werror=format-security -Ofast -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winit-self -Winconsistent-missing-override -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -fdiagnostics-show-option -Qunused-arguments -fvisibility=hidden -fvisibility-inlines-hidden -O0 -fno-limit-debug-info -fno-experimental-isel -DDEBUG -D_DEBUG
– Linker flags (Release): -Wl,–exclude-libs,libgcc.a -Wl,–exclude-libs,libatomic.a -static-libstdc++ -Wl,–build-id -Wl,–warn-shared-textrel -Wl,–fatal-warnings -Wl,–no-undefined -Qunused-arguments -Wl,-z,noexecstack
– Linker flags (Debug): -Wl,–exclude-libs,libgcc.a -Wl,–exclude-libs,libatomic.a -static-libstdc++ -Wl,–build-id -Wl,–warn-shared-textrel -Wl,–fatal-warnings -Wl,–no-undefined -Qunused-arguments -Wl,-z,noexecstack
– ccache: NO
– Precompiled headers: NO
– Extra dependencies: C:/Users/jy/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/lib/aarch64-linux-android/libz.a dl m log
– 3rdparty dependencies: tbb libcpufeatures ittnotify libprotobuf libjpeg-turbo libwebp libpng libtiff libjasper IlmImf quirc tegra_hal
– C/C++:– OpenCV modules:
– To be built: aruco bgsegm bioinspired calib3d ccalib core datasets dnn dnn_objdetect dnn_superres dpm face features2d flann fuzzy hfs highgui img_hash imgcodecs imgproc java line_descriptor ml objdetect optflow phase_unwrapping photo plot quality reg rgbd saliency shape stereo stitching structured_light superres surface_matching text tracking ts video videoio videostab xfeatures2d ximgproc xobjdetect xphoto
– Disabled: world
– Disabled by dependency: -
– Unavailable: cnn_3dobj cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev cvv freetype gapi hdf js matlab ovis python2 python3 sfm viz
– Applications: tests perf_tests
– Documentation: NO
– Non-free algorithms: NO
– Android NDK: C:/Users/jy/AppData/Local/Android/Sdk/ndk-bundle (ver 20.1.5948944)
– Android ABI: arm64-v8a
– NDK toolchain: aarch64-linux-android-clang
– STL type: c++_static
– Native API level: 21
– Android SDK: C:\Users\jy\AppData\Local\Android\Sdk (tools: 26.1.1 build tools: 29.0.2)
– GUI:
– Media I/O:
– ZLib: C:/Users/jy/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/lib/aarch64-linux-android/libz.a (ver 1.2.7)
– JPEG: build-libjpeg-turbo (ver 2.0.2-62)
– WEBP: build (ver encoder: 0x020e)
– PNG: build (ver 1.6.37)
– TIFF: build (ver 42 - 4.0.10)
– JPEG 2000: build (ver 1.900.1)
– OpenEXR: build (ver 2.3.0)
– HDR: YES
– SUNRASTER: YES
– PXM: YES
– PFM: YES
– Video I/O:
– Parallel framework: TBB (ver 2019.0 interface 11008)
– Trace: YES (with Intel ITT)
– Other third-party libraries:
– Custom HAL: YES (carotene (ver 0.0.1))
– Protobuf: build (3.5.1)
– Python (for build): C:/Users/jy/AppData/Local/Continuum/anaconda3/python.exe
– Java: export all functions
– ant: NO
– Java wrappers: YES
– Java tests: NO
– Install to: D:/OpenCV_Build_Anroid_20191219/build_for_android/install