1 Star 0 Fork 0

李梦凡/gocv

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
travis_build_opencv.sh 2.53 KB
一键复制 编辑 原始数据 按行查看 历史
Ron Evans 提交于 2020-04-05 09:36 . opencv: update to OpenCV 4.3.0
#!/bin/bash
set -eux -o pipefail
OPENCV_VERSION=${OPENCV_VERSION:-4.3.0}
#GRAPHICAL=ON
GRAPHICAL=${GRAPHICAL:-OFF}
# OpenCV looks for libjpeg in /usr/lib/libjpeg.so, for some reason. However,
# it does not seem to be there in 14.04. Create a link
mkdir -p $HOME/usr/lib
if [[ ! -f "$HOME/usr/lib/libjpeg.so" ]]; then
ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so $HOME/usr/lib/libjpeg.so
fi
# Same for libpng.so
if [[ ! -f "$HOME/usr/lib/libpng.so" ]]; then
ln -s /usr/lib/x86_64-linux-gnu/libpng.so $HOME/usr/lib/libpng.so
fi
# Build OpenCV
if [[ ! -e "$HOME/usr/installed-${OPENCV_VERSION}" ]]; then
TMP=$(mktemp -d)
if [[ ! -d "opencv-${OPENCV_VERSION}/build" ]]; then
curl -sL https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip > ${TMP}/opencv.zip
unzip -q ${TMP}/opencv.zip
mkdir opencv-${OPENCV_VERSION}/build
rm ${TMP}/opencv.zip
fi
if [[ ! -d "opencv_contrib-${OPENCV_VERSION}/modules" ]]; then
curl -sL https://github.com/opencv/opencv_contrib/archive/${OPENCV_VERSION}.zip > ${TMP}/opencv-contrib.zip
unzip -q ${TMP}/opencv-contrib.zip
rm ${TMP}/opencv-contrib.zip
fi
rmdir ${TMP}
cd opencv-${OPENCV_VERSION}/build
cmake -D WITH_IPP=${GRAPHICAL} \
-D WITH_OPENGL=${GRAPHICAL} \
-D WITH_QT=${GRAPHICAL} \
-D BUILD_EXAMPLES=OFF \
-D BUILD_TESTS=OFF \
-D BUILD_PERF_TESTS=OFF \
-D BUILD_opencv_java=OFF \
-D BUILD_opencv_python=OFF \
-D BUILD_opencv_python2=OFF \
-D BUILD_opencv_python3=OFF \
-D OPENCV_GENERATE_PKGCONFIG=ON \
-D CMAKE_INSTALL_PREFIX=$HOME/usr \
-D OPENCV_ENABLE_NONFREE=ON \
-D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-${OPENCV_VERSION}/modules ..
make -j8
make install && touch $HOME/usr/installed-${OPENCV_VERSION}
# caffe test data
if [[ ! -d "${HOME}/testdata" ]]; then
mkdir ${HOME}/testdata
fi
#if [[ ! -f "${HOME}/testdata/bvlc_googlenet.prototxt" ]]; then
curl -sL https://raw.githubusercontent.com/opencv/opencv_extra/master/testdata/dnn/bvlc_googlenet.prototxt > ${HOME}/testdata/bvlc_googlenet.prototxt
#fi
#if [[ ! -f "${HOME}/testdata/bvlc_googlenet.caffemodel" ]]; then
curl -sL http://dl.caffe.berkeleyvision.org/bvlc_googlenet.caffemodel > ${HOME}/testdata/bvlc_googlenet.caffemodel
#fi
#if [[ ! -f "${HOME}/testdata/tensorflow_inception_graph.pb" ]]; then
curl -sL https://storage.googleapis.com/download.tensorflow.org/models/inception5h.zip > ${HOME}/testdata/inception5h.zip
unzip -o ${HOME}/testdata/inception5h.zip tensorflow_inception_graph.pb -d ${HOME}/testdata
#fi
cd ../..
touch $HOME/fresh-cache
fi
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/vanlemon/gocv.git
git@gitee.com:vanlemon/gocv.git
vanlemon
gocv
gocv
master

搜索帮助