+ All Categories
Home > Documents > USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera...

USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera...

Date post: 19-Mar-2018
Category:
Upload: tranthu
View: 217 times
Download: 1 times
Share this document with a friend
80
Silicon Imaging SI-1300 MegaCamera 1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square Pixel ½ Optical format Rolling Shutter ½ & ¼ Image Subsampling 10~40MHz Mhz Clock rates 10 Bit Digital Sampling Silicon Imaging , Inc. 2004 Page 1 of 80 Company Confidential
Transcript
Page 1: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

Silicon ImagingSI-1300 MegaCamera

1.3 Million Pixel Progressive Scan Digital Camera

Revision 1.2August 3, 2004

1.3 Million Pixels 1280 x 1024 Image Sensor5.2 um Square Pixel½ Optical formatRolling Shutter½ & ¼ Image Subsampling10~40MHz Mhz Clock rates10 Bit Digital SamplingAuto Black Level Correction64dB Dynamic RangeUSB2.0 High-Speed Interface

Silicon Imaging , Inc. 2004 Page 1 of 56 Company Confidential

Page 2: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

**** Company Confidential ****

SI-1300-M & RGB MegaCamera™ 1.3 Megapixel (1280 x 1024), 10-Bit Low-Noise, 40MHzUSB 2.0 High-Speed 480Mb/sec Digital Camera

Silicon Imaging is proud to continue its innovation in high-resolution color vision camera. Driven by the growing demand for consumer Digital Still Cameras, CMOS sensors are continuing to break technical barriers and surpass the performance characteristics of CCD’s in many photonic, imaging and consumer applications. By utilizing a single highly integrated CMOS device, which incorporates Megapixel sensing areas, timing generation, signal processing and high bandwidth outputs, Silicon Imaging has developed a very compact, low-power, ultra high speed Megapixel digital camera system.

1280 x 1024 Megapixel  - Ultra ResolutionThe SI-1300 is an all-digital CMOS camera that delivers 1.3 Million pixels of resolution and is capable of running at 30 frame/sec at 1024 x 1024 resolution and 25fps at its full 1280x1024 resolution.   The entire package is only 45 x 52 x 50mm (33 x 40mm x 22mm in PCB) and is small enough to placed on a robot for semiconductor machine vision inspection or placed in an outdoor housing for remote surveillance. For handheld instrumentation designs the ‘R’ version PCB is small enough to fit into a 27mm diameter.

10-Bits Low-Noise (<20e-) – Sub-Pixel AccuracyThe SI-1300 MegaCamera uses 10-Bit digitizers to sample the pixel data. Converting the pixel data directly to digital at the sensor head eliminates pixel-sampling jitter and enables accurate sub-pixel metrology, image analysis and improved live video reconstruction. The results are impressive with low-noise and low-dark currents to allow increases in gain and exposure time for improved signal noise. Image transfer can be switched from 8 to 16bit mode, to get full 10bit data. A programmable 10~40MHz clock allows for trade-off in bit-depth and speed versus exposure time and lower noise.

75 FPS VGA Subsampling - Fast PreviewIdeal for high speed preview and focusing, the SI-1300 is capable of generating imagery at over 100 frames per second by reducing the size of the readout image in color subsampling mode, This entire imager is readout by skipping pairs of pixels (4:2) to maintain color information of neighboring bayer groups. In this way, the 640x480 accurately represents the full size 1280x1024 image.

Automatic Black Level Correction – IR SensitivityThe SI-1300 has automatic black level calibration, which measures the average value of 256 pixels from two dark rows of the imager for each of the four colors. The pixels are averaged as if they were light sensitive and passed through the appropriate color gain. This average is then digitally filtered over many frames and compared to minimum and maximum acceptable thresholds for automatic correction.

USB2.0 Bus-Powered – 40MB/sec TransfersFor low-cost and portable connectivity, with data transfer rates up to 40MB/sec, the SI-1300U provide convenient capture using the High-Speed 480Mb/sec USB 2.0 interface. It is a bus-powered unit, consuming less than 500mA at 5VDC and will operate without any external power supply. The precision-machined C-mount housing includes an integrated tethered USB cable and optional 3-pin trigger/strobe connection. For OEM board level configurations, two General Purpose Outputs are accessible; Pull-Up and pull-down driven transistors to be used to control light sources and switches.

Microsoft-XP™ Live Mode Kernel Driver - Fast capturesFor applications which require a combination of high-resolution and streaming high-frame rate video images, Silicon Imaging has developed a custom driver which can request and capture double buffered images at the driver level. This method enables immediate request to camera for next

FEATURES

·       1280 x 1024 Resolution (1.3 Million Pixels)

·       1/2” Imaging Format, 5.2um Square Pixel

·       Rolling Shutter, Progressive scan

·       120fps Windowing at 320 x 240 QVGA

·       10 Bits per Pixel, 35MHz Sampling (Nominal)

·       10 ~ 45MHz Programmable Clock

·       IR-Sensitivity & Low-dark Currents (<20e-)

·       Programmable Gain, Exposure & Clocks

·       Auto Black Level Calibration

·      Monochrome & Color Bayer RGB Model

·       Custom PCB Version

·       USB2.0 High-Speed, 480Mb/sec Interface

Silicon Imaging , Inc. 2004 Page 2 of 56 Company Confidential

Page 3: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

image without user level software intervention. The double-buffers allow one image to processed by the host PC, while another image is being readout from the camera and filled into the user allocated memory space.

·       C-Mount Precision Machined Housing

·       Image Capture & Color Processing SDK

SI-1300 USB2.0 MegaCamera SpecificationsSensor:

Optical Imaging Format 1/2” (6.83mm x 5.45mm)Active Pixels 1,280H x 1,024VPixel Size (pitch) 5.2 µm x 5.2 µm Pixel Type CMOS Aspect Ratio 1 : 1Spectral Response 350 ~ 1000 nmPeak QE 56% Monochrome @ 570nm

Minimum Illumination: 0.3 lux nominal ( SNR =1, f# = 2.8, exposure = 100ms, daylight)

Responsivity 2.1 V/lux-secDark Current @ 25°C 20 e-/secTemporal Noise 10 e-Saturation Charge 40,000 e-

Dynamic range 68.2 dBWindowing (ROI) Horizontal & Vertical speed increaseSub-sampling Full, 1/2, 1/4, 1/8Gain MAX 15X, min step size 0.125Readout Method Progressive ScanBlack Level Auto Black Level CalibrationShutter Rolling Shutter and Single FrameShutter Speed Variable, 1 to 16383 row times Horizontal Blanking 244 Clocks/line Minimum Row Time 548 Clocks (304+ 244 Blanking)Vertical Blanking 26 Rows Row/Frame Time 1524 clocks/row x 1050/rows = 30fps

A/D Conversion & Sampling Clock SynthesizerA/D Conversion Nominal 35Mhz (24fps @ 1.0MP)Vertical Resolution 10 Bit Pixel Clock Frequency 10 ~ 40 Mhz Programmable

Digital Video Output Readout Format 8-bit or 16bit (10-bit data)Readout Rate 10 ~ 40Mhz ( 8bit format

10~ 25Mhz (16-bit format)Max Transfer Rate ~ 40MB/sec(ICH4 or higher)Frame Rate

1280 x 10241024 x 1024

1280 x 7201024 x 768

640 x 480320 x 240

40MHz2530354085

220

20MHz1215172042

110

Row Time clocks/row / Clock =Row_Time1524 / 40MHz = 38.1usec/row

Exposure Time N-Row Times

USB2.0 High-Speed Interface & Control: USB Speed 480Mb/sec (High-Speed)Serial Communication Endpoint 0, Vendor ProtocolData Interface Endpoint 2, 2K FIFOProgrammable Modes Exposure, Gain, Windowing, Clock

rates, Auto black, mirroring.Region-of–Interest Programmable Horiz & VerticalGains (R,G,B,G & Global) Individual R,G1,B, G2 Gains

Range: 15X, MIN step size 0.125Setting Timing Next top of FrameExt Clock Sync Clock in or Clock Out (-X Option)External Triggers TTL Trigger-In / Strobe-Out

w/3-Pin connection (option)

PowerInput Voltage +5 VDC +/- 10%Power 2.5 WattsTrigger Connection (opt) Tajimi RO3-PB3M 3Pin (optional)

MechanicalLens Mount C-Mount, 7mm Back focus Adj.Enclosure Size 45mm W x 52mm H x 50mm LWeight 12 oz.Camera Mount ¼” x 20 standard tripod mountCable Connector Mini-B USB

Spectral Response Curve (Monochrome)

SI-1300 Ordering InformationSI-1300U -M or -RGB 1.3 Megapixel USB2.0 Camera, M=Monochrome, RGB= Bayer Color

Silicon Imaging , Inc. 2004 Page 3 of 56 Company Confidential

Page 4: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

-PCB or -R PCB (33x40mm) or ‘R’ Round (27mm) Version of Camera. No housing included.-T External Trigger & strobe with 3-Pin Connection and Trigger/Strobe Breakout Cable-X External Clock-In & Clock out camera. Must be ordered as a Master-Slave configurationCBL-3PT Cable, 3Pin Tajimi to TTL Trigger-In & Strobe Out

Silicon Imaging , Inc. 2004 Page 4 of 56 Company Confidential

Page 5: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

SI-1300 Camera Architecture OverviewThe MegaCamera SI-1300 consists of 6 major component sections, which are built on two circuit boards.

1.) 1.3 Megapixel Sensor2.) Digital Clock Synthesizer3.) Digital Control Logic4.) Microprocessor5.) USB 2.0 High-Speed Interface6.) Power Regulation 7.) Trigger & Strobe Controls

