首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在ubuntu 18.04上正确安装openbr

在ubuntu 18.04上正确安装openbr
EN

Stack Overflow用户
提问于 2020-04-03 11:30:12
回答 1查看 248关注 0票数 1

我一直在尝试在ubuntu 18.04 digitalocean droplet上安装openbr。

下面是我的最新进展:

代码语言:javascript
复制
# --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

当运行包含任何图像的上述代码行时,我收到以下错误:

代码语言:javascript
复制
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可能更正确。最后,我所追求的就是在ubuntu 18.04上运行openbr的一种可靠且可重复的方式。

EN

回答 1

Stack Overflow用户

发布于 2020-04-27 02:38:21

在Ubuntu18上运行OpenBR时遇到了同样的问题。你的诊断是正确的,这是QT版本的问题。修复程序已合并到OpenBR主here中,但不在2.4分支上。如果您将编辑应用于2.4上内容,并重新运行构建步骤,它将在我的机器上起作用。步骤如下:

打开openbr/openbr/openbr_plugin.cpp

  • Originally,行1620显示为independent.set("transform", qVariantFromValue<void*>(transform));

  • Replace it independent.set("transform", QVariant::fromValue(transform));

  • Rerun
  1. steps from your build folder。

希望能行得通。谢谢。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61004688

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档