/**************************************************************************************
* RPi 2B python opencv camera demo example
* 声明:
* 本文主要记录RPi 2B 使用python opencv来获取图片的方式。
*
* 2016-2-24 深圳 南山平山村 曾剑锋
************************************************************************************/ 一、参考文档:
. OpenCV with Raspberry Pi Camera Face Detection Tutorial - Robotics with Python Raspberry Pi and GoPiGo p.
https://pythonprogramming.net/raspberry-pi-camera-opencv-face-detection-tutorial/
. Raspberry Pi OpenCV,在树莓派下使用opencv
http://www.educity.cn/wenda/565761.html
3. 如何安装树莓派摄像头模块
https://linux.cn/article-3650-1.html 二、opencv install:
  sudo apt-get update && sudo apt-get install libopencv-dev
  sudo apt-get install python-opencv 三、example code
#!/usr/bin/python import cv2 as cv
import numpy
import io
import picamera # Create a memory stream so photos doesn't need to be saved in a file
stream = io.BytesIO() # Get the picture (low resolution, so it should be quite fast)
# Here you can also specify other parameters (e.g.:rotate the image)
with picamera.PiCamera() as camera:
camera.resolution = (, )
camera.capture(stream, format='jpeg') # Convert the picture into a numpy array
buff = numpy.fromstring(stream.getvalue(), dtype=numpy.uint8) # Now creates an OpenCV image
image = cv.imdecode(buff, ) # Save the result image
cv.imwrite('result.jpg', image)

RPi 2B python opencv camera demo example的更多相关文章

  1. RPi 2B GPIO 测试

    /************************************************************************************** * RPi 2B GPI ...

  2. RPi 2B Raspbian SD卡内部架构

    /***************************************************************************** * RPi 2B Raspbian SD卡 ...

  3. RPi 2B 自动发送获取的IP到固定邮箱

    /************************************************************************* * RPi 2B 自动发送获取的IP到固定邮箱 * ...

  4. python + opencv: kalman 跟踪

    之前博文中讲解过kalman滤波的原理和应用,这里用一个跟踪鼠标的例程来演示怎么在opencv里用自带的kalman函数进行目标跟踪,文章的内容对做图像跟踪有借鉴意义.文章主要是网络资源进行整理和简单 ...

  5. RPi 2B DDNS 动态域名

    /**************************************************************************** * RPi 2B DDNS 动态域名 * 说 ...

  6. RPi 2B IPC webcam server

    /**************************************************************************** * RPi 2B IPC webcam se ...

  7. 搭建基于python +opencv+Beautifulsoup+Neurolab机器学习平台

    搭建基于python +opencv+Beautifulsoup+Neurolab机器学习平台 By 子敬叔叔 最近在学习麦好的<机器学习实践指南案例应用解析第二版>,在安装学习环境的时候 ...

  8. RPi 2B USB 远程桌面

    /******************************************************************** * RPi 2B USB 远程桌面 * 说明: * 用作废的 ...

  9. .NET + OpenCV & Python + OpenCV 配置

    最近需要做一个图像识别的GUI应用,权衡了Opencv+ 1)QT,2)Python GUI,3).NET后选择了.NET... 本文给出C#+Opencv和Python+Opencv的相应参考,节省 ...

随机推荐

  1. Python数据结构——二叉树的实现

    1. 二叉树 二叉树(binary tree)中的每个节点都不能有多于两个的儿子. 1.1 二叉树列表实现 如上图的二叉树可用列表表示: tree=['A', #root ['B', #左子树 ['D ...

  2. MyEclipse的一些配置

    1.配置默认编码 配置整个MyEclipse的默认编码 window--->Preferences-->General-->WorkSpace--->TextFileEncod ...

  3. StatusStrip状态栏控件

    1.ToolStripStatusLabel statusstrip1.Items[].Text="日期"+DateTime.Now.ToString(); Thread p = ...

  4. js 获取 input file 文件 附给 image src

    var a=document.querySelector('input[type=file]'); a.onchange = function (e) { //var reader = new Fil ...

  5. 扩展ExtJs 4.2.1 htmleditor 添加图片功能

    做项目的时候遇到这样一个问题,因为我是用ExtJs做的后台管理框架,所以当我使用ExtJs htmleditor 控件 的时候,发现没有图片上传的功能,于是我打算在网上找找有关的文章,居然真有人写过, ...

  6. (转)Const,Const函数,Const变量,函数后面的Const

    本文转自http://www.cnblogs.com/Fancyboy2004/archive/2008/12/23/1360810.html 看到const 关键字,C++程序员首先想到的可能是co ...

  7. http://blog.csdn.net/itplus/article/details/10088625

    http://blog.csdn.net/itplus/article/details/10088625 DBSCAN

  8. Clojure语法学习-循环

    do和块语句 在Scala中,花括号{}括起来的语句构成一个block,它的值就是最后一个语句的值. scala> val a = { | println("a") | 1} ...

  9. _CrtIsValidPointer 问题

    从微软站点: 检查指针有效性下面的示例使用 _CrtIsValidPointer 验证给定的内存范围对于读或写是否有效. _ASSERTE(_CrtIsValidPointer( address, s ...

  10. c#做动态(gif)中文验证码

    无意中在国外论坛发现一个gif动画类,我使用它来制作了一个动态验证码 : 一:首先新建一个类库 1:新建AnimatedGifEncoder类 using System; using System.C ...