我无法安装libjasper-dev.因此,我安装了libpng而不是libpng12-dev.自昨天早上以来,我一直在尝试在Tinker Board上编译OpenCV.但是在构建过程中出现以下错误: /usr/include/c++/6/cmath:106:11: error: ::acos has not been declared所有数学公式之后都会触发类似的错误.哪个Debian版本对OpenCV稳定?我应该安装较低版本的OpenCV吗?有人可以帮忙吗?解决方案我成功地设法在TinkerBoard上安装了OpenCV.步骤如下:将16 GB的存储卡格式化为FAT32 从此处. 将img文件复制到存储卡上 sudo dd if=/path/to/your/imgfile of=/path/to/your/memorycard bs=4M SO中已经提供了很多帮助. 在打开电源之前,请确保您已将修补板通过lan电缆连接到Internet. 开机后,用sudo dpkg-reconfigure tzdata重置系统时间.修补板的Debian映像已经安装了ntp.等待几分钟,等待修补板调整网络中的板时间. 要安装opencv及其依赖库,我已按照这里....尽管我必须进行一些自定义库安装,但这非常有帮助.请注意,我在Tinker Board上使用Opencv的目的是处理实时视频,因此,我的重点更多地放在安装适当的视频编解码器上.以下是步骤:sudo apt-get -y updatesudo apt-get -y upgradesudo apt-get -y dist-upgradesudo apt-get -y autoremove在安装perl应用程序期间,您可能会遇到以下警告消息:perl: warning: Setting locale failed.perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LANG = "en_US.utf8" are supported and installed on your system.perl: warning: Falling back to the standard locale ("C").尽管这不会影响您的OpenCV安装,但是在尝试在修补板上编译Opencv花费了3天之后,我不想留下任何机会.使用以下内容禁止显示这些警告消息:export LANGUAGE=en_US.UTF-8export LANG=en_US.UTF-8export LC_ALL=en_US.UTF-8dpkg-reconfigure locales感谢此帖子.# INSTALL THE DEPENDENCIES# Build tools:sudo apt-get install -y build-essential cmake# GUI (if you want to use GTK instead of Qt, replace 'qt5-default' with 'libgtkglext1-dev' and remove '-DWITH_QT=ON' option in CMake): I just went with qt5 itself.sudo apt-get install -y qt5-default libvtk6-dev# Media I/O:sudo apt-get install -y zlib1g-dev libjpeg-dev libwebp-dev libpng-dev libtiff5-dev libopenexr-dev libgdal-dev请注意libjasper-dev在该版本的Debian中不可用,因此我已从上面的Media I/O列表中删除. # Video I/O:sudo apt-get install -y libdc1394-22-dev libavcodec-dev libavformat-dev libswscale-dev libtheora-dev libvorbis-dev libxvidcore-dev libx264-dev yasm libopencore-amrnb-dev libopencore-amrwb-dev libv4l-dev libxine2-devsudo apt-get install -y gstreamer1.0-plugins-*sudo apt-get install libxine-dev# Parallelism and linear algebra libraries:sudo apt-get install -y libtbb-dev libeigen3-dev# Python:sudo apt-get install -y python-dev python-tk python-numpy python3-dev python3-tk python3-numpysudo apt-get install python-pip# Java:sudo apt-get install -y ant default-jdk# Documentation:sudo apt-get install -y doxygen获取OpenCV.我决定使用3.0.0版,因为我的开发是在此版本中进行的.您可以选择其他版本.sudo apt-get install -y unzip wgetwget https://github.com/opencv/opencv/archive/3.0.0.zipunzip 3.0.0.ziprm 3.0.0.zip构建OpenCV.mv opencv-3.0.0 OpenCVcd OpenCVmkdir buildcd buildcmake -DWITH_QT=ON -DWITH_OPENGL=ON -DFORCE_VTK=ON -DWITH_TBB=ON -DWITH_GDAL=ON -DWITH_FFMPEG=0 -DWITH_XINE=ON -DBUILD_EXAMPLES=ON -DENABLE_PRECOMPILED_HEADERS=OFF ..与原始脚本相比,这里有一个变化-添加了-DWITH_FFMPEG=0,因为缺少FFMPEG库,我也不介意安装它.您可能想要这样做.make尽管TinkerBoard支持make -j4,但我选择在make上放慢速度.使用make进行的编译花费了将近2.5个小时,并且在c ++代码中出现了许多看似缩进的错误,但是最终编译结束了.sudo make installsudo ldconfig$ python>>> import cv2>>> cv2.__version__'3.0.0'I have downloaded 20170817-tinker-board-linaro-stretch-alip-v2.0.1.img for Tinker Board. I am trying to install OpenCV 3.0.0. I have followed the instructions given here : http://www.pyimagesearch.com/2015/06/22/install-opencv-3-0-and-python-2-7-on-ubuntu/.I was not able to install libjasper-dev. Hence, instead of libpng12-dev, I have installed libpng.I am trying to compile OpenCV on Tinker Board since yesterday morning. But have been getting following errors during building process:/usr/include/c++/6/cmath:106:11: error: ::acos has not been declaredFollowed by all the math formula triggers similar errors.Which Debian version is stable for OpenCV? Should I install a lower version of OpenCV? Can someone help? 解决方案 I successfully managed to install OpenCV on a TinkerBoard. The following were the steps:Format a 16 GB memory card to FAT32Download debian image 20170817-tinker-board-linaro-stretch-alip-v2.0.1.img for tinker board from here.Copy the img file on to the memory cardsudo dd if=/path/to/your/imgfile of=/path/to/your/memorycard bs=4Ma lot of help on this is already available in SO.Before powering on ensure that you connect your tinker board to the internet through a lan cable.Once powered on reset the system time with sudo dpkg-reconfigure tzdata. Debian image for tinker board already has ntp installed. Wait a couple of minutes for the tinker board to adjust the board time from the network.To install opencv and its dependant library, I have taken the instructions given here ....though I had to make some custom library installations but it was very helpful. Please note, my purpose of using Opencv on Tinker Board is to process live video's and hence my focus was more towards installing appropriate video codecs.The following were the steps:sudo apt-get -y updatesudo apt-get -y upgradesudo apt-get -y dist-upgradesudo apt-get -y autoremoveYou may face the following warning messages during installation of perl applications:perl: warning: Setting locale failed.perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LANG = "en_US.utf8" are supported and installed on your system.perl: warning: Falling back to the standard locale ("C").Though this doesn't impact your installation of OpenCV, after spending 3 days in trying to compile Opencv on tinker board I do not want to leave anything for a chance.Use the following to suppress these warning messages:export LANGUAGE=en_US.UTF-8export LANG=en_US.UTF-8export LC_ALL=en_US.UTF-8dpkg-reconfigure localesThanks to this post.# INSTALL THE DEPENDENCIES# Build tools:sudo apt-get install -y build-essential cmake# GUI (if you want to use GTK instead of Qt, replace 'qt5-default' with 'libgtkglext1-dev' and remove '-DWITH_QT=ON' option in CMake): I just went with qt5 itself.sudo apt-get install -y qt5-default libvtk6-dev# Media I/O:sudo apt-get install -y zlib1g-dev libjpeg-dev libwebp-dev libpng-dev libtiff5-dev libopenexr-dev libgdal-devPls note libjasper-dev is unavailable for this version of Debian and hence I have removed from the above Media I/O list. # Video I/O:sudo apt-get install -y libdc1394-22-dev libavcodec-dev libavformat-dev libswscale-dev libtheora-dev libvorbis-dev libxvidcore-dev libx264-dev yasm libopencore-amrnb-dev libopencore-amrwb-dev libv4l-dev libxine2-devsudo apt-get install -y gstreamer1.0-plugins-*sudo apt-get install libxine-dev# Parallelism and linear algebra libraries:sudo apt-get install -y libtbb-dev libeigen3-dev# Python:sudo apt-get install -y python-dev python-tk python-numpy python3-dev python3-tk python3-numpysudo apt-get install python-pip# Java:sudo apt-get install -y ant default-jdk# Documentation:sudo apt-get install -y doxygenGet OpenCV. I decided to go with version 3.0.0 as my development was in this version. You may choose a different version.sudo apt-get install -y unzip wgetwget https://github.com/opencv/opencv/archive/3.0.0.zipunzip 3.0.0.ziprm 3.0.0.zipBuild OpenCV.mv opencv-3.0.0 OpenCVcd OpenCVmkdir buildcd buildcmake -DWITH_QT=ON -DWITH_OPENGL=ON -DFORCE_VTK=ON -DWITH_TBB=ON -DWITH_GDAL=ON -DWITH_FFMPEG=0 -DWITH_XINE=ON -DBUILD_EXAMPLES=ON -DENABLE_PRECOMPILED_HEADERS=OFF ..A change here from the original script - is the addition of -DWITH_FFMPEG=0, as FFMPEG library was missing and I was not in a frame of mind to install the same. You may want to do so.makeThough TinkerBoard supports make -j4 i chose to go slow with make. The compile with make took almost 2.5 hours with lot of seemingly indentation errors in c++ codes but finally the compile gets over.sudo make installsudo ldconfig$ python>>> import cv2>>> cv2.__version__'3.0.0' 这篇关于在Tinker Board中安装OpenCV的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
09-03 06:19