【发布时间】:2020-04-03 03:30:12
【问题描述】:
我一直在尝试在 ubuntu 18.04 digitalocean droplet 上安装 openbr。
这是我的最新流程:
# --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
这构建到我可以测试 openbr 的示例的地步:
$ br -algorithm FaceRecognition -compare me.jpg you.jpg
在使用任何图像运行上述行时,我收到此错误:
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
据我了解,这是因为我的 qt 版本错误。 Openbr 想要 5.4.1,但我设法安装的最早是 5.9.5。
说我的问题是如何安装 qt5.4.1 可能更正确。最后,我所追求的只是一种可靠且可重复的方式,让 openbr 在 ubuntu 18.04 上运行。
【问题讨论】:
-
你说:据我了解,这是因为我的qt版本不对。 Openbr 想要 5.4.1,但我设法安装的最早的是 5.9.5。,你为什么要指出这一点?显然openbr是用系统Qt编译的
-
Qt 是 openbr 的依赖项之一,他们在文档中指定使用 Qt5.4.1。他们的 github 上也有这个问题:github.com/biometrics/openbr/issues/468 谈到了我在使用 openbr 无法使用的 Qt 版本时遇到的问题。据我所知,Qt 贬低了 openbr 支持的所有版本。我一直无法安装比 qt5.9.5 更早的版本。