跳到主要內容

發表文章

目前顯示的是有「python」標籤的文章

picamera - Recording video to a stream

import io import picamera stream = io.BytesIO() with picamera.PiCamera() as camera:     camera.resolution = (320, 240)     camera.start_recording(stream, format='h264', quality=30)     camera.wait_recording(10)     camera.stop_recording()

pi camera - take a picture (using python)

import time import picamera with picamera.PiCamera() as camera:     camera.resolution = (320, 240)     camera.start_preview()     time.sleep(2)     camera.capture('foo.jpg')

Accessing the Webcam with Python - Ubuntu

To install SimpleCV for python you'll need to start by installing the other libraries it depends on. Use apt-get:  ~ $ sudo apt-get install python-opencv python-scipy python-numpy python-pip Next, ~ $ sudo pip install https://github.com/ingenuitas/SimpleCV/zipball/master Next, ~ $ vim simplewebcam.py put the following code in it and save. from SimpleCV import Camera, Display from time import sleep myCamera = Camera(prop_set={'width':640,'height':480}) myDisplay = Display(resolution=(640,480)) while not myDisplay.isDone():    myCamera.getImage().save(myDisplay)    sleep(.1) ~ $ python simplewebcam.py then you can see the screen pop-out