libmodal-exposure
libmodal_exposure provides auto-exposure algorithms that take an image (with metadata) and return what the new exposure and gain should be. The default auto-exposure algorithm used by voxl-camera-server is the Mean Sample Value (MSV) algorithm.
Configuration of libmodal_exposure is achieved through voxl-camera-server.conf. Note that voxl-camera-server vendors its own copy of the MSV algorithm, so these config keys work regardless of whether the standalone libmodal-exposure package is installed.
The parameters exposed include the following
| Parameter | Description |
|---|---|
ae_mode | auto exposure mode: one of off, manual, auto, isp, or lme_msv. lme_msv engages the MSV algorithm from this library |
ae_manual_exposure_us | fixed exposure time in microseconds, used when ae_mode is manual |
ae_manual_gain | fixed sensor gain, used when ae_mode is manual |
exposure_min_us | minimum exposure time in microseconds the algorithm may command |
exposure_max_us | maximum exposure time in microseconds the algorithm may command |
gain_min | minimum sensor gain the algorithm may command |
gain_max | maximum sensor gain the algorithm may command |
exposure_soft_min_us | preferred lower bound on exposure time. The algorithm holds exposure here in bright scenes and adjusts gain first, only raising exposure above it as scene brightness demands (in the ratio set by ae_slope) |
ae_desired_msv | the desired mean sample value, a.k.a. the average value of pixels that the auto exposure algorithm should try to achieve in frame |
ae_filter_alpha | a low-pass filter constant that filters the calculated MSV to slow down responses - the filter used is an IIR filter |
ae_ignore_fraction | maximum percentage of saturated (255) pixels that will be used in calculation of MSV. If there are more saturated_pixels / total_pixels, then additional saturated pixels are not used to calculate MSV. This helps prevent image getting too dark if there are large blobs of very bright light |
ae_slope | ratio that specifies how much gain vs exposure should be changed when trying to achieve desired MSV. Both gain and exposure linearly affect the pixel brightness, but gain and exposure have different effects on the image quality - mostly in the sense that gain affects granularity and that exposure affects motion blur. |
ae_exposure_period | controls the duration where the cells of the camera sensor are exposed to light |
ae_gain_period | the gain period associated to the auto exposure (think of this as an amplification factor of the pixels) |
Source code and README on Gitlab