OpenCV 3.0安装问题

15

我需要OpenCV 3.0,因为它支持我需要的一些新功能。我使用了以下代码进行安装(我曾经成功地使用这个代码安装了OpenCV 2.4.9,但是对于OpenCV 3.0,在执行cmake步骤时,由于MD5校验和不匹配而出现了一些错误)。

mkdir OpenCV
cd OpenCV
echo "Removing any pre-installed ffmpeg and x264"
sudo apt-get -qq remove ffmpeg x264 libx264-dev
echo "Installing Dependenices"
sudo apt-get -qq install libopencv-dev build-essential checkinstall cmake pkg-config yasm libjpeg-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libxine-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev python-dev python-numpy libtbb-dev libqt4-dev libgtk2.0-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils ffmpeg
echo "Installing OpenCV" $version
unzip OpenCV-3.0.zip #i manually installed opencv3.0 zipfile for linux from https://github.com/Itseez/opencv/archive/3.0.0-alpha.zip
cd opencv-3.0.0-alpha
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON ..
make -j2
sudo checkinstall
sudo sh -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'
sudo ldconfig
echo "OpenCV 3.0 ready to be used"

执行cmake命令时,我遇到了错误。 输出如下:

clive@clive-Aspire-4755:~/OpenCV/opencv-3.0.0-alpha/build$ cmake -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON ..
-- The CXX compiler identification is GNU
-- The C compiler identification is GNU
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detected version of GNU GCC: 46 (406)
-- Performing Test HAVE_CXX_FSIGNED_CHAR
-- Performing Test HAVE_CXX_FSIGNED_CHAR - Success
-- Performing Test HAVE_C_FSIGNED_CHAR
-- Performing Test HAVE_C_FSIGNED_CHAR - Success
-- Performing Test HAVE_CXX_W
-- Performing Test HAVE_CXX_W - Success
-- Performing Test HAVE_C_W
-- Performing Test HAVE_C_W - Success
-- Performing Test HAVE_CXX_WALL
-- Performing Test HAVE_CXX_WALL - Success
-- Performing Test HAVE_C_WALL
-- Performing Test HAVE_C_WALL - Success
-- Performing Test HAVE_CXX_WERROR_RETURN_TYPE
-- Performing Test HAVE_CXX_WERROR_RETURN_TYPE - Success
-- Performing Test HAVE_C_WERROR_RETURN_TYPE
-- Performing Test HAVE_C_WERROR_RETURN_TYPE - Success
-- Performing Test HAVE_CXX_WERROR_NON_VIRTUAL_DTOR
-- Performing Test HAVE_CXX_WERROR_NON_VIRTUAL_DTOR - Success
-- Performing Test HAVE_C_WERROR_NON_VIRTUAL_DTOR
-- Performing Test HAVE_C_WERROR_NON_VIRTUAL_DTOR - Success
-- Performing Test HAVE_CXX_WERROR_ADDRESS
-- Performing Test HAVE_CXX_WERROR_ADDRESS - Success
-- Performing Test HAVE_C_WERROR_ADDRESS
-- Performing Test HAVE_C_WERROR_ADDRESS - Success
-- Performing Test HAVE_CXX_WERROR_SEQUENCE_POINT
-- Performing Test HAVE_CXX_WERROR_SEQUENCE_POINT - Success
-- Performing Test HAVE_C_WERROR_SEQUENCE_POINT
-- Performing Test HAVE_C_WERROR_SEQUENCE_POINT - Success
-- Performing Test HAVE_CXX_WFORMAT
-- Performing Test HAVE_CXX_WFORMAT - Success
-- Performing Test HAVE_C_WFORMAT
-- Performing Test HAVE_C_WFORMAT - Success
-- Performing Test HAVE_CXX_WERROR_FORMAT_SECURITY
-- Performing Test HAVE_CXX_WERROR_FORMAT_SECURITY - Success
-- Performing Test HAVE_C_WERROR_FORMAT_SECURITY
-- Performing Test HAVE_C_WERROR_FORMAT_SECURITY - Success
-- Performing Test HAVE_CXX_WMISSING_DECLARATIONS
-- Performing Test HAVE_CXX_WMISSING_DECLARATIONS - Success
-- Performing Test HAVE_C_WMISSING_DECLARATIONS
-- Performing Test HAVE_C_WMISSING_DECLARATIONS - Success
-- Performing Test HAVE_CXX_WMISSING_PROTOTYPES
-- Performing Test HAVE_CXX_WMISSING_PROTOTYPES - Failed
-- Performing Test HAVE_C_WMISSING_PROTOTYPES
-- Performing Test HAVE_C_WMISSING_PROTOTYPES - Success
-- Performing Test HAVE_CXX_WSTRICT_PROTOTYPES
-- Performing Test HAVE_CXX_WSTRICT_PROTOTYPES - Failed
-- Performing Test HAVE_C_WSTRICT_PROTOTYPES
-- Performing Test HAVE_C_WSTRICT_PROTOTYPES - Success
-- Performing Test HAVE_CXX_WUNDEF
-- Performing Test HAVE_CXX_WUNDEF - Success
-- Performing Test HAVE_C_WUNDEF
-- Performing Test HAVE_C_WUNDEF - Success
-- Performing Test HAVE_CXX_WINIT_SELF
-- Performing Test HAVE_CXX_WINIT_SELF - Success
-- Performing Test HAVE_C_WINIT_SELF
-- Performing Test HAVE_C_WINIT_SELF - Success
-- Performing Test HAVE_CXX_WPOINTER_ARITH
-- Performing Test HAVE_CXX_WPOINTER_ARITH - Success
-- Performing Test HAVE_C_WPOINTER_ARITH
-- Performing Test HAVE_C_WPOINTER_ARITH - Success
-- Performing Test HAVE_CXX_WSHADOW
-- Performing Test HAVE_CXX_WSHADOW - Success
-- Performing Test HAVE_C_WSHADOW
-- Performing Test HAVE_C_WSHADOW - Success
-- Performing Test HAVE_CXX_WSIGN_PROMO
-- Performing Test HAVE_CXX_WSIGN_PROMO - Success
-- Performing Test HAVE_C_WSIGN_PROMO
-- Performing Test HAVE_C_WSIGN_PROMO - Failed
-- Performing Test HAVE_CXX_WNO_NARROWING
-- Performing Test HAVE_CXX_WNO_NARROWING - Failed
-- Performing Test HAVE_C_WNO_NARROWING
-- Performing Test HAVE_C_WNO_NARROWING - Failed
-- Performing Test HAVE_CXX_WNO_DELETE_NON_VIRTUAL_DTOR
-- Performing Test HAVE_CXX_WNO_DELETE_NON_VIRTUAL_DTOR - Failed
-- Performing Test HAVE_C_WNO_DELETE_NON_VIRTUAL_DTOR
-- Performing Test HAVE_C_WNO_DELETE_NON_VIRTUAL_DTOR - Failed
-- Performing Test HAVE_CXX_WNO_UNNAMED_TYPE_TEMPLATE_ARGS
-- Performing Test HAVE_CXX_WNO_UNNAMED_TYPE_TEMPLATE_ARGS - Failed
-- Performing Test HAVE_C_WNO_UNNAMED_TYPE_TEMPLATE_ARGS
-- Performing Test HAVE_C_WNO_UNNAMED_TYPE_TEMPLATE_ARGS - Failed
-- Performing Test HAVE_CXX_FDIAGNOSTICS_SHOW_OPTION
-- Performing Test HAVE_CXX_FDIAGNOSTICS_SHOW_OPTION - Success
-- Performing Test HAVE_C_FDIAGNOSTICS_SHOW_OPTION
-- Performing Test HAVE_C_FDIAGNOSTICS_SHOW_OPTION - Success
-- Performing Test HAVE_CXX_WNO_LONG_LONG
-- Performing Test HAVE_CXX_WNO_LONG_LONG - Success
-- Performing Test HAVE_C_WNO_LONG_LONG
-- Performing Test HAVE_C_WNO_LONG_LONG - Success
-- Performing Test HAVE_CXX_PTHREAD
-- Performing Test HAVE_CXX_PTHREAD - Success
-- Performing Test HAVE_C_PTHREAD
-- Performing Test HAVE_C_PTHREAD - Success
-- Performing Test HAVE_CXX_FOMIT_FRAME_POINTER
-- Performing Test HAVE_CXX_FOMIT_FRAME_POINTER - Success
-- Performing Test HAVE_C_FOMIT_FRAME_POINTER
-- Performing Test HAVE_C_FOMIT_FRAME_POINTER - Success
-- Performing Test HAVE_CXX_MSSE
-- Performing Test HAVE_CXX_MSSE - Success
-- Performing Test HAVE_C_MSSE
-- Performing Test HAVE_C_MSSE - Success
-- Performing Test HAVE_CXX_MSSE2
-- Performing Test HAVE_CXX_MSSE2 - Success
-- Performing Test HAVE_C_MSSE2
-- Performing Test HAVE_C_MSSE2 - Success
-- Performing Test HAVE_CXX_MSSE3
-- Performing Test HAVE_CXX_MSSE3 - Success
-- Performing Test HAVE_C_MSSE3
-- Performing Test HAVE_C_MSSE3 - Success
-- Performing Test HAVE_CXX_FFUNCTION_SECTIONS
-- Performing Test HAVE_CXX_FFUNCTION_SECTIONS - Success
-- Performing Test HAVE_C_FFUNCTION_SECTIONS
-- Performing Test HAVE_C_FFUNCTION_SECTIONS - Success
-- Performing Test HAVE_CXX_FVISIBILITY_HIDDEN
-- Performing Test HAVE_CXX_FVISIBILITY_HIDDEN - Success
-- Performing Test HAVE_C_FVISIBILITY_HIDDEN
-- Performing Test HAVE_C_FVISIBILITY_HIDDEN - Success
-- Performing Test HAVE_CXX_FVISIBILITY_INLINES_HIDDEN
-- Performing Test HAVE_CXX_FVISIBILITY_INLINES_HIDDEN - Success
-- Performing Test HAVE_C_FVISIBILITY_INLINES_HIDDEN
-- Performing Test HAVE_C_FVISIBILITY_INLINES_HIDDEN - Failed
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found suitable version "1.2.3.4", required is "1.2.3")
-- Found TIFF: /usr/lib/x86_64-linux-gnu/libtiff.so 
-- Found JPEG: /usr/lib/x86_64-linux-gnu/libjpeg.so 
-- Performing Test HAVE_C_WNO_UNUSED_VARIABLE
-- Performing Test HAVE_C_WNO_UNUSED_VARIABLE - Success
-- Performing Test HAVE_C_WNO_SHADOW
-- Performing Test HAVE_C_WNO_SHADOW - Success
-- Performing Test HAVE_C_WNO_MAYBE_UNINITIALIZED
-- Performing Test HAVE_C_WNO_MAYBE_UNINITIALIZED - Failed
-- Found Jasper: /usr/lib/x86_64-linux-gnu/libjasper.so 
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.3.4")
-- Found PNG: /usr/lib/x86_64-linux-gnu/libpng.so 
-- Looking for /usr/include/libpng/png.h
-- Looking for /usr/include/libpng/png.h - found
-- Found OpenEXR: /usr/lib/libIlmImf.so
CMake Warning at cmake/OpenCVFindLibsGUI.cmake:18 (find_package):
  Could not find module FindQt5Core.cmake or a configuration file for package
  Qt5Core.

  Adjust CMAKE_MODULE_PATH to find FindQt5Core.cmake or set Qt5Core_DIR to
  the directory containing a CMake configuration file for Qt5Core.  The file
  will have one of the following names:

    Qt5CoreConfig.cmake
    qt5core-config.cmake

