demo开发之问题04编译ubuntu环境下编译opencv

一、安装过程中出现的问题

1.  looking for ccache --not found

sudo apt-get install ccache

2.  Performance test HAVE)C_WSUGGEST_OVERRIDE - Failed

What parameter did you pass to cmake to allow for "Non-free algorithms: YES"? I have tried -D OPENCV_ENABLE_NON_FREE=ON and other combinations of that nature, but have yet to get the YES I want.

3. could not find jasper

sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main"
sudo apt update
sudo apt install libjasper1 libjasper-dev

4. no package 'gtk+-3.0 found'

sudo apt-get install build-essential libgtk-3-dev

 5. could not found OpenBLAS include. Turning OpenBLAS_FOUND off

https://github.com/opencv/opencv/issues/12957

https://stackoverflow.com/questions/36483054/install-openblas-via-apt-get-sudo-apt-get-install-openblas-dev

1)安装package

udo apt install libopenblas-dev, libopenblas-base

但是在安装过程中可能出现无法定位包的问题,即为unable to locate libopenblas-dev, libopenblas-base,这是可执行以下操作,

apt-cache search openblas

libblas-test - Basic Linear Algebra Subroutines 3, testing programs
libopenblas-base - Optimized BLAS (linear algebra) library based on GotoBLAS2
libopenblas-dev - Optimized BLAS (linear algebra) library based on GotoBLAS2

然后再次安装;最后,执行以下操作。

sudo apt install liblapacke-dev

sudo ln -s /usr/include/lapacke.h /usr/include/x86_64-linux-gnu # corrected path for the library 

2)修改配置文件

Appending these respective additional Paths in OpenCVFindOpenBLAS.cmake :

opencv/cmake/OpenCVFindOpenBLAS.cmake

Line 46 in eb981cc

SET(Open_BLAS_INCLUDE_SEARCH_PATH

and

opencv/cmake/OpenCVFindOpenBLAS.cmake

Line 58 in eb981cc

SET(Open_BLAS_LIB_SEARCH_PATHS

6. CBLAS/LAPACK header are not found in /usr/include/x86_64-linux-gun

7.Could NOT find HDF5

sudo apt-get install libhdf5-dev

8. module opencv-ovis disabled because OGRE3D was not found

sudo apt-get install libogre-1.9-dev # 1.9不能省略

9.data downloda:face_landmark_model.dat==>timeout

将opencv/build/CMakeDownloadLog.txt中face_landmark_model选项的数据下载地址修改为https://github.com/opencv/opencv_3rdparty/blob/contrib_face_alignment_20170818/face_landmark_model.dat

10.VTK is not found,please set -DVTK_DIR in CMake to VTK build directory,or to VTK install

1) 从VTK官网下载最新的稳定版本

2)使用cmake重新编译,然后进入build文件执行sudo make install

11. Checking for modules 'tesseract;lept'  No package 'tesseract' found Tesseract:   NO

https://www.linux.com/blog/using-tesseract-ubuntu

1) 安装依赖包

$ sudo apt-get install libpng-dev libjpeg-dev libtiff-dev zlib1g-dev

$ sudo apt-get install gcc g++

$ sudo apt-get install autoconf automake libtool checkinstall

2)下载tessearct

$ cd ~ $ git clone https://github.com/tesseract-ocr/tesseract.git $ cd tesseract

3)使用cmake重新编译,保证没有错误

4)编译成功后,进入build问加减,执行以下命令:sudo make install

12.Found installed version of gflags: /usr/lib/x86_64-linux-gnu/cmake/gflags
Detected gflags version: 2.2.1
Failed to find glog - Could not find glog include directory, set GLOG_INCLUDE_DIR to directory containing glog/logging.h
Module opencv_sfm disabled because the following dependencies are not found: Glog/Gflags

sudo apt-get install -y libgflags-dev libgoogle-glog-dev liblmdb-dev

13. Module opencv_ovis disabled because OGRE3D was not found

这里需要安装ogre3d,但是在安装它之前,需要先安装ois

1)从git上下载

https://github.com/ogre3d/OIS.git

2)cmake一下,然后进入build 完成sudo make install

3)git上下载

https://github.com/OGRECave/ogre.git

4)cmake一下

进入build,输入以下命令 sudo make install

14. Ceres Solver for reconstruction API is required.

1)检查依赖包是否安装

# google-glog + gflags
sudo apt-get install libgoogle-glog-dev
# BLAS & LAPACK
sudo apt-get install libatlas-base-dev
# Eigen3
sudo apt-get install libeigen3-dev
# SuiteSparse and CXSparse (optional)
# - If you want to build Ceres as a *static* library (the default)
#   you can use the SuiteSparse package in the main Ubuntu package
#   repository:
sudo apt-get install libsuitesparse-dev
# - However, if you want to build Ceres as a *shared* library, you must
#   add the following PPA:
sudo add-apt-repository ppa:bzindovic/suitesparse-bugfix-1319687
sudo apt-get update
sudo apt-get install libsuitesparse-dev

2)从github上下载ceres-solver

git clone https://github.com/ceres-solver/ceres-solver.git

3)重新编译,记得在build文件中运行sudo make install

15. Tesseract_include_dir not found in moudle/text

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
Tesseract_INCLUDE_DIR
   used as include directory in directory /home/rodrigo/opencv_contrib-3.2.0/modules/text

1) 把 Tesseract_build文件清空,重新编译。

2)把opencv的build文件清空,重新编译

二、总结

1)大部分问题是依赖包没有安装,所以在google的时候注意控制关键字,install XXX.

2)  不要着急,逐个攻破。

 

 

 

 

你可能感兴趣的:(demo开发之问题04编译ubuntu环境下编译opencv)