I managed to get it compiled and working on MacOS with contrib modules mostly based on instructions from here.
Assuming you are in /Users/chris/P/opencv
brew install pkg-config
git clone [email protected]:opencv/opencv_contrib.git
git clone [email protected]:opencv/opencv.git
cd opencv
mkdir build
Then this command didn't work for me.
cmake -D WITH_CUDA=OFF -D CMAKE_BUILD_TYPE=RELEASE -D OPENCV_EXTRA_MODULES_PATH=/Users/chris/P/opencv/opencv_contrib/modules
So I opened cmake gui and set the above params using it. Configure & Generate.
Then goto the build folder /Users/chris/P/opencv/opencv/build
and run
make
make install
cp /usr/local/lib/pkgconfig/opencv.pc /usr/local/lib/pkgconfig/opencv3.pc
Now finally to test it
cd /Users/chris/P/opencv/opencv_contrib/modules/aruco/samples
g++ -ggdb `pkg-config --cflags --libs opencv3` detect_markers.cpp -o /tmp/detect_markers
/tmp/detect_markers
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…