Call Stack (most recent call first):
  CMakeLists.txt:447 (include)


CMake Warning at cmake/OpenCVFindLibsGUI.cmake:19 (find_package):
  Could not find module FindQt5Gui.cmake or a configuration file for package
  Qt5Gui.

  Adjust CMAKE_MODULE_PATH to find FindQt5Gui.cmake or set Qt5Gui_DIR to the
  directory containing a CMake configuration file for Qt5Gui.  The file will
  have one of the following names:

    Qt5GuiConfig.cmake
    qt5gui-config.cmake

Call Stack (most recent call first):
  CMakeLists.txt:447 (include)


CMake Warning at cmake/OpenCVFindLibsGUI.cmake:20 (find_package):
  Could not find module FindQt5Widgets.cmake or a configuration file for
  package Qt5Widgets.

  Adjust CMAKE_MODULE_PATH to find FindQt5Widgets.cmake or set Qt5Widgets_DIR
  to the directory containing a CMake configuration file for Qt5Widgets.  The
  file will have one of the following names:

    Qt5WidgetsConfig.cmake
    qt5widgets-config.cmake

Call Stack (most recent call first):
  CMakeLists.txt:447 (include)


CMake Warning at cmake/OpenCVFindLibsGUI.cmake:21 (find_package):
  Could not find module FindQt5Test.cmake or a configuration file for package
  Qt5Test.

  Adjust CMAKE_MODULE_PATH to find FindQt5Test.cmake or set Qt5Test_DIR to
  the directory containing a CMake configuration file for Qt5Test.  The file
  will have one of the following names:

    Qt5TestConfig.cmake
    qt5test-config.cmake

