PiGear API Parameters⚓
camera_num
⚓
This parameter selects the camera module index which will be used as source, if you're having multiple camera modules connected. Its value can only be greater than zero, otherwise, it will throw ValueError
for any negative value.
This parameter shouldn't be altered, until unless you using Raspberry Pi 3/3+ Compute Module IO Board."
Data-Type: Integer
Default Value: Its default value is 0
.
Usage:
resolution
⚓
This parameter sets the resolution (i.e. (width,height)
) of the source.
For more information read here ➶
Data-Type: Tuple
Default Value: Its default value is (640,480)
.
Usage:
framerate
⚓
This parameter sets the framerate of the source.
For more information read here ➶
Data-Type: integer/float
Default Value: Its default value is 30
.
Usage:
colorspace
⚓
This parameter selects the colorspace of the source stream.
Data-Type: String
Default Value: Its default value is None
.
Usage:
All supported colorspace
values are given here ➶
Its complete usage example is given here ➶
options
⚓
This parameter provides the ability to alter various Tweak Parameters like brightness, saturation, senor_mode, resolution, etc.
available within Picamera library.
Data-Type: Dictionary
Default Value: Its default value is {}
Usage:
All supported parameters are listed in PiCamera Docs
The desired parameters can be passed to PiGear API by formatting them as this parameter's attributes, as follows:
# formatting parameters as dictionary attributes
options = {
"hflip": True,
"exposure_mode": "auto",
"iso": 800,
"exposure_compensation": 15,
"awb_mode": "horizon",
"sensor_mode": 0,
}
# assigning it
PiGear(logging=True, **options)
User-specific attributes:
Additionally, options
parameter also support some User-specific attributes, which are as follows:
-
HWFAILURE_TIMEOUT
(float): PiGear contains Threaded Internal Timer - that silently keeps active track of any frozen-threads/hardware-failures and exit safely, if any does occur at a timeout value. This parameter can be used to control that timeout value i.e. the maximum waiting time (in seconds) after which PiGear exits with aSystemError
to save resources. Its value can only be between1.0
(min) and10.0
(max) and its default value is2.0
. Its usage is as follows:
logging
⚓
This parameter enables logging (if True
), essential for debugging.
Data-Type: Boolean
Default Value: Its default value is False
.
Usage:
time_delay
⚓
This parameter set the time delay (in seconds) before the PiGear API start reading the frames. This delay is only required if the source required some warm-up delay before starting up.
Data-Type: Integer
Default Value: Its default value is 0
.
Usage: