camera
– Support for camera input¶
The camera
module contains classes to control the camera and take pictures.
Available on these boards
- class camera.Camera¶
The class to control camera.
Usage:
import board import sdioio import storage import camera sd = sdioio.SDCard( clock=board.SDIO_CLOCK, command=board.SDIO_COMMAND, data=board.SDIO_DATA, frequency=25000000) vfs = storage.VfsFat(sd) storage.mount(vfs, '/sd') cam = camera.Camera() buffer = bytearray(512 * 1024) file = open("/sd/image.jpg","wb") size = cam.take_picture(buffer, width=1920, height=1080, format=camera.ImageFormat.JPG) file.write(buffer, size) file.close()
Initialize camera.
- take_picture(buf: _typing.WriteableBuffer, format: ImageFormat) int ¶
Take picture and save to
buf
in the givenformat
. The size of the picture taken iswidth
byheight
in pixels.- Renvoie:
the number of bytes written into buf
- Type renvoyé: