Either create dictionary in your program or import ti from the config folder e.g. examples/configs/all_capture_configs.py
- set appropriate resolution and frames per second.
- determine the exposure and autoexposure settings.
- consider white balancing.
| method | name | description |
|---|---|---|
| 0 | none | Identity (no rotation) |
| 1 | clockwise | Rotate clockwise 90 degrees |
| 2 | rotate-180 | Rotate 180 degrees |
| 3 | counterclockwise | Rotate counter-clockwise 90 degrees |
| 4 | horizontal-flip | Flip horizontally |
| 5 | vertical-flip | Flip vertically |
| 6 | upper-left-diagonal | Flip across upper left/lower right diagonal |
| 7 | upper-right-diagonal | Flip across upper right/lower left diagonal |
| 8 | automatic | Select flip method based on image-orientation tag |
The config keys exposure and autoexposure are interpreted differently depending on the capture backend (OpenCV, GStreamer, Picamera2/libcamera, legacy picamera).
| key | what it does | typical values |
|---|---|---|
exposure |
Manual exposure request. |
>0: time/value (often µs on PiCamera2/libcamera and Jetson nvargus). Some OpenCV webcam drivers use negative “stops-like” values (e.g. -5 ≈ 0/-1: often means “auto/leave default”, depending on backend. |
autoexposure |
Auto-exposure (AE) on/off request. | OpenCV: -1 keep, 0 manual, 1 auto; many V4L2 cams also accept 0.25 (manual) / 0.75 (auto). Other backends either ignore this key or map it differently. |
Backend details:
-
OpenCV (
cv2Capture):autoexposure = -1leaves AE unchanged;0requests manual AE mode;1requests auto AE mode.- Some Linux/V4L2 drivers commonly accept
0.25(manual) and0.75(auto). Windows/macOS backends can differ. exposure > 0requests manual exposure and the code attempts to disable AE first. The numeric meaning ofCAP_PROP_EXPOSUREis driver-specific (some cameras use negative values, others use milliseconds/microseconds-like scales).- To inspect what your OpenCV backend/camera supports, run
python3 examples/list_cv2CameraProperties.py.
-
GStreamer (
gCapture):gCapturebuilds a pipeline and the meaning of “exposure” depends on the selected source element:- Jetson
nvarguscamerasrc:exposureis treated as microseconds (converted internally) and applied viaexposuretimerangewhen supported. libcamerasrc: exposure/AE are controlled via libcamera controls, but the exact property interface is element-version specific. Usegst-inspect-1.0 libcamerasrcand set the element’s control-related properties viagst_source_props_str, or provide a complete custom source withgst_source_str.v4l2src: exposure is typically controlled via V4L2 controls (recommended:v4l2-ctlfromv4l-utils). Some GStreamer builds expose anextra-controls-style property onv4l2src, but it is not consistent across platforms/drivers.- Windows
ksvideosrc/dshowvideosrc: many cameras do not expose manual exposure controls through these elements. If the element exposes a property for it, you can set it viagst_source_props_str; otherwise use vendor tools / OS camera settings (or configure exposure through a separate API).
- Jetson
- Use
gst-inspect-1.0 <element>to discover supported properties and set them viagst_source_props_stror a fully customgst_source_str.
-
FLIR/Teledyne Spinnaker (
spinCapture, PySpin):exposureis in microseconds and maps toExposureTime(requiresExposureAutooff andExposureMode=Timed).autoexposure:0off,1on (continuous/once depending on camera settings).
-
Raspberry Pi Picamera2/libcamera (
piCamera2Capture):exposureis interpreted as microseconds and mapped to libcameraExposureTime.autoexposuremaps to libcameraAeEnable(>0enables,0disables,-1leaves unchanged).
-
Raspberry Pi legacy picamera (
piCapture):- Exposure is controlled via
shutter_speedin microseconds. - In this backend,
exposure <= 0uses automatic exposure (exposure_mode='auto');exposure > 0requests manual exposure (exposure_mode='off'plusshutter_speed).
- Exposure is controlled via
Maximum usable exposure time is typically limited by frame interval. Roughly, max exposure is about