Memo Title: MityCCD / IR Camera Binning Theory of Operation
Memo Number: 0005
Revision No.: 2.0
Date: 8-Feb-2007
![]()
Purpose
The purpose of this memo is to describe the image capture and binning modes supported by the CCDsp camera.
Overview
The CCDsp family of cameras currently supports two modes of image readout: Area Readouts and Binned Readouts. In addition to these modes, a third image readout mode has been proposed: Area Masked Binned Readout. All modes are described in detail in the following sections.
Area Readout Description
The Area Readout imaging mode clocks all pixels out of the CCD one at a time, captures the 16-bit unsigned Analog to Digital Converter value of the pixel value and stores it in local SDRAM within the camera. Once the image data is stored in SDRAM, a user configurable rectangular region of the image is transferred to the calling interface (typically a PC) via the data link. Figure 1 illustrates the transfer of pixel data from the CCD, through the CCDsp camera digital processing hardware and to a connected PC interface.
The Area Readout imaging mode provides the calling application with the raw ADC pixel samples. Because no binning is performed, the Area Readout will require the longest amount of time to shift out the data from the CCD. For example, a 256x1024 element CCD will require 256K pixel clocks to read the CCD. Typically, an average of 2 microseconds is required to clock a pixel sample out of the CCD.
Any image integration required (binning for spectral processing, etc.) while using the Area Readout Mode must be performed by the end application.

1 CCD Area Readout Mode
Binned Readout Description
The Binned Readout image mode provides for vertical binning of CCD rows in two locations in the CCDsp camera: the CCD horizontal readout register, the digital pixel processing hardware, or a combination of both. The binned readout operates on a row by row basis, where user defines what operations are required for each row: bin it in the CCD readout register, bin it by taking the results from the readout register and digitally summing in the digital processor, or discard the data.
The sequence of events required for capturing an image in binned mode is:
Configure the mode of the rows using CLSetBinParams()
Configure the Exposure and Shutter Times using CLSetExpTime()
[optional] Clear the CCD using CLClearCCD()
Capture an image
Repeat steps 3 and 4 until a new binning mode is required.
The binned readout image mode provides advantages over the area readout mode in the following ways:
Signal to CCD readout noise improvements may be made by integrating with the horizontal read register of the CCD. This feature is particularly useful in lower light applications.
Binning in the CCD reduces the total image capture time, as the number of horizontal readouts is reduced.
In the same way as 2, binning in the digital processing hardware reduces the total image capture time, as the number of pixels transmitted to the PC is reduced.
The binned readout mode also provides an optional zero mean subtraction circuit, allowing a signed 32 bit result with CCD readout offset biases removed.
Note, however, that binning in the CCD require some care in configuration by the user as there is the possibility to saturate the 16-bin analog to digital convert used in CCD pixel sampling.
The binned readout mode provides several styles of data acquisition, a set of examples are presented here. Figure 2 illustrates vertical binning of the entire CCD area into the CCD horizontal readout register. This is a common technique used in spectroscopy applications in low-light conditions. This mode provides the fastest acquisition time for the CCDsp camera, as only one row is shifted out of the CCD and effectively passed through the digital processing hardware to the PC.
For the binning configuration in Figure 2, the binning codes utilized are shown below:
|
Row # |
Bin Code |
Comments |
|
1 |
BINCODE_BIN |
Add contents to CCD horizontal shift register… |
|
2 |
BINCODE_BIN |
|
|
3 |
BINCODE_BIN |
|
|
4 |
BINCODE_BIN |
|
|
5 |
BINCODE_BIN |
|
|
6 |
BINCODE_BIN |
|
|
… |
BINCODE_BIN |
|
|
N-1 |
BINCODE_BIN |
|
|
N |
BINCODE_SEND |
Add contents to CCD shift register, sum and send. |