Call Stack (most recent call first):
  CMakeLists.txt:447 (include)


CMake Warning at cmake/OpenCVFindLibsGUI.cmake:22 (find_package):
  Could not find module FindQt5Concurrent.cmake or a configuration file for
  package Qt5Concurrent.

  Adjust CMAKE_MODULE_PATH to find FindQt5Concurrent.cmake or set
  Qt5Concurrent_DIR to the directory containing a CMake configuration file
  for Qt5Concurrent.  The file will have one of the following names:

    Qt5ConcurrentConfig.cmake
    qt5concurrent-config.cmake

Call Stack (most recent call first):
  CMakeLists.txt:447 (include)


-- Looking for Q_WS_X11
-- Looking for Q_WS_X11 - found
-- Looking for Q_WS_WIN
-- Looking for Q_WS_WIN - not found.
-- Looking for Q_WS_QWS
-- Looking for Q_WS_QWS - not found.
-- Looking for Q_WS_MAC
-- Looking for Q_WS_MAC - not found.
-- Found Qt4: /usr/bin/qmake (found version "4.8.1")
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found X11: /usr/lib/x86_64-linux-gnu/libX11.so
-- checking for module 'gstreamer-base-1.0'
--   package 'gstreamer-base-1.0' not found
-- checking for module 'gstreamer-video-1.0'
--   package 'gstreamer-video-1.0' not found
-- checking for module 'gstreamer-app-1.0'
--   package 'gstreamer-app-1.0' not found
-- checking for module 'gstreamer-riff-1.0'
--   package 'gstreamer-riff-1.0' not found
-- checking for module 'gstreamer-pbutils-1.0'
--   package 'gstreamer-pbutils-1.0' not found
-- checking for module 'gstreamer-base-0.10'
--   found gstreamer-base-0.10, version 0.10.36
-- checking for module 'gstreamer-video-0.10'
--   found gstreamer-video-0.10, version 0.10.36
-- checking for module 'gstreamer-app-0.10'
--   found gstreamer-app-0.10, version 0.10.36
-- checking for module 'gstreamer-riff-0.10'
--   found gstreamer-riff-0.10, version 0.10.36
-- checking for module 'gstreamer-pbutils-0.10'
--   found gstreamer-pbutils-0.10, version 0.10.36
-- checking for module 'libdc1394-2'
--   found libdc1394-2, version 2.2.0
-- checking for module 'libv4l1'
--   found libv4l1, version 0.8.6
-- Looking for linux/videodev.h
-- Looking for linux/videodev.h - not found
-- Looking for linux/videodev2.h
-- Looking for linux/videodev2.h - found
-- Looking for sys/videoio.h
-- Looking for sys/videoio.h - not found
-- checking for module 'libavcodec'
--   found libavcodec, version 53.35.0
-- checking for module 'libavformat'
--   found libavformat, version 53.21.1
-- checking for module 'libavutil'
--   found libavutil, version 51.22.2
-- checking for module 'libswscale'
--   found libswscale, version 2.1.0
-- Looking for libavformat/avformat.h
-- Looking for libavformat/avformat.h - found
-- Looking for ffmpeg/avformat.h
-- Looking for ffmpeg/avformat.h - not found
-- checking for module 'tbb'
--   found tbb, version 3.0+r018
CMake Warning at 3rdparty/ippicv/downloader.cmake:54 (message):
  ICV: Local copy of ICV package has invalid MD5 hash:
  9a7fea9124cb057264446ab1c7f5841d (expected:
  d80cb24f3a565113a9d6dc56344142f6)
