安装OpenCV Contrib需要下载的文件

安装Contrib需要下载的文件:
位于opencv-3.4.0/.cache下有四个文件夹:
data ippicv tiny_dnn xfeatures2d

各文件命名如下:
.cache/data$ ls
7505c44ca4eb54b4ab1e4777cb96ac05-face_landmark_model.dat
下载地址:
https://raw.githubusercontent.com/opencv/opencv_3rdparty/8afa57abc8229d611c4937165d20e2a2d9fc5a12/face_landmark_model.dat

.cache/ippicv$ ls
4e0352ce96473837b1d671ce87f17359-ippicv_2017u3_lnx_intel64_general_20170822.tgz
下载地址:
https://github.com/opencv/opencv_3rdparty/tree/ippicv/master_20170822/ippicv

.cache/tiny_dnn$ ls
adb1c512e09ca2c7a6faef36f9c53e59-v1.0.0a3.tar.gz
下载地址:
https://github.com/tiny-dnn/tiny-dnn/archive/v1.0.0a3.tar.gz
https://codeload.github.com/tiny-dnn/tiny-dnn/tar.gz/v1.0.0a3

xfeatures2d/vgg$ ls
151805e03568c9f490a5e3a872777b75-vgg_generated_120.i
7126a5d9a8884ebca5aea5d63d677225-vgg_generated_64.i
7cd47228edec52b6d82f46511af325c5-vgg_generated_80.i
e8d0dcd54d1bcfdc29203d011a797179-vgg_generated_48.i

xfeatures2d/boostdesc$ ls
0ae0675534aa318d9668f2a179c2a052-boostdesc_lbgm.i
0ea90e7a8f3f7876d450e4149c97c74f-boostdesc_bgm.i
202e1b3e9fec871b04da31f7f016679f-boostdesc_binboost_064.i
232c966b13651bd0e46a1497b0852191-boostdesc_bgm_bi.i
324426a24fa56ad9c5b8e3e0b3e5303e-boostdesc_bgm_hd.i
98ea99d399965c03d555cef3ea502a0b-boostdesc_binboost_128.i
e6dcfa9f647779eb1ce446a8d759b6ea-boostdesc_binboost_256.i

下载地址(复制链接另存为文件):
#!/bin/bash
curl https://raw.githubusercontent.com/opencv/opencv_3rdparty/34e4206aef44d50e6bbcd0ab06354b52e7466d26/boostdesc_lbgm.i > 0ae0675534aa318d9668f2a179c2a052-boostdesc_lbgm.i
curl https://raw.githubusercontent.com/opencv/opencv_3rdparty/34e4206aef44d50e6bbcd0ab06354b52e7466d26/boostdesc_binboost_256.i > e6dcfa9f647779eb1ce446a8d759b6ea-boostdesc_binboost_256.i
curl https://raw.githubusercontent.com/opencv/opencv_3rdparty/34e4206aef44d50e6bbcd0ab06354b52e7466d26/boostdesc_binboost_128.i > 98ea99d399965c03d555cef3ea502a0b-boostdesc_binboost_128.i
curl https://raw.githubusercontent.com/opencv/opencv_3rdparty/34e4206aef44d50e6bbcd0ab06354b52e7466d26/boostdesc_binboost_064.i > 202e1b3e9fec871b04da31f7f016679f-boostdesc_binboost_064.i
curl https://raw.githubusercontent.com/opencv/opencv_3rdparty/34e4206aef44d50e6bbcd0ab06354b52e7466d26/boostdesc_bgm_hd.i > 324426a24fa56ad9c5b8e3e0b3e5303e-boostdesc_bgm_hd.i
curl https://raw.githubusercontent.com/opencv/opencv_3rdparty/34e4206aef44d50e6bbcd0ab06354b52e7466d26/boostdesc_bgm_bi.i > 232c966b13651bd0e46a1497b0852191-boostdesc_bgm_bi.i
curl https://raw.githubusercontent.com/opencv/opencv_3rdparty/34e4206aef44d50e6bbcd0ab06354b52e7466d26/boostdesc_bgm.i > 0ea90e7a8f3f7876d450e4149c97c74f-boostdesc_bgm.i
curl https://raw.githubusercontent.com/opencv/opencv_3rdparty/fccf7cd6a4b12079f73bbfb21745f9babcd4eb1d/vgg_generated_120.i > 151805e03568c9f490a5e3a872777b75-vgg_generated_120.i
curl https://raw.githubusercontent.com/opencv/opencv_3rdparty/fccf7cd6a4b12079f73bbfb21745f9babcd4eb1d/vgg_generated_64.i > 7126a5d9a8884ebca5aea5d63d677225-vgg_generated_64.i
curl https://raw.githubusercontent.com/opencv/opencv_3rdparty/fccf7cd6a4b12079f73bbfb21745f9babcd4eb1d/vgg_generated_48.i > e8d0dcd54d1bcfdc29203d011a797179-vgg_generated_48.i
curl https://raw.githubusercontent.com/opencv/opencv_3rdparty/fccf7cd6a4b12079f73bbfb21745f9babcd4eb1d/vgg_generated_80.i > 7cd47228edec52b6d82f46511af325c5-vgg_generated_80.i

sudo cp -r data /home/hong/Software/opencv-3.4.0/.cache
sudo cp -r ippicv /home/hong/Software/opencv-3.4.0/.cache
sudo cp -r tiny_dnn /home/hong/Software/opencv-3.4.0/.cache
sudo cp -r xfeatures2d /home/hong/Software/opencv-3.4.0/.cache

安装:
cd build
sudo cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local -D OPENCV_EXTRA_MODULES_PATH=/home/hong/Software/opencv-3.4.0/opencv_contrib-3.4.0/modules/ …
(-D OPENCV_ENABLE_NONFREE=ON )
sudo make -j4
sudo make install

卸载:
在build文件夹下运行
sudo make uninstall
cd …
sudo rm -r build
sudo rm -r /usr/local/include/opencv2 /usr/local/include/opencv /usr/include/opencv /usr/include/opencv2 /usr/local/share/opencv /usr/local/share/OpenCV /usr/share/opencv /usr/share/OpenCV /usr/local/bin/opencv* /usr/local/lib/libopencv*

sudo rm -r /usr/local/include/opencv2 /usr/local/include/opencv /usr/local/share/opencv /usr/local/bin/opencv* /usr/local/lib/libopencv*

参考链接:
https://blog.csdn.net/Star__dust/article/details/102833804
https://blog.csdn.net/CSDN330/article/details/86747867
https://github.com/opencv/opencv_contrib/issues/1301
https://blog.csdn.net/u011736771/article/details/85960300

你可能感兴趣的:(OpenCV,安装笔记)