Cameras#

../_images/19-Cameras.png

4 cameras are available:

  • frontal: 1x Sensor Sony IMX586 rolling shutter 8000x6000 quad-bayer 10-bits

  • stereo pair: 2x ON Semi AR0144 global shutter 1280x800 gray scale 10-bits

  • vertical: 1x Sony IMX388 global shutter 640x480 gray scale 10-bits

Frontal#

Two outputs are available for the frontal camera:

  • RAW output through the front_raw device

  • YUV output through the front device

The Auto-exposure (AE) control is done on the front_raw device.

Frontal stereo pair#

RAW outputs are available for front stereo cameras through stereo_left and stereo_right.

The 2 cameras are synchronized through an hardware path. AE computation and control are done on the right camera (the left uses the right camera settings). So, the AE will be controlled via the stereo_right device.

Vertical#

RAW output is available for vertical camera through vertical_left.

The AE control is done on the vertical_left.

Auto-exposure settings#

AE control#

The AE control is done with the control feature from the libvideo-acquisition API.

The following controls are available to set basic settings of the AE:

Class

ID

Description

ISP

ISP_AE_MODE

The current AE mode (auto, manual, priority)

CAM

CAM_EXPOSURE_TIME

The exposure time in us

CAM

CAM_GAIN

The global gain (analog * digital * isp gains)

The global gain can be controlled more finely with the following controls (for more details, please read the Gains section):

Class

ID

Description

CAM

CAM_ANALOG_GAIN

The analog gain applied by camera

CAM

CAM_DIGITAL_GAIN

The digital gain applied by camera

ISP

ISP_GAIN

The digital gain applied by ISP

For advanced controls on AE, the following controls can be used:

Class

ID

Description

ISP

ISP_AE_LOCK

Lock / unlock AE

ISP

ISP_FLICKER_MODE

The current flickering mode (auto, 50Hz, 60Hz, disabled)

ISP

ISP_AE_TARGET

The current AE average luminance target

ISP

ISP_AE_LUMINANCE

The current average luminance detected in stream

Note

Class and ID are prefixed with VACQ_CONTROL_CLASS_ in the API.

AE mode#

Several AE modes are available to set preference between shutter time and ISO, or to fix one or both values.

AE mode

Description

AE_MODE_AUTO

Exposure time and gains are set by AE

AE_MODE_MANUAL

Exposure time and gains are set by user

AE_MODE_SHUTTER_PRIORITY

Exposure time is set by user

AE_MODE_ISO_PRIORITY

Gains are set by user

AE_MODE_AUTO_PREFER_SHUTTER

Auto mode which minimize gains

AE_MODE_AUTO_PREFER_ISO

Auto mode which minimize exposure time

Gains#

The global gain is composed of three gains:

  • The analog gain: the first gain applied in the pipeline, directly in the camera sensor.

  • The digital gain: the second gain applied in the pipeline, after the analog gain, in the camera sensor.

  • The ISP digital gain: the last gain applied in the pipeline, in the ISP.

The AE will always set the analog gain first and then, it will use the digital gain to increase the gain once the maximal analog gain value has been reached. Finally, the ISP digital gain is used to compensate the limitations of the two other gains (their maximal values and steps accuracy).

The global gain can be obtained with the following formula:

Global gain = Analog gain * Digital gain * ISP gain

The gain values are stored as unsigned integer with: Value = Gain * 1024

The range of the gains on Anafi Ai cameras are:

Camera

Analog gain

Digital gain

ISP digital gain

Frontal

[1.12 : 32.0]

[1.0 : 16.0]

[1.0 : 2.0]

Stereo pair

[1.68 : 16.0]

[1.0 : 15.99]

[1.0 : 1.0]

Vertical

[1.0 : 8.0]

[1.0 : 16.0]

[1.0 : 1.0]

Exposure time#

The exposure time is limited by the camera frame rate: for a frame rate of 30 fps, the maximal exposure time available will be 1/30 = 33ms.

The exposure time is expressed in [μs].

AE luminance target#

On ANAFI Ai, the AE luminance and luminance target are 8-bit unsigned integer values, in the range of [0 : 255]. It doesn’t depends on the camera bit depth configuration, then for a 10-bit RAW capture, the luminance value will be scaled to an 8-bit value.

