Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenCV Improvements & Fixes Part 2 #54

Merged
merged 6 commits into from
Dec 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 4 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
language: python
matrix:
os: linux

jobs:
include:
- name: xenial-basic
os: linux
sudo: required
dist: xenial
script:
- CIINSTALL=yes ./1-BasicSetUp.sh
Expand All @@ -13,26 +13,18 @@ matrix:
- CIINSTALL=yes ./2-GenSoftware.sh
python: 3.7
- name: xenial-opencv
os: linux
sudo: required
dist: xenial
script: CIINSTALL=yes ./opencvDirectInstall.sh
python: 3.7
- name: xenial-ml
os: linux
sudo: required
dist: xenial
script: CIINSTALL=yes ./3-ML-Build.sh
python: 3.7
- name: xenial-ml-basic
os: linux
sudo: required
dist: xenial
script: CIINSTALL=yes ./ML-Basic.sh
python: 3.7
- name: bionic-basic
os: linux
sudo: required
dist: bionic
script:
- CIINSTALL=yes ./1-BasicSetUp.sh
Expand All @@ -42,27 +34,21 @@ matrix:
- CIINSTALL=yes ./2-GenSoftware.sh
python: 3.7
- name: bionic-opencv
os: linux
sudo: required
dist: bionic
script: CIINSTALL=yes ./opencvDirectInstall.sh
python: 3.7
- name: bionic-ml
os: linux
sudo: required
dist: bionic
script: CIINSTALL=yes ./3-ML-Build.sh
python: 3.7
- name: bionic-ml-basic
os: linux
sudo: required
dist: bionic
script: CIINSTALL=yes ./ML-Basic.sh
python: 3.7
before_install:
- sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe restricted multiverse"
- sudo apt-get update -qq
- sudo apt-get install -y software-properties-common
- sudo apt-get install -qq build-essential curl g++ python-dev python3-dev python-setuptools python3-setuptools
- sudo apt-get install -qq build-essential curl g++ python3-dev python3-setuptools
- echo 'America/Los_Angeles' | sudo tee /etc/timezone
- sudo dpkg-reconfigure --frontend noninteractive tzdata
12 changes: 8 additions & 4 deletions opencvDirectInstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,11 @@ if [[ ! -n $(cat $SHELLRC | grep '# ffmpeg-build-script') ]]; then
# Build libraries with --enable-shared so that they can be used by OpenCV
sed -i 's/--disable-shared/--enable-shared/g' build-ffmpeg
sed -i 's/--enable-shared\ \\/--enable-shared\ --cc="gcc -fPIC"\ \\/g' build-ffmpeg
sed -i 's/-DENABLE_SHARED:bool=off/-DENABLE_SHARED:bool=on/g' build-ffmpeg
sed -i 's/-DBUILD_SHARED_LIBS=OFF/-DBUILD_SHARED_LIBS=ON/g' build-ffmpeg

# Build libaom as a shared library
sed -i 's/execute cmake -DENABLE_TESTS=0 -DCMAKE_INSTALL_PREFIX:PATH=${WORKSPACE} $PACKAGES\/av1/execute cmake -DENABLE_TESTS=0 -DBUILD_SHARED_LIBS=1 -DCMAKE_INSTALL_PREFIX:PATH=${WORKSPACE} $PACKAGES\/av1/g' build-ffmpeg
# Build libx265 as a shared library
sed -i 's/execute cmake -DCMAKE_INSTALL_PREFIX:PATH=${WORKSPACE} -DENABLE_SHARED:bool=off ./execute cmake -DCMAKE_INSTALL_PREFIX:PATH=${WORKSPACE} -DENABLE_SHARED:bool=on ./g' build-ffmpeg
# Build vidstab as a shared library. Although by default vidstab is built as a shared library, this is just additional precaution
sed -i 's/execute cmake -DCMAKE_INSTALL_PREFIX:PATH=${WORKSPACE} ./execute cmake -DCMAKE_INSTALL_PREFIX:PATH=${WORKSPACE} -DBUILD_SHARED_LIBS=1 ./g' build-ffmpeg

AUTOINSTALL=yes ./build-ffmpeg --build

Expand Down Expand Up @@ -128,6 +127,7 @@ execute sudo apt-get install libfaac-dev libmp3lame-dev -y
execute sudo apt-get install libopencore-amrnb-dev libopencore-amrwb-dev -y
execute sudo apt-get install yasm libtheora-dev libvorbis-dev libxvidcore-dev -y
execute sudo apt-get install libv4l-dev v4l-utils libdc1394-22-dev libdc1394-utils libgphoto2-dev -y # Uncommend if you want to enable other backends
execute sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly -y

spatialPrint "Java"
execute sudo apt-get install -y ant default-jdk
Expand Down Expand Up @@ -181,6 +181,7 @@ cd build
py3Ex=$(which python3)
py3In=$(python3 -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())")
py3Pack=$(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
py3Lib=$(python3 -c "import distutils.sysconfig as sysconfig; import os; print(os.path.join(sysconfig.get_config_var('LIBDIR'), sysconfig.get_config_var('LDLIBRARY')))")

# Anaconda no longer has the malformed MKL library, (if you are using an older Anaconda, use earlier versions of this file)
# However, the font and pangoft libraries still cause problems. Hence, need to rename them
Expand Down Expand Up @@ -210,12 +211,15 @@ cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D PYTHON3_EXECUTABLE="$py3Ex" \
-D PYTHON3_INCLUDE_DIR="$py3In" \
-D PYTHON3_PACKAGES_PATH="$py3Pack" \
-D PYTHON3_LIBRARY="$py3Lib" \
-D PYTHON_DEFAULT_EXECUTABLE="$py3Ex" \
-D WITH_FFMPEG=1 \
-D WITH_GSTREAMER=ON \
-D WITH_V4L=1 \
-D WITH_LIBV4L=1 \
-D WITH_TBB=1 \
-D WITH_IPP=1 \
-D OPENCV_ENABLE_NONFREE=ON \
-D ENABLE_FAST_MATH=1 \
-D BUILD_EXAMPLES=0 \
-D BUILD_DOCS=0 \
Expand Down