Figure 2 Binned Mode Readout, Full Binning in CCD
In cases where high light levels are present and complete binning in the CCD horizontal readout register might result in saturation, the user may choose to partition the data binning between the CCD and the on board digital signal processing within the camera as is shown in Figure 3. In this scenario, the CCD area is binned into 4 rows, thereby reducing the required dynamic range of the readout register and analog to digital converter by a factor of 4 (assuming uniform vertical light distribution). The 4 rows are then accumulated in the digital processing hardware for the camera using a 32 bit accumulator, effectively allowing for additional dynamic range of the resulting single row output spectra.
As is shown in the figure, the digital processing hardware monitors the maximum analog to digital converter value sampled during an image readout process. This value is reported to the PC during image acquisition and may be used to determine if the CCD horizontal shift register is near (or over) the 65535 count saturation level for a given binning configuration. If the level is too high, the user should consider reducing the light levels or reducing the number of rows binned within the CCD.
Also shown in the figure is a zero-mean circuit. The zero-mean circuit is enabled by the CLSetCCDOffset API command and is intended to remove the DC background level from a binned image. For each output row, the zero-mean circuit determines the effective number of CCD rows contributing to the accumulator result and subtracts that number multiplied by the DC offset parameter measured during the CLSetCCDOffset command.
For the binning configuration in Figure 3, the binning codes utilized are shown below:
|
Row # |
Bin Code |
Comments |
|
1 |
BINCODE_BIN |
Add contents to CCD horizontal shift register… |
|
2 |
BINCODE_BIN |
|
|
… |
BINCODE_BIN |
|
|
N/4 |
BINCODE_SUM |
Shift contents of CCD register to processing hardware. Add to accumulator. |
|
N/4+1 |
BINCODE_BIN |
Add contents to CCD horizontal shift register. |
|
… |
BINCODE_BIN |
|
|
N/2 |
BINCODE_SUM |
Shift contents of CCD register to processing hardware. Add to accumulator. |
|
N/2+1 |
BINCODE_BIN |
|
|
… |
BINCODE_BIN |
Add contents to CCD shift register, sum and send. |
|
3N/4 |
BINCODE_SUM |
Shift contents of CCD register to processing hardware. Add to accumulator. |
|
3N/4+1 |
BINCODE_BIN |
Add contents to CCD shift register, sum and send. |
|
… |
BINCODE_BIN |
|
|
N |
BINCODE_SEND |
Shift contents of CCD register to processing hardware. Add to accumulator, send results to PC. |

Figure 3 CCD Binned Mode, Partial Binning in CCD, Partial Binning in DSP, Single Row Output
Up to this point, the provided binning examples only demonstrate the output of a single row or spectra set. The binned mode supports capturing multiple spectra as well. Figure 4 illustrates generating 2 spectra of output data by altering the digital binning patterns using the digital processing hardware. In the figure, one spectra is developed from the top half of the array, and the second is developed from the bottom half of the array.
For the binning configuration in Figure 4, the binning codes utilized are shown below:
|
Row # |
Bin Code |
Comments |
|
1 |
BINCODE_BIN |
Add contents to CCD horizontal shift register… |
|
2 |
BINCODE_BIN |
|
|
… |
BINCODE_BIN |
|
|
N/4 |
BINCODE_SUM |
Shift contents of CCD register to processing hardware. Add to accumulator. |
|
N/4+1 |
BINCODE_BIN |
Add contents to CCD horizontal shift register. |
|
… |
BINCODE_BIN |
|
|
N/2 |
BINCODE_SEND |
Shift contents of CCD register to processing hardware. Add to accumulator, send results to PC (row 1) |
|
N/2+1 |
BINCODE_BIN |
|
|
… |
BINCODE_BIN |
Add contents to CCD shift register, sum and send. |
|
3N/4 |
BINCODE_SUM |
Shift contents of CCD register to processing hardware. Add to accumulator. |
|
3N/4+1 |
BINCODE_BIN |
Add contents to CCD shift register, sum and send. |
|
… |
BINCODE_BIN |
|
|
N |
BINCODE_SEND |
Shift contents of CCD register to processing hardware. Add to accumulator, send results to PC (row 2) |

Figure 4 CCD Binned Mode, Partial Binning in CCD, Partical Binning in DSP, Dual Row Output
Another feature of the CCD binned mode is the fact that binning in the CCD or digital processing hardware need not be uniform (in the vertical dimension) across the array. As an example, consider relatively strong spectra centered vertically on the CCD array with Gaussian amplitude in the vertical dimension. An application desiring the maximize CCD binning may elect to bin one row at a time near the spectra maxima, which would have the highest photon/dynamic range requirement, and bin multiple rows at the edges of the spectra, as illustrated in Figure 5.
For the binning configuration in Figure 5, the binning codes utilized are shown below:
|
Row # |
Bin Code |
Comments |
|
1 |
BINCODE_BIN |
Add contents to CCD horizontal shift register… |
|
2 |
BINCODE_BIN |
|
|
… |
BINCODE_BIN |
|
|
N/4-1 |
BINCODE_SUM |
Shift contents of CCD register to processing hardware. Add to accumulator. |
|
N/4 |
BINCODE_SUM |
Shift contents of CCD register to processing hardware. Add to accumulator. |
|
… |
BINCODE_SUM |
Shift contents of CCD register to processing hardware. Add to accumulator. |
|
3N/4 |
BINCODE_SUM |
Shift contents of CCD register to processing hardware. Add to accumulator. |
|
3N/4+1 |
BINCODE_BIN |
Add contents to CCD horizontal shift register |
|
… |
BINCODE_BIN |
|
|
N |
BINCODE_SEND |
Shift contents of CCD register to processing hardware. Add to accumulator, send results to PC |

