Picam v0.1.0 Picam
This module contains functions to manipulate, capture, and stream MJPEG video on a Raspberry Pi using the camera module.
Summary
Functions
Returns a binary with the contents of a single JPEG frame from the camera
Enable or disable a black background behind the annotation
Annotate the JPEG frames with the text in annotation
Set the Automatic White Balance (AWB) mode
Set the image brightness
Set the color effect applied by the camera
Set the image contrast
Set the exposure compensation (EV) level
Set the exposure mode
Limit the frame rate to the given rate
Flip the image horizontally
Set the image effect
Set the capture ISO
Set the metering mode
Set the JPEG quality
Set the JPEG restart interval
Set a region of interest
Set the image rotation angle in degrees
Set the image saturation
Set the sensor mode
Set the image sharpness
Set the shutter speed in microseconds
Set the image size. One of the dimensions may be set to 0 to auto-calculate it based on the aspect ratio of the camera
Flip the image vertically
Enable or disable video stabilization
Functions
Set the Automatic White Balance (AWB) mode.
The accepted modes are:
:off
:auto
:sun
:cloud
:shade
:tungsten
:fluorescent
:incandescent
:flash
:horizon
Set the color effect applied by the camera.
The effect is set with the tuple {u,v}
.
The accepted range for both values is [0, 255].
If the effect
given is :none
, color effects will be disabled.
Examples
iex> Picam.set_colfx({128,128}) # Black and white
:ok
Set the exposure mode.
The accepted modes are:
:auto
:night
:nightpreview
:backlight
:spotlight
:sports
:snow
:beach
:verylong
:fixedfps
:antishake
:fireworks
Limit the frame rate to the given rate
.
The accepted range is [0.0, 90.0], but the actual rate used is governed
by the current sensor_mode
.
If the rate
given is 0 (or 0.0), frame rate will be automatically regulated.
Set the image effect.
The accepted effects are:
:none
:negative
:solarise
:sketch
:denoise
:emboss
:oilpaint
:hatch
:gpen
:pastel
:watercolour | :watercolor
:film
:blur
:saturation
:colourswap | :colorswap
:washedout
:posterise
:colourpoint | :colorpoint
:colourbalance | :colorbalance
:cartoon
Set the capture ISO.
The accepted range is [0, 800].
If the iso
given is 0, it will be automatically regulated by the camera.
Set the metering mode.
The accepted modes are:
:average
:spot
:backlit
:matrix
Set the JPEG restart interval.
If the interval
given is 0, restart intervals will not be used.
Set the image rotation angle in degrees.
The accepted angles are 0, 90, 180, or 270.
Set the sensor mode.
Details on the accepted modes (0-7) are listed in the tables below:
V1 Camera Module
# | Resolution | Ratio | FPS Range | Video | Image | FoV | Binning |
---|---|---|---|---|---|---|---|
1 | 1920x1080 | 16:9 | (1, 30] | Y | Partial | None | |
2 | 2592x1944 | 4:3 | (1, 15] | Y | Y | Full | None |
3 | 2592x1944 | 4:3 | [0.16, 1] | Y | Y | Full | None |
4 | 1296x972 | 4:3 | (1, 42] | Y | Full | 2x2 | |
5 | 1296x730 | 16:9 | (1, 49] | Y | Full | 2x2 | |
6 | 640x480 | 4:3 | (42, 60] | Y | Full | 4x4 | |
7 | 640x480 | 4:3 | (60, 90] | Y | Full | 4x4 |
V2 Camera Module
# | Resolution | Ratio | FPS Range | Video | Image | FoV | Binning |
---|---|---|---|---|---|---|---|
1 | 1920x1080 | 16:9 | [0.10, 30] | Y | Partial | None | |
2 | 3280x2464 | 4:3 | [0.10, 15] | Y | N | Full | None |
3 | 3280x2464 | 4:3 | [0.10, 15] | Y | N | Full | None |
4 | 1640x1232 | 4:3 | [0.10, 40] | Y | Full | 2x2 | |
5 | 1640x922 | 16:9 | [0.10, 40] | Y | Full | 2x2 | |
6 | 1280x720 | 16:9 | (40, 90] | Y | Partial | 2x2 | |
7 | 640x480 | 4:3 | (40, 90] | Y | Partial | 2x2 |
If the mode
given is 0, the camera will select a mode automatically.
Set the shutter speed in microseconds
If the speed
given is 0, it will be automatically regulated.
Set the image size. One of the dimensions may be set to 0 to auto-calculate it based on the aspect ratio of the camera.