Changes

Jump to navigation Jump to search
6,505 bytes added ,  14:38, 11 April 2021
add manual white balance
Line 1: Line 1:  
[[VEYE-MIPI-290/327 i2c/zh|查看中文]]
 
[[VEYE-MIPI-290/327 i2c/zh|查看中文]]
    +
[[VEYE-MIPI-290/327 i2c/|<big><big><big><big>VEYE-MIPI-290/327 I2C.sh user guide</big></big></big></big>]]
   −
'''<big>veye_mipi_i2c.sh详细说明</big>'''
+
===Overview===
 +
There are 4 files: camera_i2c_config、i2c_read、i2c_write、veye_mipi_i2c.sh
   −
===介绍===
+
===RaspberryPi Only, Set IO config===
目录下总共4个文件,camera_i2c_config、i2c_read、i2c_write、veye_mipi_i2c.sh。
+
Running
   −
你需要先运行camera_i2c_config配置管脚,然后执行veye_mipi_i2c.sh
+
<code>./enable_i2c_vc.sh</code>
===camera_i2c_config USAGE===
+
 
连接树莓派Computer Module情况下,运行
+
<code>./camera_i2c_config</code>
 +
 
 +
first,it will config IO pin.
 +
 
 +
Then you can run veye_mipi_i2c.sh.
 +
====camera_i2c_config USAGE====
 +
 
 +
*for standard RPI, just run
 +
 
 +
<code>./camera_i2c_config</code>
 +
 
 +
*for RPI Computer Module
    
<code>./camera_i2c_config [cameranum]</code>
 
<code>./camera_i2c_config [cameranum]</code>
Line 21: Line 34:  
|1
 
|1
 
|CAM1
 
|CAM1
|}连接树莓派经典版型情况下,直接运行
+
|}<br />
 
  −
<code>./camera_i2c_config</code>
   
===veye_mipi_i2c.sh USAGE===
 
===veye_mipi_i2c.sh USAGE===
 
./veye_mipi_i2c.sh
 
./veye_mipi_i2c.sh
Line 43: Line 54:  
-b [i2c bus num] i2c bus number
 
-b [i2c bus num] i2c bus number
   −
support functions: devid,hdver,wdrmode,videoformat,mirrormode,denoise,agc,lowlight,daynightmode,ircutdir,irtrigger
+
support functions: devid,hdver,wdrmode,videoformat,mirrormode,denoise,agc,lowlight,daynightmode,ircutdir,irtriggerhutter
====使用详解====
+
 
 +
cameramode, nodf, capture, csienable,saturation,wdrbtargetbr,wdrtargetbr, brightness ,contrast , sharppen, aespeed,lsc,boardmodel,yuvseq,i2cauxenable,i2cwen
 +
 
 +
Pi3B / Pi3B+ / 3A / 4B(1G/2G/4G),we use i2c0
 +
 
 +
Compute Module/ CM3,we use i2c1,please add '''-b 1''' option.
 +
 
 
=====devid=====
 
=====devid=====
 
  <code>./veye_mipi_i2c.sh -r -f devid</code>
 
  <code>./veye_mipi_i2c.sh -r -f devid</code>
Line 51: Line 68:  
!description
 
!description
 
|-
 
|-
|0x02
+
|0x06
|MIPI, WDRDisable, 2Lane
+
|VEYE-MIPI-290/327
|-
  −
|0x22
  −
|MIPI, WDREnable, 2Lane
  −
|-
  −
|0x13
  −
|LVDS,WDRDisable,3Lane
  −
|-
  −
|0x33
  −
|LVDS,WDREnable,3Lane
   
|}
 
|}
 
=====hdver=====
 
=====hdver=====
Line 89: Line 97:  
|-
 
|-
 
|0x03
 
|0x03
|WDR Enable
+
|DOL WDR Enable
 
|}
 
|}
 
=====videoformat=====
 
=====videoformat=====
Line 98: Line 106:  
!value
 
!value
 
!description
 
!description
 +
!frame rate
 
|-
 
|-
 
|PAL
 
|PAL
 
|PAL(50Hz)
 
|PAL(50Hz)
 +
|25fps
 
|-
 
|-
 
|NTSC
 
|NTSC
 
|NTSC(60Hz)
 
|NTSC(60Hz)
 +
|30fps
 
|}
 
|}
 
=====mirrormode=====
 
=====mirrormode=====
Line 182: Line 193:  
  <code>./veye_mipi_i2c.sh -r -f agc
 
  <code>./veye_mipi_i2c.sh -r -f agc
 
  ./veye_mipi_i2c.sh -w -f agc -p1 [value]</code>
 
  ./veye_mipi_i2c.sh -w -f agc -p1 [value]</code>
 +
agc indicated max gain of AE mode.
 