Camera Block Diagram

1.) 1.3 Megapixel CMOS Image Sensor (1280 x 1024)The MegaCamera SI-1300 utilizes a proprietary 1.3 Million pixel high-speed CMOS image sensor. Each pixel is 5.2um Square, ideal for image processing, and the entire array fits the 1/2” format for flexible optic choices. This reduction in process geometry allows for both an increase in transistors and fill factor without compromising performance, plus offers more advanced readout controls, greater speeds and lower power dissipation.

This new sensor technology offers a more responsive pixel design with added circuitry for increased dynamic range, greater sensitivity, decreased fixed pattern noise and low dark current for long exposure applications. Unlike CCD, which leak charge to adjacent pixels when the registers overflows (blooms), the SI-1300 provides inherent anti-blooming protection in each pixel, so that there is no blooming.

Silicon Imaging , Inc. 2004 Page 5 of 56 Company Confidential

Page 6: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

The array has 1280 pixels on a line and 1024 rows, which result in a 4:3 aspect ratio. The sensor array design is based on a field integration read-out system with line-by-line transfer and an electronic shutter with a synchronous pixel read-out scheme (aka. Rolling Shutter Method)

Analog Gain Amplifier & OffsetThe imager signal path consists of two stages, a programmable gain stage and a programmable analog offset stage. The gain settings can be independently adjusted for the colors Green1, Blue, Red, and Green2 and are programmed through registers. A total programmable gain of 15 is available. The programmable analog offset stage corrects for analog offset that might be present in the analog signal. The analog offset settings can be independently adjusted for each color (R/G1/G2/B).

Automatic Black Level CompensationThe automatic black level calibration measures the average value of 256 pixels from two dark rows of the imager for each of the four colors. The pixels are averaged as if they were light-sensitive and passed through the appropriate color gain. This average is then digitally filtered over many frames. For each color, the new filtered average is compared to minimum and a maximum acceptable level. If the average is lower than the minimum acceptable level, the offset correction voltage for that color is increased. If it is above the maximum level, the level is decreased. The upper threshold is automatically adjusted upwards whenever an upward shift in the black level from below the minimum results in a new black level above the maximum. This prevents black level oscillation from below the minimum to above the maximum. The lower threshold is increased with the maximum gain setting (out of all four colors), according to Register settings. This prevents clipping of the black level. After changes to the sensor configuration, large shifts in the black level calibration can result. To quickly adapt to this shift, a rapid sweep of the black level during the dark-row readout is performed on the first frame after certain changes to the sensor registers.

2.) 10-Bit Digital Sampling System A 10-Bit Analog-to-digital (A/D) converter samples each pixel value and quantizes it into 1024 levels inside the sensor. Pixel clock sampling ensures precise measurement of the photonic charge without the jitter and sampling uncertainty associated with traditional analog video systems, such as RS-170 and CCIR. This produces images which can deliver improved photometry accuracy and sub-pixel metrology. The use of 10-bit converters versus traditional 8-bit systems further enhances the image dynamic range. The combination of 10-bit vertical resolution and pixel clock sampling provide precise sub-pixel measurement accuracy (ex. 1/10 pixel).

Silicon Imaging , Inc. 2004 Page 6 of 56 Company Confidential

Page 7: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

3.) Digital Clock Synthesizer A wide range a master clock frequencies (eg. 7 to 40MHz) can by precisely generated using the Digital Clock Synthesizer. The frequency of the clock synthesizer can be set by API command. A table with associated clock frequency is found in the serial programming section of the manual. Due to minimum frequency restriction on the digital transmission link, the pixel clock frequency cannot be higher than 40Mhz in 8-bit mode or 20~25MHz in 16bit mode (depending on image size).

4.) Embedded MicroprocessorA microprocessor in the camera provides the control interface between the PC and the functional block in the camera (Sensor, Clock Synthesizer, Register MemoryUSB2.0 Interface & triggers. The Microprocessor receives commands thru the USB 2.0 port and issues commands to the other devices. It also can store preset values for camera setting, deviant pixel correction lists or other user data which can be stored and recalled from internal EEPROM.

5.) USB2.0 Interface & PowerThe UBS2.0 interface connects the camera to the PC with a single 4-wire cable. The high-speed port provides sustained data rates of over 40MB/sec and also provides +5VDC to the camera for bus-powered operation.   The interface also provides bi-directional serial communication for camera setup and control, triggering, strobing and other I/O signaling.  

6.) Triggers & GPIO

Several digital I/O and pull-up/pull-down transistors signals are available for control via the processor on PCB header points, for custom OEM applications. The –T option will provide a 3-pin connector for Trigger in and strobe out operation. A trigger or trigger-strobe cable should be ordered separately.

3-PIN TRIGGER-In/ STROBE-OUT WIRING

Silicon Imaging , Inc. 2004 Page 7 of 56 Company Confidential

Page 8: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

InstallationDownload and install the current software from the Zip compressed file by double-clicking on the MegaXVInstall:

The Wizard will take you thru the steps to completion.

Once the MegaXV software and USB drivers (ezusb.sys & ezusbsi.inf) or extracted, you are ready to plug-in the camera.

Silicon Imaging , Inc. 2004 Page 8 of 56 Company Confidential

Page 9: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

USB Drivers & Device ManagerPlug in the Camera and follow the Wizard:

Silicon Imaging , Inc. 2004 Page 9 of 56 Company Confidential

Page 10: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

A warning message will appear:

Press Continue Anyway.

Select ‘Finish’. The Registry has now been updated and the camera can now be accessed by the MegaXV application.

Silicon Imaging , Inc. 2004 Page 10 of 56 Company Confidential

Page 11: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

You can confirm the camera and USB 2.0 drivers are correctly installed by viewing the Device Manager:

You will see an entry for Silicon Imaging USB2.0 Mega Camera:

Silicon Imaging , Inc. 2004 Page 11 of 56 Company Confidential

Page 12: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

The Enhanced Host Controller entry is the USB2.0 hardware. This will most likely be an Intel 82801DB (ICH4), ICH5, ICH6 or NEC PCI hardware device. The driver will either be Microsoft or Adaptec. In Windows XP, Microsoft provides the USB2.0 drivers for both Intel and NEC hardware controllers.

Silicon Imaging , Inc. 2004 Page 12 of 56 Company Confidential

Page 13: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

Run MegaXV

Double-Click the MegaXV icon from the Silicon Imaging software directory:

When MegaXV first starts, the screen looks blank. Cameras or Images can be opened into the MegaXV software. Initially, no cameras are available. By clicking on the + buttun, the first of any connected cameras should be added. Press + again will add additional cameras into the MegaXV desktop.

Once a camera is added, it will be visible as a label [SI1820C] in the active window: Select between active cameras from the top tab to control their views for capture and display.

Press the Play button to start a LIVE display from the bottom capture bar:

The camera or image can be captured and scaled to fit in the window (Zoom %), processed with monochrome (B/W checker) or Bayer color (color Checker)).

To assess the maximum data transfer rate, the display should be turned off using the no display button (Black box).

Silicon Imaging , Inc. 2004 Page 13 of 56 Company Confidential

Page 14: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

MegaXV Menus

The MegaXV Application is controlled from 2 areas the Control Bar (Bottom) and the Config (Right). These windows can be floated or closed once the selections are made, to increase the window space available for image display.

Silicon Imaging , Inc. 2004 Page 14 of 56 Company Confidential

Page 15: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

CAPTURE CONTROLS TOOLBARThe capture controls are at the bottom of the screen. The camera icon snaps a single image. The triangle starts continuous capture and the square stops it. When in continuous mode, the ‘Frame captured’ should keep increasing. The Frame rate shows a long-term average. If adjustments are made, it is necessary to stop and start the display to see an immediate effect on the frame rate.

ARM TRIGGER (-T trigger Option)

Select this mode to capture images using an external trigger. This can be used with Single-Frame Snap or Live Snap. If either capture is started the camera is put in a waiting state until a trigger is detected. Upon trigger, an image is captured and transferred into memory for display. In continuous snap mode, the capture is then rearmed awaiting another trigger.

DOUBLE BUFFER SNAP

This modes uses 2 frame memory buffers and ping-pongs between buffers for each snap. Under certain capture conditions and camera model, this mode may provide a slightly higher capture rate.

CONFIG TOOLBAR

