support building with contrib
MODIFY
.travis.yml
.travis.yml
@@ -11,12 +11,10 @@ dist: xenial
addons:
apt:
packages:
- - wget
- unzip
- build-essential
- cmake
- libgtk2.0-dev
- - pkg-config
- libavcodec-dev
- libavformat-dev
- libswscale-dev
@@ -42,16 +40,16 @@ env:
- Atlas_ROOT_DIR=/usr/include/ # for cmake to find lapacke.h
before_script:
- - wget -q -O- https://github.com/opencv/opencv/archive/$OPENCV_VERSION.tar.gz | tar -xzC ~/build
+ - wget -O- https://github.com/opencv/opencv/archive/$OPENCV_VERSION.tar.gz | tar -xzC ~/build
+ - wget -O- https://github.com/opencv/opencv_contrib/archive/$OPENCV_VERSION.tar.gz | tar -xzC ~/build
- mkdir -p ~/build/opencv-$OPENCV_VERSION-build
- pushd ~/build/opencv-$OPENCV_VERSION-build
- - cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_PERF_TESTS=OFF -DBUILD_TESTS=OFF -DINSTALL_TESTS=OFF -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_opencv_apps= -DWITH_IPP=OFF -DPYTHON_EXECUTABLE=OFF -DINSTALL_PYTHON_EXAMPLES=OFF -DWITH_LAPACK=ON -DWITH_EIGEN=ON -DBUILD_SHARED_LIBS=ON -DWITH_TBB=ON -DOPENCV_ENABLE_NONFREE=ON -DCMAKE_INSTALL_PREFIX=/usr ~/build/opencv-$OPENCV_VERSION
+ - cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_PERF_TESTS=OFF -DBUILD_TESTS=OFF -DINSTALL_TESTS=OFF -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_opencv_apps= -DWITH_IPP=OFF -DPYTHON_EXECUTABLE=OFF -DINSTALL_PYTHON_EXAMPLES=OFF -DWITH_LAPACK=ON -DWITH_EIGEN=ON -DBUILD_SHARED_LIBS=ON -DWITH_TBB=ON -DOPENCV_ENABLE_NONFREE=ON -DCMAKE_INSTALL_PREFIX=/usr -DOPENCV_EXTRA_MODULES_PATH=~/build/opencv_contrib-$OPENCV_VERSION/modules ~/build/opencv-$OPENCV_VERSION
- sudo make -j4 install
- tree .
- popd
- pkg-config --cflags opencv
- pkg-config --libs opencv
- - gcc --version
matrix:
allow_failures:

MODIFY
README.md
README.md
Quick update: this crate has been updated to work with OpenCV 3.4.6, some of
the following doc is outdated:
+## Contrib modules
+The following modules require contrib installed:
+ * bioinspired
+ * ccalib
+ * dpm
+ * freetype
+ * fuzzy
+ * img_hash
+ * phase_unwrapping
+ * plot
+
## Rust OpenCV bindings
[![Build Status](https://travis-ci.org/twistedfall/opencv-rust.svg?branch=master)](https://travis-ci.org/twistedfall/opencv-rust)

MODIFY
build.rs
build.rs
@@ -99,17 +99,25 @@ fn build_wrapper(opencv: pkg_config::Library) {
let ignore_modules: HashSet<&'static str> = HashSet::from_iter([
"aruco",
"bgsegm",
+ "core_detect",
+ "face",
+ "flann",
"hal",
+ "hdf", // includes platform-specific headers like /usr/include/x86_64-pc-linux-gnu/opencv2/hdf/hdf5.hpp
"hfs",
- "flann",
"ippicv",
+ "line_descriptor",
"opencv",
"opencv_modules",
"optflow",
"rgbd",
+ "saliency",
"stereo",
+ "structured_light",
"surface_matching",
+ "text",
"tracking",
+ "viz", // includes platform-specific headers like /usr/include/x86_64-pc-linux-gnu/opencv2/viz.hpp
"ximgproc",
"xobjdetect",
"xphoto",
@@ -124,13 +132,14 @@ fn build_wrapper(opencv: pkg_config::Library) {
"core/opengl.hpp", // ?
"core/cvstd.hpp",
"core/eigen.hpp",
- "core/fast_math.hpp", // contains funcions with Rust native counterpart
+ "core/fast_math.hpp", // contains functions with Rust native counterpart
"ios.h",
"ippasync.hpp",
"ocl.hpp",
"operations.hpp",
"persistence.hpp",
"utils/trace.hpp",
+ "viz/widget_accessor.hpp", // want to include vtk header
];
let ignore_header_substring = [
"/detail/",

support building with contrib