日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > python >内容正文

python

RPi 2B python opencv camera demo example

發布時間:2023/12/31 python 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 RPi 2B python opencv camera demo example 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
/*************************************************************************************** RPi 2B python opencv camera demo example* 聲明:* 本文主要記錄RPi 2B 使用python opencv來獲取圖片的方式。** 2016-2-24 深圳 南山平山村 曾劍鋒************************************************************************************/一、參考文檔:1. OpenCV with Raspberry Pi Camera Face Detection Tutorial - Robotics with Python Raspberry Pi and GoPiGo p.7https://pythonprogramming.net/raspberry-pi-camera-opencv-face-detection-tutorial/2. Raspberry Pi OpenCV,在樹莓派下使用opencvhttp://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-devsudo apt-get install python-opencv三、example code#!/usr/bin/pythonimport cv2 as cvimport numpyimport ioimport picamera# Create a memory stream so photos doesn't need to be saved in a filestream = 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 = (320, 240)camera.capture(stream, format='jpeg')# Convert the picture into a numpy arraybuff = numpy.fromstring(stream.getvalue(), dtype=numpy.uint8)# Now creates an OpenCV imageimage = cv.imdecode(buff, 1)# Save the result imagecv.imwrite('result.jpg', image)

?

轉載于:https://www.cnblogs.com/zengjfgit/p/5223747.html

總結

以上是生活随笔為你收集整理的RPi 2B python opencv camera demo example的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。