Call Stack (most recent call first):
  3rdparty/ippicv/downloader.cmake:108 (_icv_downloader)
  cmake/OpenCVFindIPP.cmake:212 (include)
  cmake/OpenCVFindLibsPerf.cmake:12 (include)
  CMakeLists.txt:449 (include)


-- ICV: Downloading ippicv_linux_20140513.tgz...
CMake Error at 3rdparty/ippicv/downloader.cmake:71 (file):
  file DOWNLOAD MD5 mismatch

    for file: [/home/clive/OpenCV/opencv-3.0.0-alpha/3rdparty/ippicv/downloads/linux-d80cb24f3a565113a9d6dc56344142f6/ippicv_linux_20140513.tgz]
      expected MD5 sum: [d80cb24f3a565113a9d6dc56344142f6]
        actual MD5 sum: [ad7124f0fc04a24f6c725d2dbbc436db]

Call Stack (most recent call first):
  3rdparty/ippicv/downloader.cmake:108 (_icv_downloader)
  cmake/OpenCVFindIPP.cmake:212 (include)
  cmake/OpenCVFindLibsPerf.cmake:12 (include)
  CMakeLists.txt:449 (include)


CMake Error at 3rdparty/ippicv/downloader.cmake:75 (message):
  ICV: Failed to download ICV package: ippicv_linux_20140513.tgz.
  Status=28;"Timeout was reached"