There are four tabs on the Config Toolbar (right panel): Color, Camera, Info & Log.

The camera tab will display the current model camera being controlled such as SI1300, SI-3300, SI1280 or SI3170.

Silicon Imaging , Inc. 2004 Page 15 of 56 Company Confidential

Page 16: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

Camera Tab

SizeSets the image capture window size. The default ROI Origin is usally 0,0 (in the top, left). However the X_Origin & Y_Origin can be moved using sliders.

The Image Size defaults: 1280X1024 1024X1024 1024X768 640 X 480 320X240 CUSTOM

The ‘Custom’ option can be used to set an arbitrary window size.

Bit Depth – 8 or 12 bit. 12 bit operation requires twice the USB bandwidth and will have half the frame rate. Be sure to set the Maximum clock speed to 20MHz (or 25MHz for sizes below 1K are possible)

Gain & Offset – sets the camera analog RGGB or Global gains. The Global gain will overwirte the RGGB gains when selected, loading the same value into all 4 gain registers. The analog gain should be set as low as possible for minimizing fixed pattern noise.

Clock and Exposure – The clock rate can be set within a range of 7 to 40MHz, dependent on the camera and host controller.

Black Reference - Used to capture a black reference frame and subsequently subtract each pixel from the snapped blacked image.

Silicon Imaging , Inc. 2004 Page 16 of 56 Company Confidential

Page 17: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

Color Tab

The Color tab provides a variety of digital controls for adjusting the image quality.

Digital Gain – With a color camera, the relative gain values for each color channel can be adjusted. A global gain can also be used to enhance the image.

Offset A black level offset can be added to the image to improve the black contrast.

Saturation A saturation matrix is applied to the color image. The double arrow displays the matrix.

White Balance A preset (selected below) color setting or automatic white balance can be selected. For Automatic white balance, the double arrow provides a number of algorithm options (Gray Worl or White Patch). During AWB operation, the current RGB values can be set to hold. Selecting Preset will use the RGB gains in the CFG Preset file.

Bayer PhaseFor color cameras, the sensor has a red, blue, green matrix of color filters in a pattern called a Bayer Color Filter. Depending on the starting color for the window, the Phase value may need to be adjusted. This is done by viewing a red or blue object and selecting the phase that provides the correct color.

Bayer Interpolation MethodThe ‘Basic’ method is the fastest method for filling in the RGB values of a bayer pixel, using the nearest neighbor missing color. When color edge quality is required, the interpolation method can be set to ‘Advanced’ at the expense of frame rate.

Deviant Pixel Correction – Checking this box will provide automatic sensing and correcting for any pixels that are not responding correctly. This is a processing intensive algorithm and will reduce the maximum display rate of MegaXV. The DPC NUMBER of pixels to be corrected is set in the CFG file.

Presets – Complete color transformation matrices correcting for differing lighting temperatures and AWB/Preset values, Interp Method and DPC Count can be selected, either from a list or a new file using >> button.

Silicon Imaging , Inc. 2004 Page 17 of 56 Company Confidential

Page 18: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

Info Tab - USB Vendor Request

This provides model, firmware revision and camera serial number information. Please have the model and firmware version available when calling or emailing problem reports.

The Vendor Request Dialog is only to be used by developers testing low-level USB command transfers to the camera. It should not need to be used during the normal operation of the camera.

The basic Vendor Request provides the following fields:

Vendor Request: 8 bits Command (eg. Load Camera Register)Value:        16 bits Value to load into RegisterIndex:        16 bits Camera RegisterLength:        16 bits Direction: 1 bit (IN =1 or OUT=0)

A non-zero length vendor request implies an endpoint 0 (EP0) data transfer, which is either IN or OUT.  A "Hex Bytes" input field is provided in the control panel window and holds the data for OUT transfers.

The following is the Silicon Imaging API function used to Downloads or uploads arbitrary Endpoint-0 control data to the camera registers.

int TransferCamControlData(int iCamNumber, int iVendorRequestCode, int iIndex, int iValue, int iDirection, int iBufferSize, unsigned char* buffer)

A non-zero Length Vendor Request implies an EndPoint 0 (EP0) data transfer, which is either IN or OUT.

Silicon Imaging , Inc. 2004 Page 18 of 56 Company Confidential

Page 19: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

Firmware UploadThis operation should be done carefully, as it is possible to render the camera non-functional and not field repairable. Be sure the camera is in a stopped mode before continuing.

After selecting the Upload Firmware menu option, you will select the newer version of firmware:

Be sure that the firmware matches the camera type. Also, the firmware is distributed as a zip file and must be unzipped before installing. After selecting the firmware, several minutes will pass. Do not do anything. Eventually, this window will display:

Each version of firmware is distributed with a checksum value. This is a unique value for every firmware version. Enter the value, click on OK and DO NOT TOUCH THE COMPUTER UNTIL THE PROCESS IS COMPLETE. This can take 30 seconds to a minute.

Silicon Imaging , Inc. 2004 Page 19 of 56 Company Confidential

Page 20: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

Image Save & LoadThe operational screen should look like this:

The file menu provides a method for opening image files, saving binary files and bitmaps.

Silicon Imaging , Inc. 2004 Page 20 of 56 Company Confidential

Page 21: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

BLACK REFERENCE CORRECTIONIn order to correct for background non-uniformity and dark current accumulation, a full frame image subtraction can be performed on a pixel for pixel basis:

Cover your lens and adjust Black Offset and Column offset to insure Black is in the digitizing range:

Silicon Imaging , Inc. 2004 Page 21 of 56 Company Confidential

Page 22: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

From the Camera Tab (eg. SI1300), press the GRAB button and check the apply radio box.

The image should now appear black:

Silicon Imaging , Inc. 2004 Page 22 of 56 Company Confidential

Page 23: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

Uncover the lens and the picture will have a uniform background:

Go to the Color Tab and Select the correct lighting color correction Presets Option (Tungsten, Fluorescent, Sunlight, etc). Then, adjust Digital Gains & Offset for best contrast and Advanced Interpolation for best rendering:

Silicon Imaging , Inc. 2004 Page 23 of 56 Company Confidential

Page 24: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

Introduction to USB Communication

Vendor Requests – Endpoint-0 Communication

All camera controls and programming are done at the lowest level USB communication using Vendor Requests (VR). The VR’s codes have been assigned by Silicon Imaging, “the vendor” and their functions are defined in the following section.

The Vendor Request can be used to change all camera settings or the high-level API can be used to perform the same functions. The INFO-tab of MegaXV, provides a convenient method for sending these commands and seeing the results.

The basic Vendor Request provides the following fields:

Vendor Code:    8 bitsValue:        16 bitsIndex:        16 bitsLength:        16 bitsDirection: 1 bit, (IN (1) or OUT (0))

A non-zero length vendor request implies an endpoint 0 (EP0) data transfer, which is either IN or OUT.  A "Hex Bytes" input field is provided in the control panel window and holds the data for OUT transfers.

TransferCamControlData( )

The following is the Silicon Imaging API function used to send any vendor request command:

int TransferCamControlData (int iCamNumber, int iVendorRequestCode, int iIndex, int iValue, int iDirection, int iBufferSize, unsigned char* buffer) ; 

Description:

Downloads or uploads arbitrary Endpoint-0 control data to the camera registers.

Arguments:

iCamNumber – number of camera deviceiVendorRequestCode - vendor request codeiIndex – Camera register or value (16 bits)iValue – data value per command (16 bits)iDirection – 1 (IN) - upload from camera to host and transmit commands with return strings 0 (OUT)  - download from host to camera iBufferSize – number of bytes to transfer to/from register specified by the iIndex value*buffer – pointer to buffer containing control information (typ recived from the camera for 1=IN)

A non-zero Length Vendor Request implies an EndPoint 0 (EP0) data transfer, which is either IN or OUT.

Silicon Imaging , Inc. 2004 Page 24 of 56 Company Confidential

Page 25: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

SI-1300 USB VENDOR CODES

VR Function Value Index DIR Buffer Description

0x94 Write Register xVVVV

ValueTo

Write Into

register

xRRRR

RegisterTo

Write

1 0 0x00 Chip ID0x01 Row Start 0x02 Column Start 0x03 Window Height0x04 Window Width0x05 Horizontal Blanking 0x06 Vertical Blanking 0x09 Exposure 0x0C Shutter Delay 0x1E Subsampling 0x20 Subsampling 2 0x2B Green1 Gain 0x2C Blue Gain 0x2D Red Gain 0x2E Green2 Gain 0x35 Global Gain

0x94 Read Register 0 xRRRegister 1 2 Read Register (16-bit) response

0xE1 Read Firmware Version 0 0 1 16 Issue an IN transfer of Length 16 to Read

Firmware Version.  The Value and Index fields are ignored.  The returned string will contain ASCII characters, and the last byte will be zero.

0xE7 Read Serial Number 0 0 1 16 To read Serial Number String from the Camera, issue an IN transfer of Length 16 bytes.  The Value and Index fields are ignored.  The returned string will contain ASCII characters.

