The_Official_Raspberry_Pi_-_Beginner’s_Book_Vol1,_2018 (1)

(singke) #1

210 THE OFFICIAL RASPBERRY PI BEGINNER'S GUIDE


camera.meter_mode = 'average'
This controls how the camera decides on the amount of available light when setting its
exposure. The default averages the amount of light available throughout the whole picture;
other possible modes are backlit, matrix, and spot.

camera.resolution = ( 1920 , 1080 )
This sets the resolution of the captured picture or video, represented by two numbers for width
and height. Lower resolutions will take up less storage space and allow you to use a higher
frame rate; higher resolutions are better quality but take up more storage space.

camera.rotation = 0
This controls the rotation of the image, from 0 degrees through 90, 180, and 270 degrees.
Use this if you can’t position the camera so that the ribbon cable is coming out of the bottom.

camera.saturation = 0
This controls the saturation of the image, or how vibrant colours are. Possible values range
from -100 to 100.

camera.sharpness = 0
This controls the sharpness of the image. Possible values range from -100 to 100.

camera.shutter_speed = 0
This controls how quickly the shutter opens and closes when capturing images and videos.
You can set the shutter speed manually in microseconds, with longer shutter speeds working
better in lower light and faster shutter speeds in brighter light. This should normally be left on
its default, automatic, setting.

camera.vflip = False
This flips the camera image across the horizontal, or Y, axis when set to True.

camera.video_stabilization = False
When set to True, this turns on video stabilisation. You only need this if the Camera Module
is moving while you’re recording, such as if it’s attached to a robot or being carried, in order to
reduce the shakiness of the captured video.

More information on these settings, as well as additional settings not documented here,
can be found at picamera.readthedocs.io.
Free download pdf