Call Stack (most recent call first):
  3rdparty/ippicv/downloader.cmake:108 (_icv_downloader)
  cmake/OpenCVFindIPP.cmake:212 (include)
  cmake/OpenCVFindLibsPerf.cmake:12 (include)
  CMakeLists.txt:449 (include)


-- Configuring incomplete, errors occurred!
为什么校验和不同?是因为OpenCV3.0需要另一个版本的ippicv吗?我知道错误出现在下载ippicv_linux_20140513.tgz时(位于第三方ippicv文件夹中)。
可以有人帮帮我吗?任何帮助都将不胜感激!
PS. 我想使用Python的OpenCV3.0。OpenCV2.4.9一直表现良好,直到我尝试删除它。我实际上从系统中删除了每个名为“opencv”的文件。我不知道如何正确卸载它。

2
是的,真糟糕(顺便说一下,win也有同样的问题)。由于您主要想使用Python,请尝试cmake -DWITH_IPP=OFF并让CMake跳过损坏的IPP下载。 - berak
@Mike Ounsworth,我该如何安装Qt5? - Clive
这超出了我的能力范围,我不知道ippicv是什么。我总是从软件包管理器中安装opencv。 - Mike Ounsworth
问题已解决。我在cmake代码的末尾添加了-D WITH_IPP=OFF。感谢berak和Mike Ounsworth的帮助。虽然我仍然没有找到如何安装Qt5。 - Clive
我遇到了同样的问题,但是在 Windows 7 上,我该如何添加手动下载的 ipp 包,以便 CMake gui 不会尝试下载它(并失败)? - Elod
显示剩余5条评论
6个回答

11

对于Ubuntu 14.04,请按照以下步骤进行操作:

步骤1:

运行以下命令以安装OpenCV所需的依赖项:

sudo apt-get -y install libopencv-dev build-essential cmake git libgtk2.0-dev pkg-config python-dev python-numpy libdc1394-22 libdc1394-22-dev libjpeg-dev libpng12-dev libtiff4-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libxine-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev libtbb-dev libqt4-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils unzip

步骤2: -

下载最新版本的OpenCV。

wget https://github.com/Itseez/opencv/archive/3.0.0-alpha.zip
unzip opencv-3.0.0-alpha.zip

第三步:-

安装OpenCV

cd opencv-3.0.0-alpha
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D WITH_QT=ON -D WITH_OPENGL=ON ..

注意: 如果你遇到哈希不匹配的错误,那么请手动从sourceforge下载文件ippicv_linux_20140513.tgz

下载文件后,将文件内容提取到opencv-3.0.0-alpha文件夹中的ippicv文件夹中。

现在,在cmake命令之前添加选项-D WITH_IPP=OFF

然后执行以下命令:

make -j $(nproc)
sudo make install

步骤 4

完成安装。

现在进行一些最后的调整:

sudo /bin/bash -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'
sudo ldconfig

执行完整个流程后

sudo apt-get update

现在重新启动您的系统。

现在您已经安装了可工作的OpenCV。

