樹莓派無opencv時進行視頻實時處理

用樹莓派,想要進行圖像處理,但網上的很多教程都用opencv,opencv在樹莓派上安裝很麻煩,那怎樣進行圖像處理呢?
代碼如下:

from picamera.array import PiRGBArray
from picamera import PiCamera
import time

# 下面幾行初始化,設置一下參數
camera = PiCamera()
camera.resolution = (640, 480)
camera.framerate = 32

rawCapture = PiRGBArray(camera, size=(640,480))

# 關鍵用capture_continuous()函數進行讀取視頻,然後 array 去除視頻
# image是numpy數組,就可以進行相關處理了

for frame in camera.capture_continuous(rawCapture, format="bgr", use_video_port$
    image = frame.array
    print(image.shape)
    rawCapture.truncate(0)
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章