Note

At every camera restart, the AE target is reset to its default value.

Commands#

List controls:

$ vacq-cap -L front_raw

Device controls:
- device: 23 controls
  ctrl 0: custom:lsc-file (6:2) [string]
    flags: none
  ctrl 1: cam:exposure_time (2:5) [integer]
    min: 0, max: 2147483647, step: 1, def: 16384
    flags: none
  ctrl 2: cam:gain (2:8) [integer]
    min: 1024, max: 2147483647, step: 1, def: 1024
    flags: none
  ctrl 3: cam:analog_gain (2:6) [integer]
    min: 1024, max: 2147483647, step: 1, def: 1024
    flags: none
  ctrl 4: cam:digital_gain (2:7) [integer]
    min: 1024, max: 2147483647, step: 1, def: 1024
    flags: none
  ctrl 5: isp:gain (3:7) [integer]
    min: 1024, max: 2147483647, step: 1, def: 1024
    flags: none
  ctrl 6: isp:ae_luminance (3:16) [integer]
    min: 0, max: 255, step: 1, def: 0
    flags: read_only
  ctrl 7: isp:ae_luminance_error (3:17) [integer]
    min: -32768, max: 32767, step: 1, def: 0
    flags: read_only
  ctrl 8: isp:ae_target (3:18) [integer]
    min: 0, max: 255, step: 1, def: 128
    flags: none
  ctrl 9: isp:ae_mode (3:1) [menu]
    menu items:
      - item 0: auto / 0
      - item 1: manual / 1
      - item 2: shutter_priority / 2
      - item 3: iso_priority / 3
      - item 4: auto_prefer_shutter / 4
      - item 5: auto_prefer_iso / 5
    flags: none
  ctrl 10: isp:ae_lock (3:2) [boolean]
    flags: none
  ctrl 11: isp:ae_ev (3:3) [integer_64]
    min: 0, max: 9223372036854775807, step: 1, def: 1024
    flags: none
  ctrl 12: isp:ae_ev_bias (3:4) [integer]
    min: -3072, max: 3072, step: 1, def: 0
    flags: none
  ctrl 13: isp:max_iso (3:5) [integer]
    min: 0, max: 2147483647, step: 1, def: 0
    flags: none
  ctrl 14: isp:ae_weight_table (3:15) [u8]
    min: 0, max: 15, step: 0, def: 0
    size: 1, count: 255
    dim: 2 [ 15 17 ]
    flags: none
  ctrl 15: custom:ae-algorithm (6:5) [menu]
    menu items:
      - item 0: standard / 0
      - item 1: parrot_hdr / 1
    flags: none
  ctrl 16: isp:ae_stats_crop (3:21) [u16]
    min: 0, max: 65535, step: 0, def: 0
    size: 2, count: 4
    flags: none
  ctrl 17: isp:awb_mode (3:8) [menu]
    menu items:
      - item 0: auto / 0
      - item 1: manual / 1
    flags: none
  ctrl 18: isp:awb_lock (3:9) [boolean]
    flags: none
  ctrl 19: isp:wb_temperature (3:10) [integer]
    min: 1500, max: 15000, step: 1, def: 1500
    flags: none
  ctrl 20: isp:red_balance (3:11) [integer]
    min: 256, max: 65535, step: 1, def: 256
    flags: read_only
  ctrl 21: isp:blue_balance (3:12) [integer]
    min: 256, max: 65535, step: 1, def: 256
    flags: read_only
  ctrl 22: isp:statistics (3:14) [unknown]
    flags: write_only
- pad 0: 0 controls
- pad 1: 0 controls
- pad 2: 0 controls

Get current AE settings (mode + exposure + gain):

$ vacq-cap -G isp:ae_mode,cam:exposure_time,cam:gain front_raw

Get controls:
- control 'isp:ae_mode': 0: auto / 0
- control 'cam:exposure_time': 32924
- control 'cam:gain': 35072

Set manual mode with a x8 gain and an exposure time of 10ms:

$ vacq-cap -S isp:ae_mode=1,cam:exposure_time=10000,cam:gain=8192 front_raw

Set controls:
- control 'isp:ae_mode=1': 1: manual / 1
- control 'cam:exposure_time=10000': 10000
- control 'cam:gain=8192': 8192