来源http://rodrigoberriel.com/


3
如果您在编译时将 IPP (WITH_IPP=OFF) 关闭,那么下载 ippicv 的意义是什么? - Juan Simón
WITH_IPP的默认设置是什么?难道你不需要让它编译时打开这个选项吗?这里有一个类似的问题。https://dev59.com/apLea4cB1Zd3GeqP0Ut4 - NeoJi

6

请从这里下载有问题的文件:

http://sourceforge.net/projects/opencvlibrary/files/3rdparty/ippicv/

然后将该文件放置在应该下载到的文件夹中:

<您的OpenCV构建>/3rdparty/ippicv/downloads/<您的操作系统和版本>

请注意,“您的操作系统和版本”文件夹名称指示您需要从sourceforge下载的文件。


3
安装OpenCV 3.2.0Ubuntu 16.04上的步骤如下:

所需软件包:

$ sudo apt-get install build-essential
$ sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
$ sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev

下载 OpenCV:

$ sudo apt-get install wget
$ wget -O opencv-3.2.0.tar.gz https://github.com/opencv/opencv/archive/3.2.0.tar.gz
$ wget -O ippicv_linux_20151201.tgz https://raw.githubusercontent.com/opencv/opencv_3rdparty/81a676001ca8075ada498583e4166079e5744668/ippicv/ippicv_linux_20151201.tgz

安装OpenCV:

$ sudo apt-get install tar
$ tar xf opencv-3.2.0.tar.gz
$ mkdir -p opencv-3.2.0/3rdparty/ippicv/downloads/linux-808b791a6eac9ed78d32a7666804320e
$ cp ippicv_linux_20151201.tgz opencv-3.2.0/3rdparty/ippicv/downloads/linux-808b791a6eac9ed78d32a7666804320e/ippicv_linux_20151201.tgz
$ cd opencv-3.2.0
$ mkdir build
$ cd build
$ cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..
$ make -j7
$ sudo make install

References:


0

请尝试使用以下方法:

 cmake \
 -DOPENCV_ICV_URL="http://downloads.sourceforge.net/project/opencvlibrary/3rdparty/ippicv"

来自: {{link1:Ubuntu 14.04 Opencv 安装错误}}


0

请按照以下步骤操作...

首先卸载openjdk

sudo apt-get autoremove openjdk-*-jre

使用以下命令安装新的JDK

sudo rm /var/lib/dpkg/info/oracle-java7-installer*
sudo apt-get purge oracle-java7-installer*
sudo rm /etc/apt/sources.list.d/*java*
sudo apt-get update
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer

正在安装OpenCV

1. 安装基本开发环境

sudo apt-get install build-essential cmake pkg-config

2.安装OpenCV的依赖项。Ubuntu 13.04附带了OpenCV,它足以满足大部分所需的依赖关系。

sudo apt-get build-dep libopencv-dev

3. Java支持的额外依赖项

sudo apt-get install default-jdk ant

4. 编译 OpenCV

tar xzvf opencv-2.4.6.1.tar.gz

cd opencv-2.4.6.1

mkdir build; cd build

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON ..make

sudo make install

这就是你要的结果....


我知道你提到的步骤适用于以前版本的OpenCV。我自己也做过。但是在安装OpenCV3.0时,会出现校验和错误。 - Clive
没错,最新版本也可以正常工作,伙计...校验和错误是由于Openjdk引起的,请将其删除并尝试一下... - Gopal00005
2
哦是吗?我没有尝试过删除Openjdk。对不起。我这周会尝试一下。实际上,我已经成功安装了opencv3.0(只有在上述评论中提到的OpenCL运行时错误方面遇到了麻烦),使用-D WITH_IPP=OFF(跳过该步骤)。我手动下载了ippicv文件夹,并将其内容粘贴到我的opencv目录中的ippicv文件夹中(它会这样工作吗?)。 - Clive
我会尽快试一下,然后再做。 :) - Clive

0

这个方法适用于我在Ubuntu 14.04上使用OpenCV 3.1。

我猜测这是由于ippicv的依赖问题。您需要打开WITH_IPP和INSTALL_CREATE_DISTRIB选项,重新构建并更新链接。

cmake -DWITH_IPP=ON -DINSTALL_CREATE_DISTRIB=ON . && make -j $(nproc) && make install


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接