0xE4 Write Flash memory (OUT) 0 0x0000to

0x00FF

0 32 An OUT transfer of 16 is used for storage of 32 words of 14bit values. The Index field is used to address 256 blocks(0xFF) of memory. The first byte and every odd byte contain only 6 usable bits.  The Value field is ignored. This command is used in firmware upgrades, but the data storage can be used for other function

0xE4 Read Flash memory(OUT)Note: This memory space is used in firmware upgrades and will overwrite any user data stored in this memory.

0 0x0000 -

0x00FF

1 32 An IN transfer of 32 is used to read 16 words of 14bit values. The Index field is used to address 256 blocks (0xFF) of memory. The first byte and every odd byte contain only 6 usable bits.  The Value field is ignored. This command is read arbitrary data stored by the Write Flash command.

0xE4 Upgrade Firmware (IN)

WARNING!  Please wait 30 seconds before unplugging the camera to allow the upgrade to complete.

CODE 0 1 4 An IN request of Length 4 will expect a firmware upgrade code (from factory) in the Value field (length 16 bits – 4 hex).  Index field ignored.  If the CODE does not match, the returned 4 bytes will contain the ASCII "FAIL". If the code does match, the 4 bytes of data returned will be "DONE".  After the firmware update is done, the USB Camera should be reboot (unplug and replug). The new firmware will then be active.

0xE8 Read CPLD code 0 0 1 4 An IN transfers of Length 4 bytes will return the CPLD Firmware Code. 

Silicon Imaging , Inc. 2004 Page 25 of 56 Company Confidential

Page 26: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

SI-1300 Sensor Register ProgrammingUse VR=x94, Index=Register, Value = Value to Load, Dir = 1 (IN), Len = 0

Index Description Value Setting

0x00 Chip Version 0x84xx 0x8421 or 0x8431

0x01 Row Start 0x000C (12)

(First row to be read out + 12)

0x02 Column Start 0x0014(20)

(First column to be read out + 14)Register value must be an even number.

0x03 Window Height 0x03FF(1023)

Window height (number of rows - 1)Min = 0x0002.

0x04 Window Width 0x04FF(1279)

Window width (number of columns - 1) Register value must be an odd number.Min = 0x0003

0x05 Horizontal Blanking 0x0013(19)

Number of extra row blanking clocks + 19Row Blanking = 244 clocks + (Regx05 –19)

0x06 Vertical Blanking 0x0019 (25)

Number of extra rows added into the vertical blanking period. Typically used to slow down frame rate and allow time for register updates between images.

0x09 Exposure 0x0419 (1049)

Number of rows of integration

0x0C Shutter Delay(Short Exposure)

0x0000 (0)

Number of master clocks times four that the sensor waits before asserting the reset for a given row.

0x1E Subsampling& Snapshot Mode

0x80xx(x8000)

0 0 (do not change)1 0 (do not change)2 Column Skip 4—default is 0 (disable), 1 = enable.3 Row Skip 4—default is 0 (disable), 1 = enable.4 Column Skip 8—default is 0 (disable), 1 = enable.5 Row Skip 8—default is 0 (disable), 1 = enable.6 0 (do not change).7 0 (do not change).8 Snapshot Mode—default is 0 (continuous mode).1 = enable Snaphsot TRIGGER can come from CC-1 or from serial interface command.

0x20 Subsampling 2& Scan Reversal

0x11xx(0x1104)

0 No bad frames: 0 (default) = only good frames, 1 = all frames 1 0 (do not change)2 1 (do not change)3 Column skip2: 0= normal readout (default), 1= skip by 24 Row skip2: 0 = normal readout (default), 1= skip by 25 0 (do not change)6 0 (do not change)7 Flip Row: 0 = normal, 1= Scan reversal8 1 (do not change)

0x2B Green1 Gain 0x0008 (8)1x gain.

Gain Increments Settings1.000 to 4.000 0.125 0x08 to 0x20 4.25 to 8.00 0.25 0x51 to 0x60 9.0 to 15.0 1.0 0x61 to 0x67

0x2C Blue Gain 0x0008 (8)1x gain.

0x2D Red Gain 0x0008 (8) 1x gain.

0x2E Green2 Gain 0x0008 (8) 1x gain.

0x35 Global Gain 0x0008 (8)1x gain.

This register can be used to set all four gains at once. When read, it will return the value stored in Reg0x2B.

Silicon Imaging , Inc. 2004 Page 26 of 56 Company Confidential

Page 27: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

Digital Clock Synthesizer ProgrammingThe SI-1300 has a Digital Clock Synthesizer capable of generating a range of frequencies from 7MHz to 40MHz. The pixel data output rate is the same as the sampling clock rate.

A range of preset frequencies are listed below: Note: The factory can generate the command to achieve a targeted clock rate.

Vendor Code

Function Value16bits

Index16 bits

DIR Buffer Description

0xE2 Set Clock

The pixel clock rate of the SI1280 is the same as the programmed rate. Therefore, 30MHz will be equal to 30MP/s.

Warning:The maximum clock rate speed allowed will be dependant on the image size, bit depth settings and the sustained throughput on the USB host controller.

0 0 0 3 An OUT transfer with a length of 3 sets the clock frequency.  The Index and Value fields are ignored. The following table is a list of 3 byte hex strings and clock values.

10 MHz 30688E15MHz 328E9020 MHz 30688625MHz 30B68930MHz 37CB8F35MHz 35D40B40 MHz 30688245 MHz 35E70950 MHz 34B689

0xE2 Get clock 0 0 1 3 An IN transfers of Length 3 bytes will return the last used clock setting. 

API FUNCTION:

SI_ReadClockFile(char* cCamClockFile, int* iClockTableSize, CLOCKSETTING* ClockSettings)SI_SetClock ( int iCamID, int iCamClockMode, CLOCKSETTING* ClockSettings)SI_SetClockB ( int iCamID, int iClockIndex)SI_ReadStatusClock (int iCamID, int* iStatus, int* iClock)int SI_SetClockB ( int iCamID, int iClockIndex)

Silicon Imaging , Inc. 2004 Page 27 of 56 Company Confidential

Index Clock Rate(Mhz)

0 71 82 93 104 155 206 257 308 359 40

10 45

Page 28: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

Frame Timing

PARAMETER NAME EQUATION (MASTER CLOCK) TIMING (48MHz)

A Active Data Time (Reg0x04 + 1) 1,280 pixel clocks= 26.7µs

P 1 Frame Start Blanking 242 Clocks 242 pixel clocks= 5.04µs

P 2 Frame End Blanking (2 + Reg0x05 - 19)(MIN Reg0x05 value = 19)

2 pixel clocks= 0.042µs

Q = P 1 + P 2 Horizontal Blanking 244 + (Reg0x05 - 19)(MIN Reg0x05 value = 19)

244 pixel clocks= 5.08µs

Row_Time Row Time A + Q =((Reg0x04 + 1) + (244 + Reg0x05 - 19)) Min Row_time = 244 + 304 = 548 clocks/row

1,524 pixel clocks= 31.75µs

V Vertical Blanking (Reg0x06 + 1) x (A + Q)(MIN Reg0x06 value = 15 rows, Default =25)

39,624 pixel clocks= 825.5µs

N rows x (A + Q) Frame Valid Time (Reg0x03 + 1) x (Row_Time) 1,560,576 pixel clocks= 32.51ms

F Total Frame Time (Reg0x03 + 1 + Reg0x06 + 1) x Row_Time1,600,200 pixel clocks= 33.34ms / 30fps

F’ Total Frame Time (long integration time) (Reg0x09 + 1) x Row_Time

1,600,200 pixel clocks= 33.34ms / 30fps

Note: Typically, the value of Expsoure (Reg0x09) is limited to the number of rows per frame (which includes vertical blanking rows) such that the frame rate is not affected by the integration time. If Reg0x09 is increased beyond the total number of rows per frame, the camera will automatically increase vertical blanking (Reg05) as needed, and therby reduce the effective frame rates.

To calculate the frame rate for any clock rate the equation is estimated by:

( clock rate(Hz) ) = # Frames Per Second (fps)

