Chris McCullough
Chris McCullough

Reputation: 21

correctly install openbr on ubuntu 18.04

I've been trying to install openbr on an ubuntu 18.04 digitalocean droplet.

Here's the latest process I've gotten going:

# --opencv install and build--
# installs opencv 2.4
sudo apt-get update

sudo apt install -y \
                build-essential \
                cmake \
                git \
                pkg-config \
                libgtk-3-dev \
                libavcodec-dev \
                libavformat-dev \
                libswscale-dev \
                libv4l-dev \
                libxvidcore-dev \
                libx264-dev \
                libjpeg-dev \
                libpng-dev \
                libtiff-dev \
                gfortran \
                openexr \
                libatlas-base-dev \
                python3-dev \
                python3-numpy \
                libtbb2 \
                libtbb-dev \
                libdc1394-22-dev

mkdir ~/opencv_build && cd ~/opencv_build
git clone --single-branch --branch 2.4 https://github.com/opencv/opencv.git

cd ~/opencv_build/opencv
mkdir build && cd build

cmake -D CMAKE_BUILD_TYPE=RELEASE \
    -D CMAKE_INSTALL_PREFIX=/usr/local \
    -D INSTALL_C_EXAMPLES=ON \
    -D INSTALL_PYTHON_EXAMPLES=ON \
    -D OPENCV_GENERATE_PKGCONFIG=ON \
    -D BUILD_EXAMPLES=ON ..

make -j6

sudo make install



# --qt install--

sudo apt-get update

# Installs qt version 5.9.5 as of 1 Apr 2020
sudo apt-get install -y qt5-default libqt5svg5-dev qtcreator



# --openbr install and build--

# download & prep openbr
git clone https://github.com/biometrics/openbr.git
cd openbr
git checkout v1.1.0
git submodule init
git submodule update

# build openbr
mkdir build # from the OpenBR root directory
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j6
sudo make install

This builds to the point where i can test openbr's example:

$ br -algorithm FaceRecognition -compare me.jpg you.jpg

I receive this error when running the above line with any images:

Set algorithm to FaceRecognition
Loading /usr/local/share/openbr/models/algorithms/FaceRecognition
Fatal: Failed to set br::Transform* br::IndependentTransform::transform to: 
  SDK Path: /usr/local
  File: 
  Function: 
  Line: 0

From what I understand, this is because I have the wrong version of qt. Openbr wants 5.4.1, but the earliest I've managed to install is 5.9.5.

It may have been more correct to say my question is how to install qt5.4.1. In the end though, all I'm after is a reliable and repeatable way to get openbr running on ubuntu 18.04.

Upvotes: 1

Views: 348

Answers (1)

JHowIX
JHowIX

Reputation: 1803

Ran into this same issue trying to run OpenBR on Ubuntu 18. Your diagnosis is correct, its a QT version issue. The fix got merged into the OpenBR master here but is not on the 2.4 branch. If you apply that edit to what is on the 2.4 and re-run the build steps, it worked on my box. Steps below:

  1. Open openbr/openbr/openbr_plugin.cpp
  2. Originally, line 1620 reads independent.set("transform", qVariantFromValue<void*>(transform));
  3. Replace it with independent.set("transform", QVariant::fromValue(transform));
  4. Rerun the build steps from inside your build folder.

Hope that works. Thanks.

Upvotes: 3

Related Questions