在Raspberry Pi Raspbian上安装opencv [英] Install opencv on Raspberry Pi Raspbian

查看:109
本文介绍了在Raspberry Pi Raspbian上安装opencv的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在运行Raspbian Jessie OS的RaspberryPi 3中安装openCV.我正在关注本教程: http://pklab.net/index.php?lang=EN&id= 392

I am trying to install openCV in my RaspberryPi 3 running Raspbian Jessie OS. I am following this tutorial: http://pklab.net/index.php?lang=EN&id=392

这样做之后:

sudo apt-get update
sudo apt-get upgrade

一切看起来不错.但是,当我尝试安装cmake来构建我的opencv库时,在输入以下命令后出现以下错误:

Things look fine. But when I try to install cmake to build my opencv libraries, I get the following error after entering the following command:

输入命令:

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

结果:

The following packages have unmet dependencies:
 cmake : Depends: libjsoncpp0 but it is not installable
 cmake-curses-gui : Depends: libjsoncpp0 but it is not installable
E: Unable to correct problems, you have held broken packages.

我似乎无法弄清楚出了什么问题.我尝试从cmake网站上的镜像使用wget手动安装cmake,仍然出现相同的错误.感谢您的帮助!

I can't seem to figure out what is going wrong. I tried to manually install cmake using wget from the mirror on the cmake website and still the same error comes up. Any help is appreciated!

推荐答案

安装开放式简历非常简单.

installing open cv is very easy just do this.

sudo apt-get update

sudo apt-get install -y build-essential git cmake pkg-config \
    libjpeg-dev libtiff5-dev libjasper-dev libpng12-dev \
    libavcodec-dev libavformat-dev libswscale-dev libv4l-dev \
    libxvidcore-dev libx264-dev libgtk2.0-dev \
    libatlas-base-dev gfortran \
    python2.7-dev python3-dev

然后

cd ~
wget -O opencv.zip https://github.com/Itseez/opencv/archive/3.0.0.zip
unzip opencv.zip
wget -O opencv_contrib.zip 
https://github.com/Itseez/opencv_contrib/archive/3.0.0.zip
unzip opencv_contrib.zip
cd opencv-3.0.0/
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_EXTRA_MODULES_PATH=~/opencv_contrib-3.0.0/modules \
      -D BUILD_EXAMPLES=ON ..

make -j4
make clean
make
sudo make install
sudo ldconfig

这将需要几个小时.

使用OpenCV提取功能 使用以下命令下载脚本和示例图像 光盘〜 wget https://raw.githubusercontent.com/JoBergs/RaspiContent/master /OpenCV_demo/opencv_face_features.py \ https://raw.githubusercontent.com/JoBergs/RaspiContent/master/OpenCV_demo/poi_1.jpg

Extract features with OpenCV Download the Script and sample image with cd ~ wget https://raw.githubusercontent.com/JoBergs/RaspiContent/master/OpenCV_demo/opencv_face_features.py \ https://raw.githubusercontent.com/JoBergs/RaspiContent/master/OpenCV_demo/poi_1.jpg

运行脚本需要Raspbian桌面.如果您还没有启动到桌面,

Running the Script requires the Raspbian Desktop. If you haven’t already booted into the Desktop,

打开终端,然后

cd ~
python opencv_face_features.py poi_1.jpg

这篇关于在Raspberry Pi Raspbian上安装opencv的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