Figure 5 CCD Binned Mode, Non-Uniform Binning in CCD, Partial Binning in DSP
Finally, a user may determine that there is no useful information in regions of the CCD exposed image. In this scenario, the user may decide to bin and discard the regions of non-interest. This is illustrated in Figure 6.
For the binning configuration in Figure 6, the binning codes utilized are shown below:
|
Row # |
Bin Code |
Comments |
|
1 |
BINCODE_BIN |
Add contents to CCD horizontal shift register… |
|
2 |
BINCODE_BIN |
|
|
… |
BINCODE_BIN |
|
|
N/4-1 |
BINCODE_DISCARD |
Shift contents of CCD register to processing hardware. Discard results. |
|
N/4 |
BINCODE_SUM |
Shift contents of CCD register to processing hardware. Add to accumulator. |
|
… |
BINCODE_SUM |
Shift contents of CCD register to processing hardware. Add to accumulator. |
|
3N/4 |
BINCODE_SEND |
Shift contents of CCD register to processing hardware. Add to accumulator, send results to PC. |
|
3N/4+1 |
BINCODE_BIN |
Add contents to CCD horizontal shift register |
|
… |
BINCODE_BIN |
|
|
N |
BINCODE_DISCARD |
Shift contents of CCD register to processing hardware. Discard the data. |

Figure 6 CCD Binned Mode, Non-Uniform Binning in CCD, Partial Binning with Discard in DSP
As shown, the binning mode is quite flexible in supporting capture of various horizontal spectra configurations. Care must be chosen in optimizing the binning configuration so as to avoid saturation of the CCD readout register and/or the analog to digital converter circuit.
Area Masked Binned Readout Description
The Area Masked Binned Readout Mode provides for non-rectangular binning of data within the CCDsp camera hardware prior to transmission of data to a connected PC. The key benefit to the area masked binned readout mode is that spectra that warped (i.e., not parallel to the horizontal axis) due to aberrations in optics or other non-linear effects may be binned and optimized on a pixel by pixel basis. In addition, the area masked binned readout mode provides that capability to integrate along the horizontal axis instead of the vertical axis.
The area mask mode requires the following steps for use:
Send the area mask to the CCDsp via CLSetAreaBinParams()
Configure the Exposure and Shutter Times using CLSetExpTime()
[optional] Clear the CCD using CLClearCCD()
Capture an image
Repeat steps 3 and 4 until a new area mask mode is required.
The area mask mode works by transferring all CCD rows/pixels from the CCD to the digital processing hardware, then summing vertically (or horizontally) according to the provided mask. The number of output rows (or columns) is determined by the number of unique masking codes provided by the user supplied area mask.
For a N Row by M Column camera, binning in the vertical dimension will always result in M reported values, and binning in the horizontal dimension will always N reported values. During the binning process, binned values are normalized via averaging the selected pixels in the mask. This is required as the number of pixels selected for each location may be different according to the mask.
Following averaging, if selected, the CCD offset level will be subtracted from the results prior to transmission to the PC.
Figure 7 illustrates use of the area mask binning mode, binning vertically. The example uses 3 unique masks (mask codes 1, 2, and 3) represented by coloring of the pixels. The gray pixels represent discarded pixel data (mask code 0). As the figure illustrates the result for this example is 3 M column binned rows/spectra.

Figure 7 Area Mask Binning Mode, Vertical Binning
Similar to the example above, area masking may also be applied in the horizontal direction. Figure 8 illustrates a 2 spectra mask horizontal binning mode. The use of area masking is powerful but will result in increased capture times as the entire CCD image must be clocked out of the CCD and post processed in the camera digital hardware before transmission to the PC.

Figure 8 Area Mask Binning Mode, Horizontal Binning

