Difference between revisions of "VEYE-MIPI-290/327 i2c/zh"
(68 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
− | + | [[VEYE-MIPI-290/327 i2c/|English]] | |
+ | |||
+ | '''<big><big><big><big>[[VEYE-MIPI-290/327 i2c/zh|VEYE-MIPI-X I2C.sh用户手册]]</big></big></big></big>''' | ||
===介绍=== | ===介绍=== | ||
目录下总共4个文件,camera_i2c_config、i2c_read、i2c_write、veye_mipi_i2c.sh。 | 目录下总共4个文件,camera_i2c_config、i2c_read、i2c_write、veye_mipi_i2c.sh。 | ||
− | + | 第一次使用需要确认此目录下文件都具备可执行权限。 | |
+ | |||
+ | <code>chmod +x *</code> | ||
+ | |||
+ | ===树莓派(Legacy mode only)配置管脚,非树莓派忽略此步=== | ||
+ | 你需要先运行camera_i2c_config | ||
− | < | + | <code>./enable_i2c_vc.sh</code> |
− | + | <code>./camera_i2c_config</code> | |
+ | |||
+ | 配置管脚,然后执行veye_mipi_i2c.sh | ||
+ | |||
+ | ====camera_i2c_config USAGE==== | ||
+ | 连接树莓派Computer Module情况下,运行 | ||
<code>./camera_i2c_config [cameranum]</code> | <code>./camera_i2c_config [cameranum]</code> | ||
+ | {| class="wikitable" | ||
+ | !cameranum | ||
+ | !description | ||
+ | |- | ||
+ | |0 | ||
+ | |CAM0 | ||
+ | |- | ||
+ | |1 | ||
+ | |CAM1 | ||
+ | |} | ||
+ | 连接树莓派经典版型情况下,直接运行 | ||
− | |||
<code>./camera_i2c_config</code> | <code>./camera_i2c_config</code> | ||
− | |||
− | |||
− | |||
===veye_mipi_i2c.sh USAGE=== | ===veye_mipi_i2c.sh USAGE=== | ||
./veye_mipi_i2c.sh | ./veye_mipi_i2c.sh | ||
− | Usage: ./veye_mipi_i2c.sh [-r/w] [-f] function name -p1 param1 -p2 param2 -b bus | + | Usage: ./veye_mipi_i2c.sh [-r/w] [-f] function name -p1 param1 -p2 param2 -b bus -d i2caddr |
options: | options: | ||
Line 37: | Line 56: | ||
-b [i2c bus num] i2c bus number | -b [i2c bus num] i2c bus number | ||
− | + | -d [i2c addr] i2c device address | |
− | + | === 不同板子上的i2c序号=== | |
− | + | 请参考下面的文章,确定你所需要使用的-b参数。 | |
− | |||
− | === | ||
− | |||
− | |||
+ | [[I2c bus number and video node|i2c bus number on different boards]] | ||
+ | ===功能列表=== | ||
+ | =====devid===== | ||
<code>./veye_mipi_i2c.sh -r -f devid</code> | <code>./veye_mipi_i2c.sh -r -f devid</code> | ||
{| class="wikitable" | {| class="wikitable" | ||
Line 50: | Line 68: | ||
!description | !description | ||
|- | |- | ||
− | | | + | |0x06 |
− | + | |VEYE-MIPI-X serises,IMX327,IMX462,IMX385 | |
− | |- | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|} | |} | ||
− | + | =====hdver===== | |
− | |||
<code>./veye_mipi_i2c.sh -r -f hdver</code> | <code>./veye_mipi_i2c.sh -r -f hdver</code> | ||
{| class="wikitable" | {| class="wikitable" | ||
Line 73: | Line 81: | ||
|Version | |Version | ||
|} | |} | ||
+ | 同时会打印出isp fireware的发布时间。 | ||
− | + | ===== sensorid ===== | |
+ | <code>./veye_mipi_i2c.sh -r -f sensorid</code> | ||
+ | Print sensor type and board information. | ||
+ | |||
+ | =====wdrmode===== | ||
<code>./veye_mipi_i2c.sh -r -f wdrmode | <code>./veye_mipi_i2c.sh -r -f wdrmode | ||
./veye_mipi_i2c.sh -w -f wdrmode -p1 [value]</code> | ./veye_mipi_i2c.sh -w -f wdrmode -p1 [value]</code> | ||
Line 92: | Line 105: | ||
|- | |- | ||
|0x03 | |0x03 | ||
− | |WDR Enable | + | |DOL WDR Enable |
|} | |} | ||
− | + | =====videoformat===== | |
− | |||
<code>./veye_mipi_i2c.sh -r -f videoformat | <code>./veye_mipi_i2c.sh -r -f videoformat | ||
./veye_mipi_i2c.sh -w -f videoformat -p1 [value]</code> | ./veye_mipi_i2c.sh -w -f videoformat -p1 [value]</code> | ||
Line 103: | Line 115: | ||
!value | !value | ||
!description | !description | ||
+ | !frame rate | ||
|- | |- | ||
|PAL | |PAL | ||
|PAL(50Hz) | |PAL(50Hz) | ||
+ | |25fps | ||
|- | |- | ||
|NTSC | |NTSC | ||
|NTSC(60Hz) | |NTSC(60Hz) | ||
+ | |30fps | ||
|} | |} | ||
− | + | =====mirrormode===== | |
− | |||
<code>./veye_mipi_i2c.sh -r -f mirrormode | <code>./veye_mipi_i2c.sh -r -f mirrormode | ||
./veye_mipi_i2c.sh -w -f mirrormode -p1 [value]</code> | ./veye_mipi_i2c.sh -w -f mirrormode -p1 [value]</code> | ||
Line 132: | Line 146: | ||
|} | |} | ||
− | + | =====denoise===== | |
− | |||
<code>./veye_mipi_i2c.sh -r -f denoise | <code>./veye_mipi_i2c.sh -r -f denoise | ||
./veye_mipi_i2c.sh -w -f denoise -p1 [value]</code> | ./veye_mipi_i2c.sh -w -f denoise -p1 [value]</code> | ||
Line 189: | Line 202: | ||
|} | |} | ||
− | + | =====agc===== | |
− | |||
<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> | ||
+ | 含义为增益上限,默认为0xC。 | ||
{| class="wikitable" | {| class="wikitable" | ||
!value | !value | ||
Line 201: | Line 214: | ||
|} | |} | ||
− | + | =====lowlight===== | |
− | |||
<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> | ||
+ | 低照度情况下的降帧(慢快门)设置。在低照度情况下,摄像机模组可以通过配置此参数,延长曝光时间,降低帧率,达到更好的低照度效果。 | ||
+ | |||
+ | 注意,在运动场景下不适合使用。 | ||
{| class="wikitable" | {| class="wikitable" | ||
!value | !value | ||
− | ! | + | !最小帧率 |
|- | |- | ||
|0x01 | |0x01 | ||
Line 240: | Line 255: | ||
|} | |} | ||
− | + | =====daynightmode===== | |
− | |||
<code>./veye_mipi_i2c.sh -r -f daynightmode | <code>./veye_mipi_i2c.sh -r -f daynightmode | ||
./veye_mipi_i2c.sh -w -f daynightmode -p1 [value]</code> | ./veye_mipi_i2c.sh -w -f daynightmode -p1 [value]</code> | ||
Line 257: | Line 271: | ||
|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 of VEYE-MIPI-327]] or [[VEYE-MIPI-IMX327S Data Sheet|J2 pin1 of VEYE-MIPI-IMX327S]]. | ||
+ | |||
+ | 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. | ||
+ | |||
+ | ===== ircutdir ===== | ||
+ | <code>./veye_mipi_i2c.sh -r -f ircutdir</code> | ||
+ | |||
+ | <code>./veye_mipi_i2c.sh -w -f ircutdir -p1 [value]</code> | ||
+ | |||
+ | IR_CUT pins control direction. value could be 0 or 1. | ||
+ | |||
+ | ===== irtrigger ===== | ||
+ | <code>./veye_mipi_i2c.sh -r -f irtrigger</code> | ||
+ | |||
+ | <code>./veye_mipi_i2c.sh -w -f irtrigger -p1 [value]</code> | ||
+ | |||
+ | 日夜切换外触发模式引脚的极性设置。 | ||
+ | {| class="wikitable" | ||
+ | !value | ||
+ | !description | ||
+ | !remark | ||
+ | |- | ||
+ | |0x0 | ||
+ | |默认值,参考不同型号datasheet说明。 | ||
+ | |第0bit有效,其他为无关位 | ||
+ | |- | ||
+ | |0x1 | ||
+ | |反转。 | ||
+ | |第0bit有效,其他为无关位 | ||
+ | |} | ||
+ | =====mshutter===== | ||
+ | 自动曝光,手动曝光模式选择和配置。 | ||
+ | |||
+ | <code>./veye_mipi_i2c.sh -r -f mshutter</code> | ||
+ | |||
+ | <code>./veye_mipi_i2c.sh -w -f mshutter -p1 [value]</code> | ||
+ | |||
+ | value值为曝光时间(单位:s) | ||
+ | |||
+ | value 大于等于0x4B则进入低帧率模式 | ||
+ | {| 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的目标亮度,范围[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 调节速度p1为agc速度,p2为shutter速度,由慢到快[0,0x64] | ||
+ | |||
+ | =====contrast===== | ||
+ | <code>./veye_mipi_i2c.sh -r -f contrast</code> | ||
+ | |||
+ | <code>./veye_mipi_i2c.sh -w -f contrast -p1 0x32</code> | ||
+ | |||
+ | 图像对比度,范围[0,0xFF],默认为0x80 | ||
+ | |||
+ | =====saturation===== | ||
+ | <code>./veye_mipi_i2c.sh -r -f saturation</code> | ||
+ | |||
+ | <code>./veye_mipi_i2c.sh -w -f saturation -p1 0x32</code> | ||
+ | |||
+ | 饱和度,范围: [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] | ||
+ | |||
+ | ===== wdrsharppen ===== | ||
+ | <code>./veye_mipi_i2c.sh -r -f wdrsharppen</code> | ||
+ | |||
+ | <code>./veye_mipi_i2c.sh -w -f wdrsharppen -p1 [val1] -p2 [value]</code> | ||
+ | |||
+ | sharppeness setting on DOL WDR mode | ||
+ | {| 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> | ||
+ | |||
+ | 宽动态模式下的整体亮度目标值。 | ||
+ | |||
+ | WDR模式生效,[0-0xFF]默认值0x80,WDR模式下,值越大,亮度越高。 | ||
+ | |||
+ | =====wdrbtargetbr===== | ||
+ | <code>./veye_mipi_i2c.sh -r -f wdrbtargetbr</code> | ||
+ | |||
+ | <code>./veye_mipi_i2c.sh -w -f wdrbtargetbr -p1 0x80</code> | ||
+ | |||
+ | 宽动态模式下的亮区亮度目标值。 | ||
+ | |||
+ | WDR模式生效,[0-0xFF],默认值为0x30,值越大,亮区越亮。 | ||
+ | |||
+ | 此参数的效果与实际场景有关,会存在一个[0-X]的无效区,X与实际场景有关。 | ||
+ | |||
+ | 并不是说调整为0,则亮区会变黑。 | ||
+ | |||
+ | ===== boardmodel ===== | ||
+ | <code>./veye_mipi_i2c.sh -r -f boardmodel</code> | ||
+ | |||
+ | Requirment: hdver >=4. | ||
+ | |||
+ | 读取板子的板号,可以通过此功能区分VEYE-MIPI-327和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. | ||
+ | |||
+ | 是否使能摄像头的i2c写寄存器功能,默认为使能。用于特殊情况下的寄存器写保护。 | ||
+ | |||
+ | ===== 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. | ||
+ | |||
+ | 是否使能辅助i2c,如使能辅助i2c,在FFC排线上的主i2c不能使用。用于特殊情况下的总线冲突解决。 | ||
+ | |||
+ | ===== awbgain ===== | ||
+ | <code>./veye_mipi_i2c.sh -r -f awbgain</code> | ||
+ | |||
+ | 读取当前白平衡的Rgain和Bgain,参数范围[0,0xFF]。 | ||
+ | |||
+ | ===== wbmode ===== | ||
+ | <code>./veye_mipi_i2c.sh -r -f wbmode</code> | ||
+ | |||
+ | <code>./veye_mipi_i2c.sh -w -f wbmode -p1 [value]</code> | ||
+ | |||
+ | 读取当前wb模式 | ||
+ | {| 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 mwbgain -p1 [rgain] -p2 [bgain]</code> | ||
+ | |||
+ | 手动白平衡下的rgain和bgain读写。rgain和bgain的范围[0,0xFF]。 | ||
+ | |||
+ | ===== yuvseq ===== | ||
+ | <code>./veye_mipi_i2c.sh -w -f yuvseq -p1 YUYV</code> | ||
+ | |||
+ | <code>./veye_mipi_i2c.sh -w -f yuvseq -p1 UYVY</code> | ||
+ | |||
+ | <code>./veye_mipi_i2c.sh -r -f yuvseq</code> | ||
+ | |||
+ | 配置摄像头的yuv顺序。 | ||
+ | |||
+ | Note: only supported on hdver >= 0x4. | ||
+ | |||
+ | === 新功能 === | ||
+ | 下面的新功能,只有摄像机固件版本的release time晚于2022-11-22的版本才支持。 | ||
+ | |||
+ | ===== paramsave ===== | ||
+ | <code>./veye_mipi_i2c.sh -w -f paramsave</code> | ||
+ | |||
+ | 保存isp相关参数到flash中。 | ||
+ | |||
+ | ===== new_expmode ===== | ||
+ | <code>./veye_mipi_i2c.sh -r -f new_expmode</code> | ||
+ | |||
+ | <code>./veye_mipi_i2c.sh -w -f new_expmode -p1 [0/1]</code> | ||
+ | |||
+ | 新版本手动曝光是否使能。 | ||
+ | |||
+ | 如果使能新版本手动曝光,则: | ||
+ | |||
+ | # 原来的mshutter命令不再生效,new_mshutter生效。 | ||
+ | # 增益(agc)由自动模式也改为手动模式,new_mgain生效。 | ||
+ | |||
+ | ===== new_mshutter ===== | ||
+ | <code>./veye_mipi_i2c.sh -r -f new_mshutter</code> | ||
+ | |||
+ | <code>./veye_mipi_i2c.sh -w -f new_mshutter -p1 1000</code> | ||
+ | |||
+ | 新版本手动曝光时间配置,单位为us,范围是[1,1000000]. | ||
+ | |||
+ | 由于sensor无法支持精确到1us的曝光时间,建议在配置之后,读取一下进行确认。 | ||
+ | |||
+ | ===== new_mgain ===== | ||
+ | <code>./veye_mipi_i2c.sh -r -f new_mgain</code> | ||
+ | |||
+ | <code>./veye_mipi_i2c.sh -w -f new_mgain -p1 2.1</code> | ||
+ | |||
+ | 新版本手动增益,根据sensor不同,精确到0.1dB或者0.3dB。 | ||
+ | |||
+ | ===== auto_shutter_max ===== | ||
+ | 此功能只有release time晚于2022-12-09的版本才支持。 | ||
+ | |||
+ | 在'''mshutter'''配置为auto时,配置自动曝光的上限。 | ||
+ | |||
+ | <code>./veye_mipi_i2c.sh -r -f auto_shutter_max</code> | ||
+ | |||
+ | <code>./veye_mipi_i2c.sh -w -f auto_shutter_max -p1 1000</code> | ||
+ | |||
+ | 单位为us,范围是[1,1000000/fps]. | ||
+ | |||
+ | 由于sensor无法支持精确到1us的曝光时间,建议在配置之后,读取一下进行确认。 |
Latest revision as of 08:24, 8 July 2024
1 介绍
目录下总共4个文件,camera_i2c_config、i2c_read、i2c_write、veye_mipi_i2c.sh。
第一次使用需要确认此目录下文件都具备可执行权限。
chmod +x *
2 树莓派(Legacy mode only)配置管脚,非树莓派忽略此步
你需要先运行camera_i2c_config
./enable_i2c_vc.sh
./camera_i2c_config
配置管脚,然后执行veye_mipi_i2c.sh
2.1 camera_i2c_config USAGE
连接树莓派Computer Module情况下,运行
./camera_i2c_config [cameranum]
cameranum | description |
---|---|
0 | CAM0 |
1 | CAM1 |
连接树莓派经典版型情况下,直接运行
./camera_i2c_config
3 veye_mipi_i2c.sh USAGE
./veye_mipi_i2c.sh
Usage: ./veye_mipi_i2c.sh [-r/w] [-f] function name -p1 param1 -p2 param2 -b bus -d i2caddr
options:
-r read
-w write
-f [function name] function name
-p1 [param1] param1 of each function
-p2 [param1] param2 of each function
-b [i2c bus num] i2c bus number
-d [i2c addr] i2c device address
4 不同板子上的i2c序号
请参考下面的文章,确定你所需要使用的-b参数。
i2c bus number on different boards
5 功能列表
5.1 devid
./veye_mipi_i2c.sh -r -f devid
value | description |
---|---|
0x06 | VEYE-MIPI-X serises,IMX327,IMX462,IMX385 |
5.2 hdver
./veye_mipi_i2c.sh -r -f hdver
value | description |
---|---|
0xXX | Version |
同时会打印出isp fireware的发布时间。
5.3 sensorid
./veye_mipi_i2c.sh -r -f sensorid
Print sensor type and board information.
5.4 wdrmode
./veye_mipi_i2c.sh -r -f wdrmode
./veye_mipi_i2c.sh -w -f wdrmode -p1 [value]
value | description |
---|---|
0x00 | Back Light Mode OFF |
0x01 | Back Light Mode ON, LOW |
0x02 | Back Light Mode ON, HIGH |
0x03 | DOL WDR Enable |
5.5 videoformat
./veye_mipi_i2c.sh -r -f videoformat
./veye_mipi_i2c.sh -w -f videoformat -p1 [value]
WARNING:THIS FUNCTION MUST BE CALLED BEFORE ANY video applications
value | description | frame rate |
---|---|---|
PAL | PAL(50Hz) | 25fps |
NTSC | NTSC(60Hz) | 30fps |
5.6 mirrormode
./veye_mipi_i2c.sh -r -f mirrormode
./veye_mipi_i2c.sh -w -f mirrormode -p1 [value]
value | description |
---|---|
0x00 | Normal |
0x01 | Mirror |
0x02 | V-Flip |
0x03 | Mirror And V-Flip(180 Degree Rotate) |
5.7 denoise
./veye_mipi_i2c.sh -r -f denoise
./veye_mipi_i2c.sh -w -f denoise -p1 [value]
value | description |
---|---|
0x00 | NR 2D Mode = OFF; NR 3D Mode = OFF |
0x01 | NR 2D Mode = OFF; NR 3D Mode = LOW |
0x02 | NR 2D Mode = OFF; NR 3D Mode = MIDDLE |
0x03 | NR 2D Mode = OFF; NR 3D Mode = HIGH |
0x04 | NR 2D Mode = LOW; NR 3D Mode = OFF |
0x05 | NR 2D Mode = LOW; NR 3D Mode = LOW |
0x06 | NR 2D Mode = LOW; NR 3D Mode = MIDDLE |
0x07 | NR 2D Mode = LOW; NR 3D Mode = HIGH |
0x08 | NR 2D Mode =MIDDLE; NR 3D Mode = OFF |
0x09 | NR 2D Mode =MIDDLE; NR 3D Mode = LOW |
0x0A | NR 2D Mode = MIDDLE; NR 3D Mode = MIDDLE |
0x0B | NR 2D Mode = MIDDLE; NR 3D Mode = HIGH |
0x0C | NR 2D Mode =HIGH; NR 3D Mode = OFF |
0x0D | NR 2D Mode =HIGH; NR 3D Mode = LOW |
0x0E | NR 2D Mode = HIGH; NR 3D Mode = MIDDLE |
0x0F | NR 2D Mode = HIGH; NR 3D Mode = HIGH |
5.8 agc
./veye_mipi_i2c.sh -r -f agc
./veye_mipi_i2c.sh -w -f agc -p1 [value]
含义为增益上限,默认为0xC。
value | description |
---|---|
0x00~0x0F | AGC intensity |
5.9 lowlight
./veye_mipi_i2c.sh -r -f lowlight
./veye_mipi_i2c.sh -w -f lowlight -p1 [value]
低照度情况下的降帧(慢快门)设置。在低照度情况下,摄像机模组可以通过配置此参数,延长曝光时间,降低帧率,达到更好的低照度效果。
注意,在运动场景下不适合使用。
value | 最小帧率 |
---|---|
0x01 | 1/2*(FRAME RATE) |
0x03 | 1/4*(FRAME RATE) |
0x05 | 1/6*(FRAME RATE) |
0x07 | 1/8*(FRAME RATE) |
0x09 | 1/10*(FRAME RATE) |
0x0B | 1/15*(FRAME RATE) |
0x0D | 1/20*(FRAME RATE) |
0x0F | 1/25*(FRAME RATE) |
0x11 | 1/30*(FRAME RATE) |
0x00 | Fixed frame rate (25/30) |
5.10 daynightmode
./veye_mipi_i2c.sh -r -f daynightmode
./veye_mipi_i2c.sh -w -f daynightmode -p1 [value]
value | description |
---|---|
0xFF | Color Mode |
0xFE | Black&White Mode |
0xFC | 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 : J3 pin1 of VEYE-MIPI-327 or J2 pin1 of VEYE-MIPI-IMX327S.
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.
5.11 ircutdir
./veye_mipi_i2c.sh -r -f ircutdir
./veye_mipi_i2c.sh -w -f ircutdir -p1 [value]
IR_CUT pins control direction. value could be 0 or 1.
5.12 irtrigger
./veye_mipi_i2c.sh -r -f irtrigger
./veye_mipi_i2c.sh -w -f irtrigger -p1 [value]
日夜切换外触发模式引脚的极性设置。
value | description | remark |
---|---|---|
0x0 | 默认值,参考不同型号datasheet说明。 | 第0bit有效,其他为无关位 |
0x1 | 反转。 | 第0bit有效,其他为无关位 |
5.13 mshutter
自动曝光,手动曝光模式选择和配置。
./veye_mipi_i2c.sh -r -f mshutter
./veye_mipi_i2c.sh -w -f mshutter -p1 [value]
value值为曝光时间(单位:s)
value 大于等于0x4B则进入低帧率模式
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 |
5.14 cameramode
Requirements:hdver >= 0x3
./veye_mipi_i2c.sh -r -f cameramode
./veye_mipi_i2c.sh -w -f cameramode -p1 [value]
value | description |
---|---|
0x0 | Stream mode |
0x1 | Capture mode |
Stream mode: stream output
Caputre mode: output the next frame each capture cmd.
5.15 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.
./veye_mipi_i2c.sh -r -f nodf
./veye_mipi_i2c.sh -w -f nodf -p1 [value]
ntof range is [0-0xFF], default 0.
5.16 capture
Requirements:hdver >= 0x3, effective in Capture mode
./veye_mipi_i2c.sh -w -f capture
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.
5.17 csienable
Requirements:hdver >= 0x3
./veye_mipi_i2c.sh -r -f csienable
./veye_mipi_i2c.sh -w -f csienable -p1 [value]
value | description |
---|---|
0x0 | suspend csi output |
0x1 | enable csi output |
default: 0x1
Note: This is not low power mode, the camera is still working.
5.18 brightness
./veye_mipi_i2c.sh -r -f brightness
./veye_mipi_i2c.sh -w -f brightness -p1 0x32
AE的目标亮度,范围[0,0x64]
5.19 aespeed
./veye_mipi_i2c.sh -r -f aespeed
./veye_mipi_i2c.sh -w -f aespeed -p1 0x32 -p2 0x32
AE 调节速度p1为agc速度,p2为shutter速度,由慢到快[0,0x64]
5.20 contrast
./veye_mipi_i2c.sh -r -f contrast
./veye_mipi_i2c.sh -w -f contrast -p1 0x32
图像对比度,范围[0,0xFF],默认为0x80
5.21 saturation
./veye_mipi_i2c.sh -r -f saturation
./veye_mipi_i2c.sh -w -f saturation -p1 0x32
饱和度,范围: [0,0x64]
5.22 sharppen
./veye_mipi_i2c.sh -r -f sharppen
./veye_mipi_i2c.sh -w -f sharppen -p1 [val1] -p2 [value]
param1 value | description |
---|---|
0x0 | sharppen disable |
0x1 | sharppen enable |
default: 0x1
param2: sharppen strength, range [0x0-0xA]
5.23 wdrsharppen
./veye_mipi_i2c.sh -r -f wdrsharppen
./veye_mipi_i2c.sh -w -f wdrsharppen -p1 [val1] -p2 [value]
sharppeness setting on DOL WDR mode
param1 value | description |
---|---|
0x0 | sharppen disable |
0x1 | sharppen enable |
default: 0x1
param2: sharppen strength, range [0x0-0xA]
5.24 wdrtargetbr
./veye_mipi_i2c.sh -r -f wdrtargetbr
./veye_mipi_i2c.sh -w -f wdrtargetbr -p1 0x80
宽动态模式下的整体亮度目标值。
WDR模式生效,[0-0xFF]默认值0x80,WDR模式下,值越大,亮度越高。
5.25 wdrbtargetbr
./veye_mipi_i2c.sh -r -f wdrbtargetbr
./veye_mipi_i2c.sh -w -f wdrbtargetbr -p1 0x80
宽动态模式下的亮区亮度目标值。
WDR模式生效,[0-0xFF],默认值为0x30,值越大,亮区越亮。
此参数的效果与实际场景有关,会存在一个[0-X]的无效区,X与实际场景有关。
并不是说调整为0,则亮区会变黑。
5.26 boardmodel
./veye_mipi_i2c.sh -r -f boardmodel
Requirment: hdver >=4.
读取板子的板号,可以通过此功能区分VEYE-MIPI-327和VEYE-MIPI-IMX327S。
5.27 i2cwen
./veye_mipi_i2c.sh -r -f i2cwen
./veye_mipi_i2c.sh -w -f i2cwen -p1 [0/1]
Requirment: hdver >=4.
是否使能摄像头的i2c写寄存器功能,默认为使能。用于特殊情况下的寄存器写保护。
5.28 i2cauxenable
./veye_mipi_i2c.sh -r -f i2cauxenable
./veye_mipi_i2c.sh -w -f i2cauxenable -p1 [0/1]
Requirment: hdver >=4.
是否使能辅助i2c,如使能辅助i2c,在FFC排线上的主i2c不能使用。用于特殊情况下的总线冲突解决。
5.29 awbgain
./veye_mipi_i2c.sh -r -f awbgain
读取当前白平衡的Rgain和Bgain,参数范围[0,0xFF]。
5.30 wbmode
./veye_mipi_i2c.sh -r -f wbmode
./veye_mipi_i2c.sh -w -f wbmode -p1 [value]
读取当前wb模式
value | description |
---|---|
0x18 | Auto white balance |
0x1B | Manual white balance |
5.31 mwbgain
./veye_mipi_i2c.sh -r -f mwbgain
./veye_mipi_i2c.sh -w -f mwbgain -p1 [rgain] -p2 [bgain]
手动白平衡下的rgain和bgain读写。rgain和bgain的范围[0,0xFF]。
5.32 yuvseq
./veye_mipi_i2c.sh -w -f yuvseq -p1 YUYV
./veye_mipi_i2c.sh -w -f yuvseq -p1 UYVY
./veye_mipi_i2c.sh -r -f yuvseq
配置摄像头的yuv顺序。
Note: only supported on hdver >= 0x4.
6 新功能
下面的新功能,只有摄像机固件版本的release time晚于2022-11-22的版本才支持。
6.1 paramsave
./veye_mipi_i2c.sh -w -f paramsave
保存isp相关参数到flash中。
6.2 new_expmode
./veye_mipi_i2c.sh -r -f new_expmode
./veye_mipi_i2c.sh -w -f new_expmode -p1 [0/1]
新版本手动曝光是否使能。
如果使能新版本手动曝光,则:
- 原来的mshutter命令不再生效,new_mshutter生效。
- 增益(agc)由自动模式也改为手动模式,new_mgain生效。
6.3 new_mshutter
./veye_mipi_i2c.sh -r -f new_mshutter
./veye_mipi_i2c.sh -w -f new_mshutter -p1 1000
新版本手动曝光时间配置,单位为us,范围是[1,1000000].
由于sensor无法支持精确到1us的曝光时间,建议在配置之后,读取一下进行确认。
6.4 new_mgain
./veye_mipi_i2c.sh -r -f new_mgain
./veye_mipi_i2c.sh -w -f new_mgain -p1 2.1
新版本手动增益,根据sensor不同,精确到0.1dB或者0.3dB。
6.5 auto_shutter_max
此功能只有release time晚于2022-12-09的版本才支持。
在mshutter配置为auto时,配置自动曝光的上限。
./veye_mipi_i2c.sh -r -f auto_shutter_max
./veye_mipi_i2c.sh -w -f auto_shutter_max -p1 1000
单位为us,范围是[1,1000000/fps].
由于sensor无法支持精确到1us的曝光时间,建议在配置之后,读取一下进行确认。