High Dynamic Range Modes Available in Firefly MV

Download PDF - HDR_Modes_in_Firefly_MV

Additional Resources

MT9V022: 1/3 inch Wide-VGA Digital Image Sensor data sheet

This document makes multiple references to this data sheet. The data sheet is available upon request from Micron. Point Grey Research is unable to directly distribute any Micron documentation not already on our web site.

 

Overview

There are 2 main methods of enabling HDR mode in a Firefly MV camera:

  • 12- to 10-Bit Companding
  • Manual HDR control

The first method is fully automatic once enabled, while the second method enables varying amounts of manual control. The second method also requires writing directly to the registers on the sensor.

 

12- to 10-Bit Companding

This mode can be enabled in the Firefly MV by setting the Gamma register on the Firefly MV to 1. This companding scheme results in reduced quantization noise at low light levels due to the higher ADC resolution. Consequently, the resolution is lower at higher light levels. The following chart details the conversion between 12-bit and 10-bit codes.

Example

The following command shows how to enable 12- to 10-Bit Companding. It assumes that the camera has been initialized and that a valid camera context is present.

flycaptureSetCameraPropertyEx( context, FLYCAPTURE_GAMMA, false, true, false, 1, 0);

 

Manual HDR Control

Writing to Sensor Registers

There is no PGR API to write to the registers on the sensor directly. However, the Firefly MV is capable of passing register read and writes to the sensor. Follow the steps below to write to the sensor’s registers:

  1. Write the address of the sensor register to camera register 0x1A00.
  2. To get the value stored within the sensor register, read camera register 0x1A04. Write to the same camera register to write a value to the sensor register.

Enabling Manual HDR Mode

To enable HDR mode, bit 6 of sensor register 0x0F (Pixel Operation Mode) must be set to 1. The corresponding voltage and shutter width sensor registers must be set correctly in order for this mode to operate correctly.

Voltage Settings

'The step voltage on the sensor is set according to each phase of integration. The step voltage is set to V1 for integration time t1. It is then set to V2 for t2, and then on to V3 for t3, finishing at V4 at the end of integration.

The step voltages for each phase of integration can be set by setting sensor registers 0x31, 0x32, 0x33 and 0x34 for V1, V2, V3 and V4 voltages respectively. The formula used to calculate the step voltage is as follows:

V_Step = (bits 4:0) * 62.5mV + 0.5625V

The range and defaults for each voltage setting are as follows:

Voltage

Range (V)

Default (V)

Default (Hex)

V1

0.5625 – 2.5

2.375

1D

V2

0.5625 – 2.5

2.0625

18

V3

0.5625 – 2.5

1.875

15

V4

0.5625 – 2.5

0.8125

4

Automatic Knee Point Timing

Auto adjustments of the exposure knee points can be enabled by setting bit 8 of the sensor register 0x0A (Shutter Width Control) to HIGH (1). If the Auto Adjust Enabler value is set to HIGH, then the knee points are calculated automatically using the following formula:

t1 = tINT – t2 – t3
t2 = tINT – (½) T2_Ratio
t3 = tINT – (½) T3_Ratio

The T2 (bits 3:0) and T3 ratios (bits 7:4) specified in the Shutter Width Control register will be used in the calculations. The default values are 1/16 of tINT for t2 (i.e. T2_Ratio = 4) and 1/64 of tINT for t3 (i.e. T3_Ratio  = 6).

Manual Knee Point Timing

If the Auto Adjust Enabler value is set to LOW, then the knee points are calculated using the following formula:

t1 = Reg0x08, bits 14:0
t2 = (Reg0x09, bits 14:0) – (Reg0x08, bits 14:0)
t3 = tINT – t1 – t2

In this case, sensor registers 0x08 and 0x09 (Shutter Width 1 and Shutter Width 2 respectively) need to be set.to a value between 1 and 480. The relation between shutter widths is as follows:

t1 = Shutter Width 1
t2 = Shutter Width 2 – Shutter Width 1
t3 = Total integration – Shutter Width 2

Examples

The following example shows how to enable manual HDR control with automatic knee point timing It assumes that the camera has been initialized and that a valid camera context is present.

// Create a variable to hold the register values

unsigned long ulValue = 0;

// Set 0x0F (Pixel Operation Mode) to be the sensor register to be written to

flycaptureSetCameraRegister( context, 0x1A00, 0x0F );

// Flip bit 6 of the register to 1 to enable HDR mode

flycaptureGetCameraRegister( context, 0x1A04, &ulValue );

ulValue |= 0x00000040;

flycaptureSetCameraRegister( context, 0x1A04, ulValue );

// Set 0x0A (Shutter Width Control) to be the sensor register to be written to

flycaptureSetCameraRegister( context, 0x1A00, 0x0A );

// Flip bit 8 of the register to 1 to enable automatic knee point timing

ulValue = 0;

flycaptureGetCameraRegister( context, 0x1A04, &ulValue );

ulValue |= 0x00000100;

flycaptureSetCameraRegister( context, 0x1A04, ulValue );

 

Sample Results

Baseline

The following graph shows the response when the camera is neither in Companding or HDR mode.

cfr81hmk.jpg

12- To 10-Bit Companding

The following graph shows the response when the camera is in 12- To 10-Bit Companding mode.

Manual HDR Mode (Automatic Knee Point)

The following graph shows the response when the camera is in manual HDR mode with automatic knee point timing. Note that the graph will vary depending on the voltage levels and shutter ratios chosen.