Ask Your Question

Revision history [back]

Something is wrong in your command. opencv_contrib is defined twice. There is no opencv_contrib modules in your cmakeooutput

Something is wrong in your command. opencv_contrib is defined twice. There is no opencv_contrib modules in your cmakeooutputcmakeooutput My script to build opencv with opencv_contrib on raspberry :

#!/bin/bash -e
myRepo=$(pwd)
CMAKE_CONFIG_GENERATOR="Unix Makefiles"
if [  ! -d "$myRepo/opencv"  ]; then
    echo "clonning opencv"
    git clone https://github.com/opencv/opencv.git
    mkdir Build/opencv
    mkdir Install
    mkdir Install/opencv
else
    cd opencv
    git pull --rebase
    cd ..
fi
if [  ! -d "$myRepo/opencv_contrib"  ]; then
    echo "clonning opencv_contrib"
    git clone https://github.com/opencv/opencv_contrib.git
    mkdir Build/opencv_contrib
else
    cd opencv_contrib
    git pull --rebase
    cd ..
fi
RepoSource=opencv
pushd Build/$RepoSource
CMAKE_OPTIONS='-DBUILD_PERF_TESTS:BOOL=OFF -DBUILD_TESTS:BOOL=OFF -DBUILD_DOCS:BOOL=OFF  -DWITH_CUDA:BOOL=OFF -DBUILD_EXAMPLES:BOOL=OFF -DINSTALL_CREATE_DISTRIB=ON'
cmake -G"$CMAKE_CONFIG_GENERATOR" \
-DEIGEN_DIR:PATH="$myRepo"/eigen -DEIGEN_INCLUDE_DIR="$myRepo"/eigen -DEIGEN_INCLUDE_PATH="$myRepo"/eigen \
-DCeres_DIR="$myRepo"/Install/ceres-solver/lib/cmake/Ceres -DGLOG_INCLUDE_DIR="$myRepo"/Install/glog/include -Dglog_DIR:PATH="$myRepo"/Install/glog/lib/cmake/glog -DGLOG_LIBRARY:PATH="$myRepo"/Install/glog/lib/libglog.a \
-Dgflags_DIR:PATH="$myRepo"/Build/gflags -DGFLAGS_INCLUDE_DIR="$myRepo"/Build/gflags/include/gflags \
-DOPENCV_ENABLE_NONFREE=ON \
-DBUILD_opencv_world=OFF \
-DVTK_DIR:PATH="$myRepo"/Install/vtk/lib/cmake/vtk-8.1 \
-DWITH_OPENCL:BOOL=FALSE \
-DTesseract_INCLUDE_DIR=Tesseract/usr/include/tesseract \
$CMAKE_OPTIONS -DOPENCV_EXTRA_MODULES_PATH="$myRepo"/opencv_contrib/modules -DCMAKE_INSTALL_PREFIX="$myRepo"/Install/"$RepoSource" "$myRepo/$RepoSource"

echo "************************* $Source_DIR -->release"
cmake --build .  --config release
cmake --build .  --target install --config release
popd

Something is wrong in your command. opencv_contrib is defined twice. There is no opencv_contrib modules in your cmakeooutput My script to build opencv with opencv_contrib on raspberry :

#!/bin/bash -e
myRepo=$(pwd)
CMAKE_CONFIG_GENERATOR="Unix Makefiles"
if [  ! -d "$myRepo/opencv"  ]; then
    echo "clonning opencv"
    git clone https://github.com/opencv/opencv.git
    mkdir Build/opencv
    mkdir Install
    mkdir Install/opencv
else
    cd opencv
    git pull --rebase
    cd ..
fi
if [  ! -d "$myRepo/opencv_contrib"  ]; then
    echo "clonning opencv_contrib"
    git clone https://github.com/opencv/opencv_contrib.git
    mkdir Build/opencv_contrib
else
    cd opencv_contrib
    git pull --rebase
    cd ..
fi
RepoSource=opencv
pushd Build/$RepoSource
CMAKE_OPTIONS='-DBUILD_PERF_TESTS:BOOL=OFF -DBUILD_TESTS:BOOL=OFF -DBUILD_DOCS:BOOL=OFF  -DWITH_CUDA:BOOL=OFF -DBUILD_EXAMPLES:BOOL=OFF -DINSTALL_CREATE_DISTRIB=ON'
cmake -G"$CMAKE_CONFIG_GENERATOR" \
-DEIGEN_DIR:PATH="$myRepo"/eigen -DEIGEN_INCLUDE_DIR="$myRepo"/eigen -DEIGEN_INCLUDE_PATH="$myRepo"/eigen \
-DCeres_DIR="$myRepo"/Install/ceres-solver/lib/cmake/Ceres -DGLOG_INCLUDE_DIR="$myRepo"/Install/glog/include -Dglog_DIR:PATH="$myRepo"/Install/glog/lib/cmake/glog -DGLOG_LIBRARY:PATH="$myRepo"/Install/glog/lib/libglog.a \
-Dgflags_DIR:PATH="$myRepo"/Build/gflags -DGFLAGS_INCLUDE_DIR="$myRepo"/Build/gflags/include/gflags \
-DOPENCV_ENABLE_NONFREE=ON \
-DBUILD_opencv_world=OFF \
-DVTK_DIR:PATH="$myRepo"/Install/vtk/lib/cmake/vtk-8.1 \
-DWITH_OPENCL:BOOL=FALSE \
-DTesseract_INCLUDE_DIR=Tesseract/usr/include/tesseract \
$CMAKE_OPTIONS -DOPENCV_EXTRA_MODULES_PATH="$myRepo"/opencv_contrib/modules -DCMAKE_INSTALL_PREFIX="$myRepo"/Install/"$RepoSource" "$myRepo/$RepoSource"

echo "************************* $Source_DIR -->release"
cmake --build .  --config release
cmake --build .  --target install --config release
popd