Sy-sem2-Interfacing Raspberry Pi To Camera
Sy-sem2-Interfacing Raspberry Pi To Camera
Circuit/Block Diagram:
Note: Pi-Camera is interfaced using 15 bin ribbon cable on camera slot (CSI) provided on
Raspberry Pi Module.
import picamera
import time
#create object for PiCamera class
camera = picamera.PiCamera()
#set resolution
camera.resolution = (1024, 768)
camera.brightness = 60
camera.start_preview()
#add text on image
camera.annotate_text = 'Hi Pi User'
time.sleep(5)
#store image
camera.capture('image1.jpeg')
camera.stop_preview()
1
Program: # To capture image and record video using Pi-camera interface with raspberry pi
import picamera
import time
camera = picamera.PiCamera()
camera.capture('example1.jpg')
time.sleep(1)
camera.capture('example2.jpg')
time.sleep(1)
camera.start_recording('examplevid.h264')
time.sleep(5)
camera.stop_recording()