Skip to content Link Search Menu Expand Document
ModalAI DOCS
Store

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

ParameterDescription
ae_modeauto exposure mode: one of off, manual, auto, isp, or lme_msv. lme_msv engages the MSV algorithm from this library
ae_manual_exposure_usfixed exposure time in microseconds, used when ae_mode is manual
ae_manual_gainfixed sensor gain, used when ae_mode is manual
exposure_min_usminimum exposure time in microseconds the algorithm may command
exposure_max_usmaximum exposure time in microseconds the algorithm may command
gain_minminimum sensor gain the algorithm may command
gain_maxmaximum sensor gain the algorithm may command
exposure_soft_min_uspreferred 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_msvthe 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_alphaa low-pass filter constant that filters the calculated MSV to slow down responses - the filter used is an IIR filter
ae_ignore_fractionmaximum 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_sloperatio 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_periodcontrols the duration where the cells of the camera sensor are exposed to light
ae_gain_periodthe gain period associated to the auto exposure (think of this as an amplification factor of the pixels)

Source code and README on Gitlab