Silicon Imaging
Silicon Imaging
SI-1300 MegaCamera(
1.3 Million Pixel Progressive Scan Digital Camera
[pic]
Revision 1.2
August 3, 2004
[pic] 1.3 Million Pixels
[pic] 1280 x 1024 Image Sensor
[pic] 5.2 um Square Pixel
[pic] ½ Optical format
[pic] Rolling Shutter
[pic] ½ & ¼ Image Subsampling
[pic] 10~40MHz Mhz Clock rates
[pic] 10 Bit Digital Sampling
[pic] Auto Black Level Correction
[pic] 64dB Dynamic Range
[pic] USB2.0 High-Speed Interface
**** Company Confidential ****
|SI-1300-M & RGB MegaCamera™ |
|1.3 Megapixel (1280 x 1024), 10-Bit Low-Noise, 40MHz |
|USB 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 |[pic] |
|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 |[pic] |
|highly integrated CMOS device, which incorporates Megapixel sensing areas, timing | |
|generation, signal processing and high bandwidth outputs, Silicon Imaging has developed |FEATURES |
|a very compact, low-power, ultra high speed Megapixel digital camera system. | |
| |· 1280 x 1024 Resolution (1.3 Million Pixels) |
|1280 x 1024 Megapixel - Ultra Resolution |· 1/2” Imaging Format, 5.2um Square Pixel |
|The SI-1300 is an all-digital CMOS camera that delivers 1.3 Million pixels of resolution|· Rolling Shutter, Progressive scan |
|and is capable of running at 30 frame/sec at 1024 x 1024 resolution and 25fps at its |· 120fps Windowing at 320 x 240 QVGA |
|full 1280x1024 resolution. The entire package is only 45 x 52 x 50mm (33 x 40mm x 22mm|· 10 Bits per Pixel, 35MHz Sampling (Nominal) |
|in PCB) and is small enough to placed on a robot for semiconductor machine vision |· 10 ~ 45MHz Programmable Clock |
|inspection or placed in an outdoor housing for remote surveillance. For handheld |· IR-Sensitivity & Low-dark Currents ( button.
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 Register
Index: 16 bits Camera Register
Length: 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.
Firmware Upload
This 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.
[pic]
After selecting the Upload Firmware menu option, you will select the newer version of firmware:
[pic]
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:
[pic]
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.
Image Save & Load
The operational screen should look like this:
[pic]
The file menu provides a method for opening image files, saving binary files and bitmaps.
[pic]
BLACK REFERENCE CORRECTION
In 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:
[pic]
Cover your lens and adjust Black Offset and Column offset to insure Black is in the digitizing range:
[pic]
From the Camera Tab (eg. SI1300), press the GRAB button and check the apply radio box.
[pic]
The image should now appear black:
[pic]
Uncover the lens and the picture will have a uniform background:
[pic]
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:
[pic]
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 bits
Value: 16 bits
Index: 16 bits
Length: 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.
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 device
iVendorRequestCode - vendor request code
iIndex – 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.
SI-1300 USB VENDOR CODES
|VR |Function |Value |Index |DIR |Buffer |Description |
| | | | | | | |
|0x94 |Write Register |xVVVV |xRRRR |1 |0 |0x00 |
| | | | | | |Chip ID |
| | |Value |Register | | | |
| | |To |To | | |0x01 |
| | |Write |Write | | |Row Start |
| | |Into | | | | |
| | |register | | | |0x02 |
| | | | | | |Column Start |
| | | | | | | |
| | | | | | |0x03 |
| | | | | | |Window Height |
| | | | | | | |
| | | | | | |0x04 |
| | | | | | |Window Width |
| | | | | | | |
| | | | | | |0x05 |
| | | | | | |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 |xRR |1 |2 |Read Register (16-bit) response |
| | | |Register | | | |
| | |0 |0 |1 |16 |Issue an IN transfer of Length 16 to Read Firmware |
|0xE1 |Read Firmware Version | | | | |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 |0x0000 |0 |32 |An OUT transfer of 16 is used for storage of 32 words |
| | | |to 0x00FF | | |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 |0 |0x0000 - |1 |32 |An IN transfer of 32 is used to read 16 words of 14bit |
| |(OUT) | |0x00FF | | |values. The Index field is used to address 256 blocks |
| |Note: This memory space is used in| | | | |(0xFF) of memory. The first byte and every odd byte |
| |firmware upgrades and will | | | | |contain only 6 usable bits. The Value field is |
| |overwrite any user data stored in | | | | |ignored. This command is read arbitrary data stored by |
| |this memory. | | | | |the Write Flash command. |
|0xE4 |Upgrade Firmware (IN) |CODE |0 |1 |4 |An IN request of Length 4 will expect a firmware |
| | | | | | |upgrade code (from factory) in the Value field (length |
| |WARNING! Please wait 30 seconds | | | | |16 bits – 4 hex). Index field ignored. If the CODE |
| |before unplugging the camera to | | | | |does not match, the returned 4 bytes will contain the |
| |allow the upgrade to complete. | | | | |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. |
SI-1300 Sensor Register Programming
Use 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 |(First column to be read out + 14) |
| | |(20) |Register value must be an even number. |
|0x03 |Window Height |0x03FF |Window height (number of rows - 1) |
| | |(1023) |Min = 0x0002. |
|0x04 |Window Width |0x04FF |Window width (number of columns - 1) |
| | |(1279) |Register value must be an odd number. |
| | | |Min = 0x0003 |
|0x05 |Horizontal Blanking |0x0013 |Number of extra row blanking clocks + 19 |
| | |(19) |Row 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 |0x0000 |Number of master clocks times four that the sensor waits before asserting the |
| |(Short Exposure) |(0) |reset for a given row. |
|0x1E |Subsampling |0x80xx |0 0 (do not change) |
| |& Snapshot Mode |(x8000) |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 |0x11xx |0 No bad frames: 0 (default) = only good frames, 1 = all frames |
| |& Scan Reversal |(0x1104) |1 0 (do not change) |
| | | |2 1 (do not change) |
| | | |3 Column skip2: 0= normal readout (default), 1= skip by 2 |
| | | |4 Row skip2: 0 = normal readout (default), 1= skip by 2 |
| | | |5 0 (do not change) |
| | | |6 0 (do not change) |
| | | |7 Flip Row: 0 = normal, 1= Scan reversal |
| | | |8 1 (do not change) |
|0x2B |Green1 Gain |0x0008 (8) | |
| | |1x gain. | |
| | | |Gain Increments Settings |
| | | |1.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) |This register can be used to set all four gains at once. When read, it will return|
| | |1x gain. |the value stored in Reg0x2B. |
Digital Clock Synthesizer Programming
The 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 |Function |Value |Index |DIR |Buffer |Description |
|Code | |16bits |16 bits | | | |
|0xE2 |Set Clock |0 |0 |0 |3 |An OUT transfer with a length of 3 sets the clock |
| | | | | | |frequency. The Index and Value fields are ignored. |
| |The pixel clock rate of the SI1280| | | | |The following table is a list of 3 byte hex strings |
| |is the same as the programmed | | | | |and clock values. |
| |rate. Therefore, 30MHz will be | | | | | |
| |equal to 30MP/s. | | | | |10 MHz |
| | | | | | |30688E |
| | | | | | | |
| |Warning: | | | | |15MHz |
| |The maximum clock rate speed | | | | |328E90 |
| |allowed will be dependant on the | | | | | |
| |image size, bit depth settings and| | | | |20 MHz |
| |the sustained throughput on the | | | | |306886 |
| |USB host controller. | | | | | |
| | | | | | |25MHz |
| | | | | | |30B689 |
| | | | | | | |
| | | | | | |30MHz |
| | | | | | |37CB8F |
| | | | | | | |
| | | | | | |35MHz |
| | | | | | |35D40B |
| | | | | | | |
| | | | | | |40 MHz |
| | | | | | |306882 |
| | | | | | | |
| | | | | | |45 MHz |
| | | | | | |35E709 |
| | | | | | | |
| | | | | | |50 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)
|Index |Clock Rate |
| |(Mhz) |
|0 |7 |
|1 |8 |
|2 |9 |
|3 |10 |
|4 |15 |
|5 |20 |
|6 |25 |
|7 |30 |
|8 |35 |
|9 |40 |
|10 |45 |
|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_Time |
|1,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 |
| |
[pic]
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 106 = 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.
Frame Timing Registers
|Register |Name |Default |Description |
|0x03 |Window Height |0x03FF |Window height (number of rows - 1) |
| | |(1023) |Min = 0x0002. |
|0x04 |Window Width |0x04FF |Window width (number of columns - 1) |
| | |(1279) |Register value must be an odd number. |
| | | |Min = 0x0003 |
|0x05 |Horizontal Blanking |0x0013 |Number of extra row blanking clocks + 19 |
| | |(19) |Row 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);
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) + 1
Column Skip 4 => Reg04eff = (int(Regx04 / 8) x 2) + 1
Column 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 = 48MHz
Win_width = 1279
Win_height = 1023
Desired integration time, Tint = 15us ( equivalent to 0.472 x row_time )
[pic]
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 Width |Exposure time [ms] |Exposure Time [ms] |
|Reg 0x09 [rows] |24 MHz pixel clock |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 |Shutter Delay |Exposure Time [us] |
|Reg 0x09 |Reg0x0C |48MHz |
|[rows] |[pixel clocks] |pixel clock |
|1 (minimum) |0 (minimum) |28.00 |
|1 |1 |27.92 |
|1 |2 |27.83 |
|1 |3 |27.67 |
|--- |--- |--- |
|--- |--- |--- |
|1 |242 |7.833 |
|1 |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)
Window Programming – Image Size & Position
To 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 |(First column to be read out + 14) |
| | |(20) |Register value must be an even number. |
|0x03 |Window Height |0x03FF |Window height (number of rows - 1) |
| | |(1023) |Min = 0x0002. |
|0x04 |Window Width |0x04FF |Window width (number of columns - 1) |
| | |(1279) |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) |640x480 |320x240 |
| |[fps] |(VGA) |(QVGA) |
| | |[fps] |[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)
SubSampling / View-finder Modes
The 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 |Skip 2 Columns |Skip 4 Columns |Skip 8 Columns |
| |(no skip) | | | |
|Default (no skip) |1280x1024 |640x1024 |320x1024 |160x1024 |
|Skip 2 Row |1280x512 |640x512 |320x512 |160x512 |
|Skip 4 Rows |1280x256 |640x256 |320x256 |160x256 |
|Skip 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
[pic]
API FUNCTION:
SI_SetSubsampleMode (int iCamID, int iSubSampMode)
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) | Gain Increments Settings |
| | |1x gain. |1.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 |
| | | |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) |This register can be used to set all four gains at once. When read, it will |
| | |1x gain. |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 |SI1300 |
|1 |1.000 |
|2 |1.125 |
|3 |1.250 |
|4 |1.375 |
|5 |1.500 |
|6 |1.625 |
|7 |1.750 |
|8 |1.875 |
|9 |2.000 |
|10 |2.125 |
|11 |2.250 |
|12 |2.375 |
|13 |2.500 |
|14 |2.625 |
|15 |2.750 |
|16 |2.875 |
|17 |3.000 |
|18 |3.125 |
|19 |3.250 |
|20 |3.375 |
The table below shows recommended gain register settings and corresponding gain values:
|Register Setting (0x2B, 0x2C, 0x2D, |Gain | |Register Setting (0x2B, 0x2C, 0x2D, |Gain |
|0x2E, 0x35) | | |0x2E, 0x35) | |
|Decimal |Hex |
|0000 |0 |
|0001 |1 |
|0010 |2 |
|0011 |3 |
|0100 |4 |
|0101 |5 |
|0110 |6 |
|0111 |7 |
|1000 |8 |
|1001 |9 |
|1010 |a |
|1011 |b |
|1100 |c |
|1101 |d |
|1110 |e |
|1111 |f |
FRONT VIEW
[pic]
SENSOR PACKAGING
[pic]
SI-1300 USB ENCLOSURE DIMENSIONS
[pic][pic]
SI-1300R Bottom View
[pic]
[pic]
SI-1300R Front View
[pic]
SI-1300R Side View
[pic]
SI-1300 Spectral Response Curve
[pic]
[pic]
SI1300-RGB Cover Glass Filter Response (IRC-30)
[pic]
White Balance and Color Correction
Application Note
1. 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.
[pic]
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 |R |
|B |G |B |G |
|G |R |G |R |
|B |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.
1.1 Interpolating red and blue components
|G |G |
|B |R |
|G |G |
| | |
|R |B |
|G |G |
|R |B |
| | |
|G |G |
|B |R |
|G |G |
| | |
|(a) |(b) |
|B |R |
|G |G |
|B |R |
| | |
|G |G |
|R |B |
|G |G |
| | |
|B |R |
|G |G |
|B |R |
| | |
|(c) |(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 |B1 |
| | |
| | |
| | |
| | |
| | |
|G1 |G1 |
| | |
| | |
| | |
|R4 |B4 |
|G4 |G4 |
|R |B |
|G2 |G2 |
|R2 |B2 |
| | |
| | |
| | |
|G3 |G3 |
| | |
| | |
| | |
| | |
| | |
|R3 |B3 |
| | |
| | |
| | |
|(a) |(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
[pic]
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
[pic]
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
[pic]
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)
where [pic] is the vector in the RGB space, [pic] is the corresponding vector in the YUV space, [pic], and C is the appropriate matrix of conversion coefficients. Similarly, (3.1) can be written as
(3.3)
where [pic] is the vector in the RGB space modified by white balance operation (2.4), and [pic]. We want to determine what is the corresponding vector [pic]in the YUV domain, without having to revert back to the RGB domain. Vector [pic] is found by substituting [pic] for x in (3.2)
[pic].
Let [pic], so that [pic]. Then [pic]. Substitute this expression for x back into (3.2) to obtain
(3.4)
This equation provides the connection between y and [pic] without involving x or [pic] (i.e. without going back to the RGB domain). Manipulating (3.4) and using the fact that for nonsingular matrices [pic] [5], we get that white balance operation in the YUV domain is
(3.5)
Expressing components of [pic] from (3.5) we get
[pic]
Terms with leading coefficient less than 10(3 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}
Contact Information
Silicon Imaging, Inc.
sales@
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 configuration |
|CBL-3PT |Cable, 3Pin Tajimi to TTL Trigger-In & Strobe Out |
Legal Disclaimer
Silicon 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
-----------------------
[pic]
[pic]
[pic]
[pic]
[pic]
[pic]
[pic]
[pic]
[pic]
[pic]
[pic]
SNAP
NO
XFER
30msec (3) 30msec (3) 30msec (3) 30msec (3) 30msec (3)
Buffer 1
SIUSB.DLL
User Level
Silicon Imaging
Camera USB Driver
ezusb.sys
Kernel Level
Silicon
Imaging Camera
Buffer 2
Image Data
Control Data
Buffer
1
SIUSB.DLL
User Level
Silicon Imaging
Camera USB Driver
(ezusb.sys)
Kernel Level
Silicon
Imaging Camera
Image Data
Control Data
Buffer
N
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related searches
- advent health imaging lake underhill
- imaging cpt codes list
- mri imaging parameters
- mri imaging center
- abnormal imaging lung icd 10
- icd 10 abnormal imaging chest
- abnormal imaging chest icd 10 code
- 5g startups silicon valley
- startup companies in silicon valley
- silicon valley startups 2020
- silicon valley ai companies list
- top silicon valley startups 2020