Dragonfly
Little Known Facts (LKFs)
Feature |
Offset |
Presence |
Min |
Max |
One-Push |
ReadOut |
On/Off |
Auto |
Manual |
Brightness |
500h |
yes |
0 |
255 |
no
|
yes |
no
|
no
|
yes |
Auto-Exp |
504h |
yes |
1 |
1023 |
no
|
yes |
yes |
yes |
yes |
Sharpness |
508h |
no
|
n/a
|
n/a |
n/a |
n/a |
n/a |
n/a |
n/a |
White Bal |
50Ch |
yes |
0 |
63 |
no
|
yes |
yes |
no
|
yes
|
|
510h |
no
|
n/a
|
n/a |
n/a |
n/a |
n/a |
n/a |
n/a |
Saturation |
514h |
no
|
n/a
|
n/a |
n/a |
n/a |
n/a |
n/a |
n/a |
Gamma |
518h |
no
|
n/a
|
n/a |
n/a |
n/a |
n/a |
n/a |
n/a |
Shutter |
51Ch |
yes |
2 |
532 |
no
|
yes |
no
|
yes |
yes |
Gain |
520h |
yes |
220 |
1023 |
no
|
yes |
no
|
yes |
yes |
Iris |
524h |
no
|
|
|
|
|
|
|
|
Focus |
528h |
no |
|
|
|
|
|
|
|
Temperature |
52Ch |
no |
|
|
|
|
|
|
|
Trigger |
530h |
yes |
Mode 0 |
n/a
|
no
|
yes |
yes |
no
|
no
|
Zoom |
580h |
no |
|
|
|
|
|
|
|
Pan |
584h |
no |
|
|
|
|
|
|
|
Tilt |
588h |
no |
|
|
|
|
|
|
|
Optical Filter |
58Ch |
no |
|
|
|
|
|
|
|
CaptureSize |
5C0h |
no |
|
|
|
|
|
|
|
CaptureQual |
5C4h |
no |
|
|
|
|
|
|
|
T = (S * 30) / (16000 * FrameRate)
640x480 Black and White: Sony ICX084AL
640x480 Color: Sony ICX084AK (data sheet for a similar part is the ICX204AK)
1024x768 Black and White: Sony ICX204AL
1024x768 Color: Sony ICX204AK
http://www.sony.co.jp/en/Products/SC-HP/Product_List_E/CCD_image_E/progressive_scan_E.html
IR Cut-off Filters
Dragonfly uses the IRC30 filters from Sunex/Optics-Online.
Dragonfly A/D
Converter
Gain
Chart (value, dB, absolute gain)
The processing pipeline in the Dragonfly camera has two
independent gain stages (K0, Krgb) and an offset bias (B) as follows:
Rout = K * Kr * Rin + B
Gout = K * Kg1 * Gin + B
or Gout = K0 * Kg2 * Gin + B
Bout = K * Kb * Bin + B
K is an overall gain that is applied to every pixel value (r,g,b or
b/w), and is set through the standard GAIN register (0x820) or ABS_VAL_GAIN
register (0x920).
The value in the GAIN register is mapped in two segments to
gain equations in dB. If one wishes to set a specific gain value K, then it
probably makes more sense to use the ABS_VALUE_GAIN register where the floating
point value (in dB) is converted to the 10-bit value actually loaded into the
VGA Gain register of the AD9841B. The range of K is 0.0 dB to 30.173 dB (GAIN
register value 220-1023), which equates to a gain range of 1.0 to 32.26.
Kr,Kg1, Kg2, Kb are pixel specific gains associated with the Bayer RGGB
2x2 pixel tile pattern, respectively. Kr and Kb can be set via the
WHITE_BALANCE register (0x80C), which assumes a fixed Kg1 = Kg2 = 32, or
through the BAYER_TILE_MAPPING register (0x1040). The latter lets you also set
the green pixel gains (Kg1, Kg2). The range of Kr,Kg1, Kg2, Kb is from -2.0 dB to +10dB (register value 0 – 63),
which equates to a gain range of 0.794 to 3.16.
The combined gain range is 0.794 to ~102. This table shows the gain range of these two registers.
B is a black level bias adjustment with limited range (0-16 out
of the 8-bit pixel value), and is set through the standard BRIGHTNESS
register (0x800). (See note below on Brightness).
Auto Mode on Gain,
Shutter, Auto-Exposure
(talk to Herman about how this works)
Auto-Exposure in Auto
Mode
According to PGR, this mode attempts to manipulate shutter and gain until approximately 5% of the total pixels in the image have a value of 255 (completely saturated). Both color and b&w cameras are outputting Y8 image data (values 0-255) so it's applicable to both.
If you manually control the Auto-Exposure value, then you are changing the % of pixels that are saturated.
Brightness
The 8-bit Brightness value maps directly to the 8-bit Clamp Level register in the Optical Black Clamp loop of the AD9841A CCD Signal Processor. This loop is used to remove residual offsets in the signal chain, and to track low-frequency variations in the CCD’s black level.
Bottomline, the Brightness register ADDS an offset to the CCD signal immediately before A/D conversion. This offset impacts all pixels (B&W, R,G,B) equally and in an 8-bit output (0-255) can be adjusted from approximately 0 to 16.
The Analog Devices documentation indicates this 8-bit range creates a value from 0 LSB to 64 LSB, whereas the PGR documentation says 0 LSB to 16 LSB. This makes sense since the AD spec is for 10-bit output, and the normal DragonFly is only 8-bit output (those dropped 2 bits account for the 4x difference 64LSB vs. 16LSB, correct)
White balance can be achieved by adjusting the relative gains of R, G and B pixels though the WHITE_BALANCE (r and b only) or the BAYER_TILE_MAPPING register. If using a gray chip chart or MacBeth color chart, it is important that the basic exposure for all colors of interest is linear and do not produce a clamped (0-black or 255-white) output value. One should use the basic GAIN and SHUTTER speed controls and manual lens aperture to establish this basic exposure range. The use of the BRIGHTNESS register may also prove useful in biasing the gain response.
Then by adjusting the relative gains of RGB pixels one should be able to achieve a good color balance for a given lighting situation. One should note that there is quantization error so the possible floating point ratio is indeed limited.
The differences you are seeing from camera to camera are pretty standard - I believe that it is primarily a result of variations in CCDs and perhaps the A/D. I would stay away from the 'one push' button that is in the software - this uses software white balance. We are trying to get away from software white balance because it generally results in the loss of data. The color Dragonfly has hardware WB, which is much better.
Here is a simple algorithm that you might use:Point the camera at your white cloth and on either the whole image or on some sub-section of the image.
· separately sum all of the red pixels, green pixels and blue pixels.
· while the red sum is greater than the green sum, decrease the red part of the white balance, while it is less, increase it.
· while the blue sum is greater than the green sum, decrease it and vice versa.
You should always use the hardware white balance.
By default, the software balance is disabled in the middle position (either 100/100 or 50/50). As for the hardware white balance, it occurs at the A/D level and so can't really be turned off - it can be neutralized. By default, the camera comes up in a mode, which is R 50 G 22 R 50. Setting the R and B gains using the 'SetCameraParameter - white balance' command to 22 will essentially neutralize the effects.
http://www-ise.stanford.edu/~tingchen/main.htm (very comprehensive)
http://www.siliconimaging.com/RGB Bayer.htm
http://users.pandora.be/martin.brown/home/photo/bayer/bayer.htm
http://www.logicalvision.com/doc/opref/color/bayer.htm