{| class="wikitable"
 
{| class="wikitable"
 
!value
 
!value
Line 192: Line 204:  
  <code>./veye_mipi_i2c.sh -r -f lowlight
 
  <code>./veye_mipi_i2c.sh -r -f lowlight
 
  ./veye_mipi_i2c.sh -w -f lowlight -p1 [value]</code>
 
  ./veye_mipi_i2c.sh -w -f lowlight -p1 [value]</code>
 +
In the case of low illuminance, the camera module can prolong the exposure time and reduce the frame rate by configuring this parameter to achieve a better effect of low illuminance.
 +
 +
Note that it is not suitable for use in a sports scene.
 
{| class="wikitable"
 
{| class="wikitable"
 
!value
 
!value
Line 242: Line 257:  
|Trigger Mode
 
|Trigger Mode
 
|}
 
|}
 +
IR-CUT (Infrared cut-off filter) is a mechanical shutter design. It is placed between the lens and the image sensor, and is controlled by a motor or an electromagnet.
 +
 +
IR-CUT has two status: '''Block''' or '''Deliver''' the infrared.
 +
 +
*Color Mode
 +
 +
Image is Color Mode and IR_CUT status '''Block''' infrared.
 +
 +
*Black&White Mode
 +
 +
Image is Black&White Mode and IR_CUT status '''Deliver''' infrared.
 +
 +
*Trigger Mode
 +
 +
Trigger pin : [[VEYE-MIPI-290/327|J3 pin1]].
 +
 +
Trigger pin High(3.3~12V),Image is Black&White Mode and IR-CUT status '''Deliver''' infrared.
 +
 +
Trigger pin Low(GND),Image is Color Mode and IR-CUT status '''Bolck''' infrared.
 +
 +
=====mshutter=====
 +
close AE, use manual shutter
 +
 +
<code>./veye_mipi_i2c.sh -r -f mshutter</code>
 +
 +
<code>./veye_mipi_i2c.sh -w -f mshutter -p1 [value]</code>
 +
 +
value is exposure time(seconds)
 +
 +
If value  is greater than or equal to 0x4B, it will reduce framerate.
 +
{| class="wikitable"
 +
|+
 +
!value
 +
!description
 +
|-
 +
|
 +
|NTSC(PAL)
 +
|-
 +
|0x40
 +
|auto mode
 +
|-
 +
|0x41
 +
|1/30 (25)
 +
|-
 +
|0x42
 +
|1/60(50)
 +
|-
 +
|0x43
 +
|1/120(100)
 +
|-
 +
|0x44
 +
|1/240(200)
 +
|-
 +
|0x45
 +
|1/480(400)
 +
|-
 +
|0x46
 +
|1/1000
 +
|-
 +
|0x47
 +
|1/2000
 +
|-
 +
|0x48
 +
|1/5000
 +
|-
 +
|0x49
 +
|1/10000
 +
|-
 +
|0x4A
 +
|1/50000
 +
|-
 +
|0x4B
 +
|1/30 (25) *2
 +
|-
 +
|0x4C
 +
|1/30 (25) *4
 +
|-
 +
|0x4D
 +
|1/30 (25) *6
 +
|-
 +
|0x4E
 +
|1/30 (25) *8
 +
|-
 +
|0x4F
 +
|1/30 (25) *10
 +
|-
 +
|0x50
 +
|1/30 (25) *15
 +
|-
 +
|0x51
 +
|1/30 (25) *20
 +
|-
 +
|0x52
 +
|1/30 (25) *25
 +
|-
 +
|0x53
 +
|1/30 (25) *30
 +
|}
 +
 +
=====cameramode=====
 +
Requirements:hdver >= 0x3
 +
 +
<code>./veye_mipi_i2c.sh -r -f cameramode</code>
 +
 +
<code>./veye_mipi_i2c.sh -w -f cameramode -p1 [value]</code>
 +
{| class="wikitable"
 +
!value
 +
!description
 +
|-
 +
|0x0
 +
|Stream mode
 +
|-
 +
|0x1
 +
|Capture mode
 +
|}Stream mode:  stream output
 +
 +
Caputre mode: output the next frame each '''capture''' cmd.
 +
=====nodf=====
 +
Requirements:hdver >= 0x3, effective in Stream mode
 +
 +
Number of dropped frames
 +
 +
It is a method of framerate control, output one frame,discard '''nodf''' frames,output next frame, and so on.
 +
 +
''actual framerate = original framerate /(1+nodf)''
 +
 +
For example,if the original framerate is 30fps, set '''nodf''' to 2, then ''actual framerate'' is 10fps.
 +
 +
<code>./veye_mipi_i2c.sh -r -f nodf</code>
 +
 +
<code>./veye_mipi_i2c.sh -w -f nodf -p1 [value]</code>
 +
 +
'''ntof''' range is [0-0xFF], default 0.
 +
=====capture=====
 +
Requirements:hdver >= 0x3, effective in Capture mode
 +
 +
<code>./veye_mipi_i2c.sh -w -f capture</code>
 +
 +
Output the next frame. This cmd does not interfere the sensor,  it just output the next frame (the newest frame).
 +
 +
So it is not trigger mode, there will be a delay[0,1/framerate] between the cmd and the frame exposure.
 +
 +
It is applicable to those that do not require a high level of real-time performance.
 +
=====csienable=====
 +
Requirements:hdver >= 0x3
 +
 +
<code>./veye_mipi_i2c.sh -r -f csienable</code>
 +
 +
<code>./veye_mipi_i2c.sh -w -f csienable -p1 [value]</code>
 +
{| class="wikitable"
 +
!value
 +
!description
 +
|-
 +
|0x0
 +
|suspend csi output
 +
|-
 +
|0x1
 +
|enable csi output
 +
|}default: 0x1
 +
 +
Note: This is not low power mode, the camera is still working.
 +
=====brightness=====
 +
<code>./veye_mipi_i2c.sh -r -f brightness</code>
 +
 +
<code>./veye_mipi_i2c.sh -w -f brightness -p1 0x32</code>
 +
 +
AE Target Brightness,rang: [0,0x64]
 +
=====aespeed=====
 +
<code>./veye_mipi_i2c.sh -r -f aespeed</code>
 +
 +
<code>./veye_mipi_i2c.sh -w -f aespeed -p1 0x32 -p2 0x32</code>
 +
 +
AE adjust speed,p1 is agc speed, p2 is shutter speed,Slow to Fast: [0,0x64]
 +
=====contrast=====
 +
<code>./veye_mipi_i2c.sh -r -f contrast</code>
 +
 +
<code>./veye_mipi_i2c.sh -w -f contrast -p1 0x32</code>
 +
 +
Contrast,range: [0,0xFF],default: 0x80.
 +
 +
=====saturation=====
 +
<code>./veye_mipi_i2c.sh -r -f saturation</code>
 +
 +
<code>./veye_mipi_i2c.sh -w -f saturation -p1 0x32</code>
 +
 +
Saturation, range: [0,0x64].
 +
 +
===== sharppen =====
 +
<code>./veye_mipi_i2c.sh -r -f sharppen</code>
 +
 +
<code>./veye_mipi_i2c.sh -w -f sharppen -p1 [val1] -p2 [value]</code>
 +
{| class="wikitable"
 +
!param1 value
 +
!description
 +
|-
 +
|0x0
 +
| sharppen disable
 +
|-
 +
|0x1
 +
| sharppen enable
 +
|}default: 0x1
 +
 +
param2: sharppen strength, range [0x0-0xA]
 +
=====wdrtargetbr=====
 +
<code>./veye_mipi_i2c.sh -r -f wdrtargetbr</code>
 +
 +
<code>./veye_mipi_i2c.sh -w -f wdrtargetbr -p1 0x80</code>
 +
 +
The overall AE target value in WDR mode.
 +
 +
Takes effect in WDR mode. range:  [0-0xFF], default : 0x80.
 +
=====wdrbtargetbr=====
 +
<code>./veye_mipi_i2c.sh -r -f wdrbtargetbr</code>
 +
 +
<code>./veye_mipi_i2c.sh -w -f wdrbtargetbr -p1 0x80</code>
 +
 +
The AE target value of the bright area in WDR mode.
 +
 +
Takes effect in WDR mode. range:  [0-0xFF], default : 0x80.
 +
 +
===== boardmodel =====
 +
<code>./veye_mipi_i2c.sh -r -f boardmodel</code>
 +
 +
Requirment: hdver >=4.
 +
 +
Read the board number of the board, which can be used to distinguish between VEYE-MIPI-327 and VEYE-MIPI-IMX327S.
 +
 +
===== i2cwen =====
 +
<code>./veye_mipi_i2c.sh -r -f i2cwen</code>
 +
 +
<code>./veye_mipi_i2c.sh -w -f i2cwen -p1 [0/1]</code>
 +
 +
Requirment: hdver >=4.
 +
 +
Whether to enable the i2C write register function of the camera, enabled by default. It is used for register write protection in special cases.
 +
 +
===== i2cauxenable =====
 +
<code>./veye_mipi_i2c.sh -r -f i2cauxenable</code>
 +
 +
<code>./veye_mipi_i2c.sh -w -f i2cauxenable -p1 [0/1]</code>
 +
 +
Requirment: hdver >=4.
 +
 +
Whether to enable auxiliary i2C. If enable auxiliary i2C, the primary i2C on the FFC cable cannot be used. Used for bus conflict resolution in special cases.
 +
===== awbgain =====
 +
<code>./veye_mipi_i2c.sh -r -f awbgain</code>
 +
 +
Read the Rgain and Bgain of the current white balance status , parameter range [0,0xFF].
 +
=====wbmode=====
 +
<code>./veye_mipi_i2c.sh -r -f wbmode</code>
 +
 +
<code>./veye_mipi_i2c.sh -w -f wbmode -p1 [value]</code>
 +
 +
White balance mode setting.
 +
{| class="wikitable"
 +
!value
 +
!description
 +
|-
 +
|0x18
 +
|Auto white balance
 +
|-
 +
|0x1B
 +
| Manual white balance
 +
|}
 +
===== mwbgain=====
 +
<code>./veye_mipi_i2c.sh -r -f mwbgain</code>
 +
 +
<code>./veye_mipi_i2c.sh -w -f wbmode -p1 [rgain] -p2 [bgain]</code>
 +
 +
Rgain and Bgain setting in manual white balance mode.arameter range [0,0xFF].

Navigation menu