( # of columns + 244) * ( # of rows +25) -180

Example: What is the frame rate, at 48MHz clock rate for an image size of 1280 x 1024?

40 x 10 6 = 25 Frames Per Second (fps) ( 1280 + 244) * (1024+25)

*** Subsampling frame rates are based on the resulting size of the sub-sampled image or window.*** Minimum # of columns that are internally clocked is 304, even if the image window is smaller. Therefore the minimum row time = 304 + 244 = 548 clocks.

Silicon Imaging , Inc. 2004 Page 28 of 56 Company Confidential

Page 29: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

Frame Timing RegistersRegister Name Default Description

0x03 Window Height 0x03FF(1023)

Window height (number of rows - 1)Min = 0x0002.

0x04 Window Width 0x04FF(1279)

Window width (number of columns - 1) Register value must be an odd number.Min = 0x0003

0x05 Horizontal Blanking 0x0013(19)

Number of extra row blanking clocks + 19Row Blanking = 244 clocks + (Regx05 –19)

0x06 Vertical Blanking 0x0019 (25)

Number of extra rows added into the vertical blanking period. Typically used to slow down frame rate and allow time for register updates between images.

API FUNCTION:

SI_InitWindowMode (int iCamID, int iStartRow, int iEndRow, int iStartColumn, int iEndColumn, int iFrameTime, int iExposureTime)SI_SetVerticalBlanking(int( iCamID, int iVertBlanking);SI_SetHorizontalBlanking(int( iCamID, int iVertBlanking);

Silicon Imaging , Inc. 2004 Page 29 of 56 Company Confidential

Page 30: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

Exposure Time (Reg09)The exposure time is set by adjusting the number of row times in the exposure register (Reg09), up to the number of rows in the frame. For longer exposures, the frame time can be extended beyond the normal 1024 rows by increasing vertical blanking (Reg05).

Exposure_Time = (Row_Time x Reg09) – 180 clocks Reg09 = Rows of integration

Row_Time = Width + 244 + Horizontal Blanking = (Reg04 + 1) + 244 + (Reg05 - 19)

Reg04 = Width-1 Reg05 = Vertical Blanking (min =19)

Note: Typically, the value of Reg0x09 is limited to the number of rows per frame (which includes vertical blanking rows) such that the frame rate is not affected by the integration time. If Reg0x09 is increased beyond the total number of rows per frame, the camera will automatically increase vertical blanking (Reg05) as needed, and therby reduce the effective frame rates.

API FUNCTION:

SI_SetExposureValue (int iCamID, int iExposure)

Exposure_Time in Subsampling & Anti-Flicker

Row skip mode should have no effect on the integration time.

Column skip mode changes the effective value of Column Size (Reg0x04) as follows:

Column Skip 2 => Reg04eff = (int(Regx04 / 4) x 2) + 1Column Skip 4 => Reg04eff = (int(Regx04 / 8) x 2) + 1Column Skip 8 => Reg04eff = (int(Regx04 / 16) x 2) + 1

where the int() function truncates to the next lowest integer. R4eff in the equation for Row_Time instead of Reg04

The Exposure_Time should be adjusted to avoid banding in the image from light flicker. Under 60Hz flicker, this means Exposure_Time must be a multiple of 1/120 of a second. Under 50Hz flicker, Exposure_Time must be a multiple of 1/100 of a second.

Short Exposure ( Less than 1 Row Time) (Regx0C)

To set the SI1300 to an integration time less than 1 row, the shutter width register 0x09 must first be set to 1. Shorter integration times are controlled by the shutter delay register 0x0C. The following formula shows how to calculate the of shutter delay for a desired sub-row integration time:

fclk = 48MHzWin_width = 1279Win_height = 1023Desired integration time, Tint = 15us ( equivalent to 0.472 x row_time )

Silicon Imaging , Inc. 2004 Page 30 of 56 Company Confidential

Page 31: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

Below is a table describing the maximum and minimum limitations of shutter width register exposure control for various pixel readout frequency and frame rates:

Exposure Time Table

Shutter WidthReg 0x09 [rows]

Exposure time [ms]24 MHz pixel clock

Exposure Time [ms]12 MHz pixel clock

1 (minimum) 0.056 0.112

2 0.120 0.239

16 1.01 2.02

64 4.06 8.12

512 32.5 65.0

1049 (default) 66.6 133

2098 133 266

4196 266 533

16383 (maximum) 1040 2080

The table below shows examples of fine exposure control for short exposure settings:

Fine Exposure Control Table

Shutter Width Reg 0x09 [rows]

Shutter Delay Reg0x0C

[pixel clocks]

Exposure Time [us]48MHz

pixel clock

1 (minimum) 0 (minimum) 28.001 1 27.921 2 27.831 3 27.67--- --- ------ --- ---1 242 7.8331 243 (maximum) 7.750 (minimum exp)

The fine exposure table shows that the minimum integration time possible using the SI1300 with default 1280x1024 readout at 48MHz is 7.75us.

API FUNCTION:

SI_SetShutterDelay (int iCamID, int iShutterDelay)

Silicon Imaging , Inc. 2004 Page 31 of 56 Company Confidential

Page 32: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

Window Programming – Image Size & PositionTo place a 640 x 480 window in the middle of the sensor,

Reg 01 xxxx Set BEGIN_ROW to 256+12 (0x020Ch)Reg 02 xxxx Set BEGIN_COLUMN 320+14 (0x014eh)Reg 03 xxxx Set HEIGHT to (480 – 1) = 479 (0x01DFh)Reg 04 xxxx Set WIDTH to (640– 1) = 639 (0x027Fh)

As shown in the adjacent picture, registers 3 and 4 set the size of the display window. Register 2 sets the column start location and registers 1 and 1 set the row start location. Column and Row end do not need to be entered as they are the sum of the start and size of the window.

Note: other custom commands can be used to move the window at high speeds – please consult the factory.

Register Name Default Description

0x01 Row Start 0x000C (12)

(First row to be read out + 12)

0x02 Column Start 0x0014(20)

(First column to be read out + 14)Register value must be an even number.

0x03 Window Height 0x03FF(1023)

Window height (number of rows - 1)Min = 0x0002.

0x04 Window Width 0x04FF(1279)

Window width (number of columns - 1) Register value must be an odd number.Min = 0x0003

The following table shows frame rates of typical image formats and pixel clock frequencies. This table assumes that the shutter width register 0x09 is set to the number of rows in the image format + 25 rows for vertical blanking. Note that it is possible to fine tune the desired frame rate by adjusting the horizontal blank register 0x05, vertical blank register 0x06, and the shutter delay register 0x0C:

Maximum Frame Rates For Typical Pixel Clocks and Image Output Formats

Pixel Clock [MHz]

1280x1024 (SXGA)

[fps]

640x480 (VGA)[fps]

320x240(QVGA)

[fps]40 24.6 44 160

API FUNCTION:

SI_InitWindowMode (int iCamID, int iStartRow, int iEndRow, int iStartColumn, int iEndColumn, int iFrameTime, int iExposureTime)SI_SetRowStartEnd (int iCamID, int iStartRow, int iEndRow) SI_SetColStartEnd (int iCamID, int iStartColumn, iEndColumn) SI_SetWindowPosition (int iCamID, int iStartRow, int iStartColumn)SI_SetWindowPositionExposure (int iCamID, int iStartRow, int iStartColumn, int iExposureTime)

Silicon Imaging , Inc. 2004 Page 32 of 56 Company Confidential

Page 33: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

SubSampling / View-finder ModesThe SI1300 has several view-finder modes that skip rows and columns of data to allow readout of smaller amounts of image data without sacrificing scene content. The following view-finder modes are available:

Mode Default (no skip)

Skip 2 Columns

Skip 4 Columns

Skip 8 Columns

Default (no skip) 1280x1024 640x1024 320x1024 160x1024Skip 2 Row 1280x512 640x512 320x512 160x512Skip 4 Rows 1280x256 640x256 320x256 160x256Skip 8 Rows 1280x128 640x128 320x128 160x128

Note: Imager frame rate is increased for view-finder modes. Horizontal and vertical blank registers may be increased to adjust the frame rate to desired rate.

Example: 320x256 preview mode

API FUNCTION:

SI_SetSubsampleMode (int iCamID, int iSubSampMode)

Silicon Imaging , Inc. 2004 Page 33 of 56 Company Confidential

Page 34: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

GAIN CONTROL (Reg 2B, 2C, 2D, 2E, 35)The SI1300 contains manual analog gain controls for each color channel (G1, G2, R, B). Gain values may be set using the following registers: G1 = 0x2B [6..0], G2 = 0x2E [6..0], R = 0x2D [6..0], and B = 0x2C [6..0]. In addition, the SI1300 contains a global gain register, 0x35 [6..0], that applies the gain value to all gain channels (G1, G2, R ,B ). When the global gain register is read it returns only the gain setting from the Green 1 channel register 0x2B.

0x2B Green1 Gain 0x0008 (8)1x gain.

Gain Increments Settings1.000 to 4.000 0.125 0x08 to 0x204.25 to 8.00 0.25 0x51 to 0x60

9.0 to 15.0 1.0 0x61 to 0x67 Formula for gain setting:

Gain ≤8 Gain = (bit[6] + 1) x (bit[5-0] x 0.125)Gain > 8 (bit[6] = 1 and bit[5] = 1)

Gain = 8.0 + bit[2-0]

0x2C Blue Gain 0x0008 (8)1x gain.

0x2D Red Gain 0x0008 (8) 1x gain.

0x2E Green2 Gain 0x0008 (8) 1x gain.

0x35 Global Gain 0x0008 (8)1x gain.

This register can be used to set all four gains at once. When read, it will return the value stored in Reg0x2B.

API FUNCTION:

SI_SetGlobalGain (int iCamID, int iGain)SI_SetGlobalGainB (int iCamID, int iGainIndex)SI_GetGainString((int iCamID, int iGainIndex, char** cGain)SI_SetRGBGain(int iCamID, int iRedGain, int iGreenGain, int iBlueGain)SI_SetRGGBGain(int iCamID, int iRedGain, int iGreenGain1, int iGreenGain2, int iBlueGain)SI_SetRGBGainB(int iCamID, int iRedGainIndex, int iGreenGainIndex, int iBlueGainIndex)

GAIN INDEX SI13001 1.0002 1.1253 1.2504 1.3755 1.5006 1.6257 1.7508 1.8759 2.000

10 2.12511 2.25012 2.37513 2.50014 2.62515 2.75016 2.87517 3.00018 3.12519 3.25020 3.375

Silicon Imaging , Inc. 2004 Page 34 of 56 Company Confidential

Page 35: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

The table below shows recommended gain register settings and corresponding gain values:

Register Setting (0x2B, 0x2C, 0x2D, 0x2E, 0x35) Gain Register Setting (0x2B,

0x2C, 0x2D, 0x2E, 0x35) Gain

Decimal Hex Gain Gain [dB] Decimal Hex Gain Gain [dB]8 0x08 1 0 32 0x20 4 12.09 0x09 1.125 1.0 81 0x51 4.25 12.6

10 0x0A 1.25 1.9 82 0x52 4.5 13.111 0x0B 1.375 2.8 83 0x53 4.75 13.512 0x0C 1.5 3.5 84 0x54 5 14.013 0X0D 1.625 4.2 85 0x55 5.25 14.414 0x0E 1.75 4.9 86 0x56 5.5 14.815 0x0F 1.875 5.5 87 0x57 5.75 15.216 0x10 2 6.0 88 0x58 6 15.617 0x11 2.125 6.5 89 0x59 6.25 15.918 0x12 2.25 7.0 90 0x5A 6.5 16.319 0x13 2.375 7.5 91 0x5B 6.75 16.620 0x14 2.5 8.0 92 0x5C 7 16.921 0x15 2.625 8.4 93 0x5D 7.25 17.222 0x16 2.75 8.8 94 0x5E 7.5 17.523 0x17 2.875 9.2 95 0x5F 7.75 17.824 0x18 3 9.5 96 0x60 8 18.125 0x19 3.125 9.9 97 0x61 9 19.126 0x1A 3.25 10.2 98 0x62 10 20.027 0x1B 3.375 10.6 99 0x63 11 20.828 0x1C 3.5 10.9 100 0x64 12 21.629 0x1D 3.625 11.2 101 0x65 13 22.330 0x1E 3.75 11.5 102 0x66 14 22.931 0x1F 3.875 11.8 103 0x67 15 23.5

Silicon Imaging , Inc. 2004 Page 35 of 56 Company Confidential

Page 36: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

SI USB2.0 DIRECT API FUNCTIONS

USB COMMANDSSI_OpenCamera (int iCamID, PCHAR devname)SI_CloseCamera (int iCamID)

INITIALIZE CAMERA SETTINGSSI_InitWindowMode (int iCamID, int iStartRow, int iEndRow, int iStartColumn, int iEndColumn, int iFrameTime, int iExposureTime)

IMAGE TRANSFERSI_SnapBulkImage (int iCamID, int iColumns, int iRows, int iPixelDepth, unsigned char* ImageBuffer, int* iBytesRead)SI_SetImageBuffers (int iCamID, unsigned char* pBuffer1, unsigned char* pBuffer2)SI_SnapBulkDoubleBuffer (int iCamID, int iColumns, int iRows, int iPixelDepth, int iCaptureBuffer, HANDLE hEvent, int* iBytesRead)SI_SnapBulkLiveStart(int iCamID, int iColumns, int iRows, int iPixelDepth, int iSequenceCount, unsigned char* ImageBuffer, HANDLE hEvent1, HANDLE hEvent2, HANDLE hEvent3)SI_SnapBulkLiveStop(int iCamID))

GENERIC CAMERA REGISTER COMMANDSI_TransferControlData (int iCamID, int iVendorRequestCode, int iIndex, int iValue, int iDirection, int iBufferSize, unsigned char* buffer)

EXPOSURE & GAINSI_SetExposureValue (int iCamID, int iExposure) SI_SetGlobalGain (int iCamID, int iGain)SI_SetGlobalGainB (int iCamID, int iGainIndex)SI_GetGainString((int iCamID, int iGainIndex, char** cGain)SI_SetRGBGain(int iCamID, int iRedGain, int iGreenGain, int iBlueGain)SI_SetRGGBGain(int iCamID, int iRedGain, int iGreenGain1, int iGreenGain2, int iBlueGain)SI_SetRGBGainB(int iCamID, int iRedGainIndex, int iGreenGainIndex, int iBlueGainIndex)SI_SetBlackOffset (int iCamID, int iBlackOffset)SI_SetADC (int iCamID, int iADC)SI_SetGPIO (int iCamID, int iIONumber, int iStatus)SI_SetShutterDelay (int iCamID, int iShutterDelay)

CLOCKSI_ReadClockFile(char* cCamClockFile, int* iClockTableSize, CLOCKSETTING* ClockSettings)SI_SetClock ( int iCamID, int iCamClockMode, CLOCKSETTING* ClockSettings)SI_SetClockB ( int iCamID, int iClockIndex)SI_ReadStatusClock (int iCamID, int* iStatus, int* iClock)

WINDOW SIZE, POSITION & FRAME TIMESI_SetFrameTime (int iCamID, int iFrameTime) SI_SetRowStartEnd (int iCamID, int iStartRow, int iEndRow) SI_SetColStartEnd (int iCamID, int iStartColumn, iEndColumn) SI_SetWindowPosition (int iCamID, int iStartRow, int iStartColumn)SI_SetWindowPositionExposure (int iCamID, int iStartRow, int iStartColumn, int iExposureTime)SI_SetVerticalBlanking(int( iCamID, int iVertBlanking);SI_SetHorizontalBlanking(int( iCamID, int iVertBlanking);

BIT-DEPTH & SUBSAMPLINGSI_SetSubsampleMode (int iCamID, int iSubSampMode)SI_SetPixelDepth (int iCamID, int iPixelDepth)

FIRMWARE & PRESETSSI_ReadSerialNumber (int iCamID, char* cCamSerialNumber)SI_ReadVersion (int iCamID, char* cCamVersion)SI_TransferFirmware(int iCamID, char* cFirmwareFile, int iDirection)

Silicon Imaging , Inc. 2004 Page 36 of 56 Company Confidential

Page 37: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

Snap & Live Mode CaptureThere are two methods by which image data can be retrieved from a Silicon Imaging USB camera: Snap Mode & Live Mode. The snap mode is the simplest method to capture an image from the camera. The live mode is used for continuous image capture for live display or high-speed sequence capture.

Snap Mode

The first method, which we will call “Snap Mode”, typically involves use of the SI_SnapBulkImage() function. to retrieve one image from the camera and transfer it into a buffer created at the application level. For this method, application level interaction is required to request every image captured. This is ideal for hardware-triggered or software initiated events. The camera may be placed in a stopped or non-scanning mode with a the optional (-T) Trigger model, by issuing the command SI_ArmTriggerWait(). Once the trigger event occurs, the snap command is sent to the camera to initiate exposure and perform readout. The function returns to the application layer with the image buffer filled with new data. The captured image is typically processed and displayed in a GUI application. The process is then repeated, often as a single threaded application.

Sample:

int result;BYTE commandClock[3] = {0x37, 0xCB, 0x8F}; // clock settings for 30 MHzint iColumns, iRows, iSize, iPixelDepth, iBytesRead;char driver[8] = "ezusb-0";unsigned char* ImageBuffer;

iRows = 512; iColumns = 512; iPixelDepth = 8; iSize = iRows * iColumns; // open camera result = SI_OpenCamera (0, driver); // camera 0 if (SI_STATUS_SUCCESS != result) return result;

ImageBuffer = (unsigned char *) malloc(iSize);

// set image size in camera SI_InitWindowMode(0, 0, iRows , 0, iColumns, 0, 0);

// set clock SI_TransferControlData(0, 0xE2, 0, 0, 0, 3, commandClock);

// Wait for External TTL trigger SI_ArmTriggerWait(1);

// snap single image result = SI_SnapBulkImage(0, iColumns, iRows, iPixelDepth, image, &iBytesRead);

if (SI_STATUS_SUCCESS != result) return result;

// free memory free(pImageBuffer1);

// close camera SI_CloseCamera(0);

Silicon Imaging , Inc. 2004 Page 37 of 56 Company Confidential

Page 38: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

The minimum delay between the completion of one capture and the initiation of another capture at the camera level is unknown in a Windows programming environment and might vary from 1-3 ms. Therefore, in a continuous capture operation with fixed timing between frame (vertical blanking) to allow for the variations, the maximum consistent frame rate will be limited by the maximum time delay or vertical blanking. For example, If the readout of a frame takes 30msec and the maximum delay which may occur is 3msec until the next frame begin can be initiated, the frame time must be set to 33msec (30 + 3msec) to maintain smooth continuous motion video.

If the application is delayed in its request beyond the 3 msec vertical blanking delay, the next frame will internally scan inside the camera, but will not be transferred out to the host. This is done maintain consistent frame-to-frame timing and correct exposure in rolling shutter operation. The image cannot start in the middle of the frame, so the next image starting at the top of frame will be transferred to complete the snap request.

Live Mode

With the second method, which we call “Live Mode” can be used to capture continuously or for a specified number of images by the camera driver without any user level application intervention.

The functions SI_SnapBulkLiveStart and SI_SnapBulkLiveStop are the primary functions employed for this method.

Key Functions for Live Mode:

SI_SnapBulkLiveStart (int iCamID, int iColumns, int iRows, int iSequenceNumber, unsigned char* ImageBuffer, HANDLE hEvent1, HANDLE hEvent2, HANDLE hEvent3)

SI_SnapBulkLiveStop (int iCamID)

These functions are documented in greater detail in the API User’s Manual

Note: All Silicon Imaging USB cameras support live mode with the exception of the SI3170.

Silicon Imaging , Inc. 2004 Page 38 of 56 Company Confidential

30msec (3) 30msec (3) 30msec (3) 30msec (3) 30msec (3)

NOXFER

SNAP

Page 39: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

High-level Description of Continuous Live Mode

Continuous live mode is illustrated in the diagram below. The application creates a buffer which is twice the size of a modulo 512 single image. If the image is monochrome and 1024 x 768 in size, the total buffer size would be 2 x 1024 x 768 or 1572864 bytes since the image size is already modulo 512 (if the image size is not modulo 512, it should be increased to the next multiple of 512). Thus each of the halves of this buffer (Buffer 1 and Buffer 2) will contain one image. If the mode is color the size of the overall buffer should be doubled.

After the usual control functions are called such as SI_InitWindowMode, the continuous capture process is initiated by a call to SI_SnapBulkLiveStart with the iSequenceCount parameter set to zero. Prior to this call, the application will have created the two events for notification (event1 and event2). SI_SnapBulkLiveStart will not return to the user until the continous capture process is terminated (see below).

The first captured image will be transferred into Buffer 1 and Event1 set immediately after that transfer is completed. At this point display and processing can be done from Buffer 1 while the second image is captured into Buffer 2. Event2 is set immediately upon the fill of Buffer 2. The process continues by alternating the fill and setting of events between Buffers 1 and 2. If processing and display on one buffer is not completed prior to the other buffer being filled, the camera will simply start writing over the buffer that you are working with. Thus the capture of any image cannot held up from the application level. If the capture rate will exceed the display and processing rate the user should use the single snap function SI_SnapBulkImage which initiates a capture with every call from the application level.

Silicon Imaging , Inc. 2004 Page 39 of 56 Company Confidential

Buffer 1

SIUSB.DLL User Level

Silicon ImagingCamera USB Driver

ezusb.sys

Kernel Level

SiliconImaging Camera

Buffer 2

Image DataControl Data

Page 40: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

Typically, the function SI_SnapBulkLiveStart will be called from a separate thread created from a main thread. To stop the continuous live capture process, the user should call SI_SnapBulkLiveStop from the main or another thread. The capture process will then terminate when the current image is finished being captured. At that point, SI_SnapBulkLiveStart will return to the user.

High-level Description of Sequenced Live Mode

Sequenced live mode is employed when the user wishes to capture a finite sequence of images at the highest possible speed rate. As with continuous mode, the user will call SI_SnapBulkLiveStart with the iSequenceCount parameter set to the number of images “N” to be sequentially captured. Instead of a buffer large enough to hold two images with continuous mode, the user should size the buffer to accommodate N images. The capture will transfer the N images into the contiguous buffer at the appropriate point, (e.g. the third image would start filling at a pointer position of twice the image size plus one).

The arguments for the events should be set to NULL as there is no notification with this mode. The SI_SnapBulkLiveStart function will return as soon asall the n images are captured and transferred. At this point the user can display and process all of the images.

Silicon Imaging , Inc. 2004 Page 40 of 56 Company Confidential

Buffer 1

SIUSB.DLL User Level

Silicon ImagingCamera USB Driver

(ezusb.sys)

Kernel Level

SiliconImaging Camera

Image DataControl Data

BufferN

Page 41: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

Example of Continuous Live Mode

This code sample shows a sample control function and associated threads for the actual capture and display.

void CSI004Doc::OnActionLiveStart() // main controlling function{

if(!InitCapture()) return;

m_bStopLiveFlag = 0;SI_InitWindowMode(0, 0, m_Height - 1, 0, m_Width - 1, 0, 2000);

m_hEvent1 = ::CreateEvent(NULL, FALSE, FALSE, NULL);m_hEvent2 = ::CreateEvent(NULL, FALSE, FALSE, NULL);

m_hEvent3 = ::CreateEvent(NULL, FALSE, FALSE, NULL); m_hLiveThread = ::CreateThread(NULL,0,LiveThreadFunc,this,CREATE_SUSPENDED,NULL);

m_hLiveDisplayThread = ::CreateThread(NULL,0,LiveDisplayThreadFunc,this,CREATE_SUSPENDED,NULL);

::ResumeThread(m_hLiveThread);::ResumeThread(m_hLiveDisplayThread);

. .SI_SnapBulkLiveStop(0);::CloseHandle(m_hEvent1);::CloseHandle(m_hEvent2);

::CloseHandle(m_hEvent3);::CloseHandle(m_hLiveThread);::CloseHandle(m_hLiveDisplayThread);

return;

}

DWORD WINAPI CSI004Doc::LiveThreadFunc(LPVOID pParam) // capture thread{

CSI004Doc * pDoc = static_cast<CSI004Doc*>(pParam);int sts;

int iSize = 2 * iDepth * (pDoc->m_Width * pDoc->m_Height); // for mono pDoc->pDBuffer2 = new BYTE[iSize];

// initiate continuous capture – thread is heldsts = SI_SnapBulkLiveStart(0, pDoc->m_Width, pDoc->m_Height, 8,

pDoc->pDBuffer2, 0, pDoc->m_hEvent1, pDoc->m_hEvent2, pDoc->m_hEvent3 );

if (sts != SI_STATUS_SUCCESS)AfxMessageBox("continuous capture error");

delete [](pDoc->pDBuffer2);

return 0;

}

Silicon Imaging , Inc. 2004 Page 41 of 56 Company Confidential

Page 42: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

DWORD WINAPI CSI004Doc::LiveDisplayThreadFunc (LPVOID pParam) // display thread{

int iBuffer, ret;HANDLE hEventArray[3];CSI004Doc * pDoc = static_cast<CSI004Doc*>(pParam);hEventArray[0] = pDoc->m_hEvent1;hEventArray[1] = pDoc->m_hEvent2;hEventArray[2] = pDoc->m_hEvent3;

CSI004Doc * pDoc = static_cast<CSI004Doc*>(pParam);

// Prepare the Bitmap data structure for display here...

while (!pDoc->m_bStopLiveFlag){

.

.

.

// wait for any event to come inret = WaitForMultipleObjects(3, hEventArray, FALSE, 20000);

if ((ret - WAIT_OBJECT_0) == 0){TRACE("buffer 0 captured\n");}else if ((ret - WAIT_OBJECT_0) == 1){TRACE("buffer 1 captured\n");}else{TRACE("short image captured\n");}

// display appropriate buffer here...

}delete [] pBmi;return 0;

Silicon Imaging , Inc. 2004 Page 42 of 56 Company Confidential

Page 43: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

Example of Sequenced Live Mode

Description

This code sample demonstrates sequenced live mode.

Sample Code:

void CSI004Doc::OnActionSequencedLiveStart(){

if(!InitCapture()) return

// allocate sequence of buffers

int iSize = iDepth * m_Width * m_Height * m_SnapCount;

PBYTE pBuffer = new BYTE[iSize];

// Prepare the Bitmap data structure for display here..

// start sequence capture// hEvent1 is set after each image in the sequence is captured// if an image is short hEvent3 is setsts = SI_SnapBulkLiveStart(0, m_Width , m_Height, 8, pBuffer, m_SnapCount, hEvent1, NULL,

hEvent3);

if (sts != SI_STATUS_SUCCESS)

AfxMessageBox("capture sequence error");

for (int j = 0; j < m_SnapCount; j++){

display all images sequentially after all captures completed

.

.

. }

delete [] pBmi;delete [] pBuffer;

return;}

Silicon Imaging , Inc. 2004 Page 43 of 56 Company Confidential

Page 44: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

Binary to Hex (ASCII) TableBinary Hex in ASCII0000 00001 10010 20011 30100 40101 50110 60111 71000 81001 91010 a1011 b1100 c1101 d1110 e1111 f

Silicon Imaging , Inc. 2004 Page 44 of 56 Company Confidential

Page 45: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

FRONT VIEW

SENSOR PACKAGING

Silicon Imaging , Inc. 2004 Page 45 of 56 Company Confidential

Page 46: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

SI-1300 USB ENCLOSURE DIMENSIONS

Silicon Imaging , Inc. 2004 Page 46 of 56 Company Confidential

Page 47: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

SI-1300R Bottom View

Silicon Imaging , Inc. 2004 Page 47 of 56 Company Confidential

Page 48: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

SI-1300R Front View

Silicon Imaging , Inc. 2004 Page 48 of 56 Company Confidential

Page 49: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

SI-1300R Side View

Silicon Imaging , Inc. 2004 Page 49 of 56 Company Confidential

Page 50: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

SI-1300 Spectral Response Curve

Silicon Imaging , Inc. 2004 Page 50 of 56 Company Confidential

Page 51: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

SI1300-RGB Cover Glass Filter Response (IRC-30)

Silicon Imaging , Inc. 2004 Page 51 of 56 Company Confidential

Page 52: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

White Balance and Color Correction Application Note

1.0 Introduction

White Balance and Color Correction are processing operations performed to ensure proper color fidelity in a captured digital camera image. In digital cameras an array of light detectors with color filters over them is used to detect and capture the image. This sensor does not detect light exactly as the human eye does, and so some processing or correction of the detected image is necessary to ensure that the final image realistically represents the colors of the original scene.

Bayer color conversion and processing

This note describes conversions from Bayer format to RGB and between RGB and YUV (YCrCb) color spaces. We also discuss two color processing operations (white balance and color correction) in the RGB domain, and derive the corresponding operations in the YUV domain. Using derived operations in the YUV domain, one can perform white balance and color correction directly in the YUV domain, without switching back to the RGB domain.

1. Conversion from Bayer format to RGB

Bayer color filter array is a popular format for digital acquisition of color images [1]. The pattern of the color filters is shown below. Half of the total number of pixels are green (G), while a quarter of the total number is assigned to both red (R) and blue (B).

G R G RB G B GG R G RB G B G

To convert an image from this format to an RGB format, we need to interpolate the two missing color values in each pixel. Several standard interpolation methods (nearest neighbor, linear, cubic, cubic spline, etc.) were evaluated on this problem in [2]. The authors have measured interpolation accuracy as well as the speed of the method and concluded that the best performance is achieved by a correlation-adjusted version of the linear interpolation. The suggested method is presented here.

Silicon Imaging , Inc. 2004 Page 52 of 56 Company Confidential

Page 53: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

1.1 Interpolating red and blue components

G B GR G RG B G

(a)

G R GB G BG R G

(b)

B G BG R GB G B

(c)

R G RG B GR G R

(d)

Figure 1: Four possible cases for interpolating R and B components

As suggested in [2], R and B values are interpolated linearly from the nearest neighbors of the same color. There are four are possible cases, as shown in Figure 1. When interpolating the missing values of R and B on a green pixel, as in Figure 1 (a) and (b), we take the average values of the two nearest neighbors of the same color. For example, in Figure 1 (a), the value for the blue component on a shaded G pixel will be the average of the blue pixels above and below the G pixel, while the value for the red component will be the average of the two red pixels to the left and right of the G pixel.

Figure 1 (c) shows the case when the value of the blue component is to be interpolated for an R pixel. In such case, we take the average of the four nearest blue pixels cornering the R pixel. Similarly, to determine the value of the red component on a B pixel in Figure 2 (d) we take the average of the four nearest red pixels cornering the B pixel.

1.2 Interpolating the green component

By [2], green component is adaptively interpolated from a pair of nearest neighbors. To illustrate the procedure, consider two possible cases in Figure 2.

R1

G1

R4 G4 R G2 R2

G3

R3

(a)

B1

G1

B4 G4 B G2 B2

G3

B3

(b)

Figure 2: Two possible cases for interpolating G component

In Figure 2 (a), the value of the green component is to be interpolated on an R pixel. The value used for the G component here is

In other words, we take into account the correlation in the red component to adapt the interpolation method. If the difference between R1 and R3 is smaller than the difference between R2 and R4, indicating that the correlation is stronger in the vertical direction, we use the average of the vertical neighbors G1 and G3 to interpolate the required value. If the horizontal correlation is larger, we use horizontal neighbors. If neither direction dominates the correlation, we use all four neighbors.

Similarly, for Figure 2 (b) we will have

Silicon Imaging , Inc. 2004 Page 53 of 56 Company Confidential

Page 54: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

To conclude this section, note that if the speed of execution is the issue, one can safely use simple linear interpolation of the green component from the four nearest neighbors, without any adaptation

According to [2], this method of interpolation executes twice as fast as the adaptive method, and achieves only slightly worse performance on real images, while it is actually better than the adaptive method when applied to synthetic images.

2. Conversion between RGB and YUV

We give two commonly used forms of equations for conversion between RGB and YUV formats. The first one is recommended by CCIR [3]

(2.1)

The second form is used by Intel in their image processing library [4], and may be more suitable for implementation:

(2.2)

In either case, resulting values of Y, U and V should be clipped to fit the appropriate range for the YUV format (e.g. [0,255] for a 24-bit YUV format). The inverse conversion may be accomplished by:

(2.3)

3. White balance operation in RGB and YUV domains

The white balance operation is defined as a gain correction for red, green and blue components by gain factors AR, AG and AB, respectively, i.e.

(3.1)

The new (white-balanced) values for red, green and blue are Rwb, Gwb and Bwb. To derive the equivalent form of this operation in the YUV domain, we proceed as follows. First, write equation (2.1) as

(3.2)

Silicon Imaging , Inc. 2004 Page 54 of 56 Company Confidential

Page 55: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

where is the vector in the RGB space, is the corresponding vector in the YUV space, , and C is the appropriate matrix of conversion coefficients. Similarly, (3.1) can be written as

(3.3)

where is the vector in the RGB space modified by white balance operation (2.4), and

. We want to determine what is the corresponding vector in the YUV domain, without

having to revert back to the RGB domain. Vector is found by substituting for x in (3.2).

Let , so that . Then . Substitute this expression for x back into (3.2) to obtain

(3.4)

This equation provides the connection between y and without involving x or (i.e. without going back to

the RGB domain). Manipulating (3.4) and using the fact that for nonsingular matrices [5], we get that white balance operation in the YUV domain is

(3.5)

Expressing components of from (3.5) we get

Terms with leading coefficient less than 103 have been dropped.

References

[1] B. E. Bayer, Color imaging array, US Patent No. 3971065.[2] T. Sakamoto, C. Nakanishi and T. Hase, “Software pixel interpolation for digital still cameras suitable for a 32-

bit MCU,” IEEE Trans. Consumer Electronics, vol. 44, no. 4, November 1998.{3} http://www.northpoleengineering.com/rgb2yuv.htm

Silicon Imaging , Inc. 2004 Page 55 of 56 Company Confidential

Page 56: USB2 Manual... · Web viewSI-1300 MegaCamera(1.3 Million Pixel Progressive Scan Digital Camera Revision 1.2 August 3, 2004 1.3 Million Pixels 1280 x 1024 Image Sensor 5.2 um Square

Contact Information

Silicon Imaging, Inc.www.siliconimaging.com

[email protected]

Ordering Information

SI-1300U -M or -RGB 1.3 Megapixel USB2.0 Camera, M=Monochrome, RGB= Bayer Color-PCB or -R PCB (33x40mm) or ‘R’ Round (27mm) Version of Camera. No housing included.-T External Trigger & strobe with 3-Pin Connection and Trigger/Strobe Breakout Cable-X External Clock-In & Clock out camera. Must be ordered as a Master-Slave configurationCBL-3PT Cable, 3Pin Tajimi to TTL Trigger-In & Strobe Out

Legal DisclaimerSilicon Imaging reserves the right to make changes to its products or to discontinue any product or service without notice, and advises customers to obtain the latest version of relevant information to verify, before placing orders, that information being relied on is current and complete. No license, express or implied to any intellectual property rights is granted by this document.

Specific testing of all parameters of each device is not necessarily performed, except those mandated by government requirements.

CERTAIN APPLICATIONS USING SEMICONDUCTOR PRODUCTS MAY INVOLVE POTENTIAL RISKS OF DEATH, PERSONAL INJURY, OR SEVERE PROPERTY OR ENVIRONMENTAL DAMAGE ("CRITICAL APPLICATIONS"). SILICON IMAGING PRODUCTS ARE NOT DESIGNED, AUTHORIZED, OR WARRANTED TO BE SUITABLE FOR USE IN LIFE-SUPPORT DEVICES OR SYSTEMS OR OTHER CRITICAL APPLICATIONS. INCLUSION OF SILICON IMAGING PRODUCTS IN SUCH APPLICATIONS IS UNDERSTOOD TO BE FULLY AT THE CUSTOMER'S RISK.

The Product described in this datasheet may contain design defects or errors known as errata which may cause the product to deviate from published specifications. Current characterized errata are available upon request.

Copyright: Silicon Imaging, Inc., 2004

080304-Rev 1.2

Silicon Imaging , Inc. 2004 Page 56 of 56 Company Confidential


Recommended