Difference between revisions of "Gx mipi i2c.sh user guide/zh"

From wiki_veye
Jump to navigation Jump to search
(保存一版)
 
(23 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
[[Gx mipi i2c.sh user guide|English]]
 +
 
<big>'''gx_mipi_i2c.sh Shell 脚本用法'''</big>
 
<big>'''gx_mipi_i2c.sh Shell 脚本用法'''</big>
  
=== 概述 ===
+
===概述===
 
gx_mipi_i2c.sh 脚本是一组用于通过 I2C 配置 GX MIPI 系列相机的工具。
 
gx_mipi_i2c.sh 脚本是一组用于通过 I2C 配置 GX MIPI 系列相机的工具。
  
此脚本本质上是对寄存器的访问。有关寄存器,请参阅 [https://wiki.veye.cc/index.php/Gx_Series_MIPI_Camera_Register_Map/zh GX 系列 MIPI 摄像头寄存器映射表]。
+
此脚本本质上是对寄存器的访问。有关寄存器,请参阅 [[Gx Series MIPI Camera Register Map/zh|GX 系列 MIPI 摄像头寄存器映射表]]。
  
=== 下载 ===
+
===下载===
 
我们为不同的嵌入式平台提供 gx_mipi_i2c.sh 的下载链接。  
 
我们为不同的嵌入式平台提供 gx_mipi_i2c.sh 的下载链接。  
  
Line 13: Line 15:
 
以下是脚本命令:
 
以下是脚本命令:
  
<br />
+
===准备工作===
 
 
=== 准备工作 ===
 
 
<code>cd gx_tools_rpi/sources/</code>
 
<code>cd gx_tools_rpi/sources/</code>
  
Line 24: Line 24:
 
<code>chmod +x *</code>
 
<code>chmod +x *</code>
  
=== gx_mipi_i2c.sh 用法 ===
+
===gx_mipi_i2c.sh 用法===
 
<code>$ ./gx_mipi_i2c.sh</code>
 
<code>$ ./gx_mipi_i2c.sh</code>
  
Line 54: Line 54:
 
请参考以下文章来确定您需要使用哪个 -b 参数。
 
请参考以下文章来确定您需要使用哪个 -b 参数。
  
[[I2c bus number and video node|i2c bus number on different boards]]
+
[[I2c bus number and video node/zh|I2C 总线编号查询]]
 +
 
 +
===脚本使用常见问题===
 +
1.当i2c不通时会有以下提示信息
 +
 
 +
./i2c_functions.sh: line 235: Read i2c err: syntax error in expression (error token is "i2c err")
 +
 
 +
2.当执行脚本找不到可执行的二进制文件时会有以下提示
 +
 
 +
❌ Error: Required tool not found or not executable: /home/pi/nveye_tools/i2c_vread
 +
 
 +
❌ Error: Required tool not found or not executable: /home/pi/nveye_tools/i2c_vwrite
 +
 
 
===功能列表===
 
===功能列表===
  
==== 注: ====
+
====注:====
 
该相机有两种状态,即待机状态和运行状态。在开始图像采集后,相机就会进入运行状态。
 
该相机有两种状态,即待机状态和运行状态。在开始图像采集后,相机就会进入运行状态。
  
在运行状态下,有一些注册表是被写保护的,它们会用星号进行标记。例如:trgsrc* 。
+
在运行状态下,有一些寄存器是被写保护的,它们会用星号进行标记。例如:trgsrc* 。
  
 
有些参数有严格的范围限制,当你不确定时,不妨先尝试查看一下这些参数。
 
有些参数有严格的范围限制,当你不确定时,不妨先尝试查看一下这些参数。
  
=== 基本参数 ===
+
====基本参数====
  
==== manufacturer ====
+
=====manufacturer=====
 
<code>./gx_mipi_i2c.sh -r manufacturer -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r manufacturer -b your_i2c_bus_number</code>
  
 
获取制造商名称,'''VEYE'''.
 
获取制造商名称,'''VEYE'''.
  
==== model ====
+
=====model=====
 
<code>./gx_mipi_i2c.sh -r model -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r model -b your_i2c_bus_number</code>
  
 
获取产品型号,例如 GX-MIPI-IMX662.
 
获取产品型号,例如 GX-MIPI-IMX662.
  
==== sensorname ====
+
=====sensorname=====
 
<code>./gx_mipi_i2c.sh -r sensorname -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r sensorname -b your_i2c_bus_number</code>
  
 
获取传感器型号,例如 IMX662-AAQR.
 
获取传感器型号,例如 IMX662-AAQR.
  
==== version ====
+
=====version=====
 
<code>./gx_mipi_i2c.sh -r version -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r version -b your_i2c_bus_number</code>
  
Line 88: Line 100:
 
该系统有两个主要的控制芯片,分别负责控制和逻辑运算功能。
 
该系统有两个主要的控制芯片,分别负责控制和逻辑运算功能。
  
==== serialno ====
+
=====serialno=====
 
<code>./gx_mipi_i2c.sh -r serialno -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r serialno -b your_i2c_bus_number</code>
  
 
获取此模块的唯一序列号。
 
获取此模块的唯一序列号。
  
==== timestamp ====
+
=====timestamp=====
 
<code>./gx_mipi_i2c.sh -r timestamp -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r timestamp -b your_i2c_bus_number</code>
  
 
获取系统启动以来的持续时间(以毫秒为单位)。  
 
获取系统启动以来的持续时间(以毫秒为单位)。  
  
==== errcode ====
+
=====errcode=====
预约
+
预留
  
==== fmtcap ====
+
=====fmtcap=====
 
<code>./gx_mipi_i2c.sh -r fmtcap -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r fmtcap -b your_i2c_bus_number</code>
  
Line 114: Line 126:
 
bit2: Mono12
 
bit2: Mono12
  
bit3: Mono14
+
bit3: Mono14 (预留)
  
 
bit4: UYVY
 
bit4: UYVY
Line 120: Line 132:
 
bit5: RGB888
 
bit5: RGB888
  
bit6: Temp
+
bit6: Temp (占位,预留)
  
 
bit7: YUYV
 
bit7: YUYV
  
==== readmodecap ====
+
=====readmodecap=====
 
<code>./gx_mipi_i2c.sh -r readmodecap -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r readmodecap -b your_i2c_bus_number</code>
  
Line 131: Line 143:
 
该相机支持读取模式的功能。
 
该相机支持读取模式的功能。
  
bit0: Normal
+
bit0: 普通模式
  
bit1: binning mode
+
bit1: binning 模式
  
bit2: subsampling mode
+
bit2: subsampling 模式
  
==== workmodecap ====
+
=====workmodecap=====
 
<code>./gx_mipi_i2c.sh -r workmodecap -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r workmodecap -b your_i2c_bus_number</code>
  
Line 154: Line 166:
 
bit4: 多摄像机同步模式。
 
bit4: 多摄像机同步模式。
  
==== lanecap ====
+
=====lanecap=====
 
<code>./gx_mipi_i2c.sh -r lanecap -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r lanecap -b your_i2c_bus_number</code>
  
Line 163: Line 175:
 
例如,0x2 表示支持 2 条通道,而 0xA 则表示支持 2 条通道和 4 条通道。
 
例如,0x2 表示支持 2 条通道,而 0xA 则表示支持 2 条通道和 4 条通道。
  
==== cameramodel0-cameramodel7 ====
+
=====cameramodel0-cameramodel7=====
 
<code>./gx_mipi_i2c.sh -r cameramodel0 -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r cameramodel0 -b your_i2c_bus_number</code>
  
获取相机型号,例如:cameramodel0 的型号为 0x47582d4d(对应的 ASCII 码为“GX-M”)
+
获取相机型号,例如:cameramodel0 的型号为 0x47582d4d(对应的 ASCII 码为“GX-M”)。
  
==== temp ====
+
=====temp=====
 
<code>./gx_mipi_i2c.sh -r temp -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r temp -b your_i2c_bus_number</code>
  
 
当前温度是 25 华氏度。
 
当前温度是 25 华氏度。
  
==== videomodecap ====
+
=====videomodecap=====
 
<code>./gx_mipi_i2c.sh -r videomodecap -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r videomodecap -b your_i2c_bus_number</code>
  
获取视频模式捕获值为 2
+
获取视频模式捕获值为 2
 
{| class="wikitable"
 
{| class="wikitable"
!value
+
!参数
!description
+
!描述
 
|-
 
|-
 
|bit0
 
|bit0
Line 185: Line 197:
 
|-
 
|-
 
|bit1
 
|bit1
|Set the VideoMode mode as the default.
+
|VideoMode模式
 
|}
 
|}
  
==== videomodenum ====
+
=====videomodenum=====
 
<code>./gx_mipi_i2c.sh -r videomodenum -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r videomodenum -b your_i2c_bus_number</code>
  
Get the videomodenum 1
+
获取视频模式 1。
  
==== vidoemodewh1-vidoemodewh8 ====
+
=====vidoemodewh1-vidoemodewh8=====
 
<code>./gx_mipi_i2c.sh -r videomodewh1 -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r videomodewh1 -b your_i2c_bus_number</code>
  
Get the videomodewh1 is  0x7800438 (1920*1080)
+
获取vidoemodewh1 的值为 0x7800438(即 1920*1080)。
  
In the first mode, the width is represented by the high 16 bits and the height by the low 16 bits.
+
在第一种模式中,宽度由高位的 16 位表示,高度由低位的 16 位表示。
  
==== videomodeparam1-videomodeparam8 ====
+
=====videomodeparam1-videomodeparam8=====
 
<code>./gx_mipi_i2c.sh -r videomode_param1 -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r videomode_param1 -b your_i2c_bus_number</code>
  
Get the videomodeparam1 is  0x1003c
+
获取视频模式参数1,其值为 0x1003c。
  
The frame rate and reading method of the first mode. The high 8-bit standby, the middle 8-bit is for reading mode, and the low 16-bit is for the maximum frame rate.
+
第一种模式的帧率和读取方式。高位 8 位为待机状态,中间 8 位用于读取模式,而低位 16 位则用于最大帧率。
 
{| class="wikitable"
 
{| class="wikitable"
!value
+
!参数
!description
+
!描述
 
|-
 
|-
 
|0
 
|0
Line 219: Line 231:
 
|subsampling
 
|subsampling
 
|}
 
|}
==== factoryparam ====
+
=====factoryparam=====
 
<code>./gx_mipi_i2c.sh -w factoryparam -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -w factoryparam -b your_i2c_bus_number</code>
  
All parameters restored to factory default values.
+
所有参数已恢复至出厂默认值。此操作将清除系统闪存并重新写入数据。操作过程中请务必确保电源不会中断。
  
This operation will erase the system flash and rewrite it. Please ensure that the power is not interrupted during the operation.
+
此外,建议不要频繁进行“工厂参数”操作。
  
Additionally, it is recommended not to perform frequent factoryparam operations.
+
=====paramsave=====
==== paramsave ====
 
 
<code>./gx_mipi_i2c.sh -w paramsave -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -w paramsave -b your_i2c_bus_number</code>
  
Save all parameters to flash, and they will not be lost when power off.
+
将所有参数保存至闪存中,这样在断电时这些参数就不会丢失了。
  
This operation will erase the system flash and rewrite it. Please ensure that the power is not interrupted during the operation.
+
此操作将清除系统闪存并重新写入数据。操作过程中请务必确保电源不会中断。
  
Additionally, it is recommended not to perform frequent paramsave operations.
+
此外,建议不要频繁进行参数保存操作。
  
==== reboot ====
+
=====reboot=====
 
<code>./gx_mipi_i2c.sh -w reboot -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -w reboot -b your_i2c_bus_number</code>
  
Reboot the camera.
+
重启摄像机
  
=== Image Acquisition ===
+
====Image Acquisition====
  
==== imgacq ====
+
=====imgacq=====
 
<code>./gx_mipi_i2c.sh -w imgacq  [0/1] -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -w imgacq  [0/1] -b your_i2c_bus_number</code>
  
Start/Stop acquisition
+
开始/停止采集
  
There is no image output after the camera is powered on, which means it is in the '''standby state'''.
+
相机开启后没有图像输出,这意味着它处于待机状态。
  
After writing 1 to this register, it enters the '''running state''' and starts outputting images or waiting for the trigger signal.
+
在向此寄存器写入 1 后,它便进入运行状态,并开始输出图像或者等待触发信号。
  
Writing 0 will stop the output image and enter the standby state.
+
=====workmode=====
 
 
==== workmode ====
 
 
<code>./gx_mipi_i2c.sh -w workmode [0,1,4] -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -w workmode [0,1,4] -b your_i2c_bus_number</code>
  
 
<code>./gx_mipi_i2c.sh -r workmode -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r workmode -b your_i2c_bus_number</code>
 
{| class="wikitable"
 
{| class="wikitable"
!value
+
!参数
!description
+
!描述
 
|-
 
|-
 
|0
 
|0
|Video streaming mode
+
|流模式
 
|-
 
|-
 
|1
 
|1
|Normal trigger mode
+
|触发模式
 
|-
 
|-
 
|4
 
|4
|Multi-camera synchronization mode
+
|多相机同步模式
 
|}
 
|}
See product manual for details.
+
请参阅产品使用手册以获取详细信息。
  
==== trgsrc ====
+
=====trgsrc=====
 
<code>./gx_mipi_i2c.sh -w trgsrc  [0,1] -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -w trgsrc  [0,1] -b your_i2c_bus_number</code>
  
 
<code>./gx_mipi_i2c.sh -r trgsrc -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r trgsrc -b your_i2c_bus_number</code>
 
{| class="wikitable"
 
{| class="wikitable"
!value
+
!参数
!description
+
!描述
 
|-
 
|-
 
|0
 
|0
|Software trigger
+
|软触发
 
|-
 
|-
 
|1
 
|1
|Hardware trigger
+
|硬触发
 
|}
 
|}
  
==== trgnum ====
+
=====trgnum=====
 
<code>./gx_mipi_i2c.sh -w trgnum  [1,255] -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -w trgnum  [1,255] -b your_i2c_bus_number</code>
  
 
<code>./gx_mipi_i2c.sh -r trgnum -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r trgnum -b your_i2c_bus_number</code>
  
The number of image frames output by one trigger signal in trigger mode.
+
在触发模式下,一个触发信号所能输出的图像帧数。
  
==== trginterval ====
+
=====trginterval=====
 
<code>./gx_mipi_i2c.sh -w trginterval [us] -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -w trginterval [us] -b your_i2c_bus_number</code>
  
 
<code>./gx_mipi_i2c.sh -r trginterval -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r trginterval -b your_i2c_bus_number</code>
  
Trigger interval in normal trigger mode, in microseconds. Range:[0.0xFFFFFF].
+
在正常触发模式下的触发间隔,单位为微秒。范围:[0.0xFFFFFF]
  
==== trgone ====
+
=====trgone=====
 
<code>./gx_mipi_i2c.sh -w trgone -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -w trgone -b your_i2c_bus_number</code>
  
Software trigger command.One execution will perform a soft trigger.
+
软件触发命令。执行一次, 将执行一次软触发操作。
  
==== trgcount ====
+
=====trgcount=====
 
<code>./gx_mipi_i2c.sh -r trgcount -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r trgcount -b your_i2c_bus_number</code>
  
Trigger count statistics.
+
触发次数统计。获取触发的总数以及触发的丢失数量。
 
 
Get the total number of triggers and the number of trigger loss.
 
  
 
<code>./gx_mipi_i2c.sh -w trgcount [1] -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -w trgcount [1] -b your_i2c_bus_number</code>
  
Clear trigger count.
+
清除触发次数。
  
==== i2caddr ====
+
=====i2caddr=====
 
<code>./gx_mipi_i2c.sh -w i2caddr  [new] -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -w i2caddr  [new] -b your_i2c_bus_number</code>
  
<code>./gx_mipi_i2c.sh -r i2caddr -b your_i2c_bus_number</code> <br />This module support i2c address changed by software, i2c address range[0x3,0x77].
+
<code>./gx_mipi_i2c.sh -r i2caddr -b your_i2c_bus_number</code> <br />此模块支持通过软件更改 I2C 地址,其 I2C 地址范围为[0x3, 0x77]
  
Will really take effect only after paramsave and reboot .
+
只有在执行了“保存参数”和“重新启动”操作之后,该设置才会真正生效。
  
==== nondiscontinuousmode ====
+
=====nondiscontinuousmode=====
 
<code>./gx_mipi_i2c.sh -w nondiscontinuousmode [0/1] -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -w nondiscontinuousmode [0/1] -b your_i2c_bus_number</code>
  
 
<code>./gx_mipi_i2c.sh -r nondiscontinuousmode -b your_i2c_bus_number</code>  
 
<code>./gx_mipi_i2c.sh -r nondiscontinuousmode -b your_i2c_bus_number</code>  
  
Indicates whether the clock lan of the mipi signal is in continuous clock mode.
+
mipi信号的discontinues模式,0为非连续,1为连续。
 
 
0: discontinuous mode
 
  
1: continuous mode
+
=====slavemode=====
 
 
==== slavemode ====
 
 
<code>./gx_mipi_i2c.sh -w slavemode  [0/1] -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -w slavemode  [0/1] -b your_i2c_bus_number</code>
  
 
<code>./gx_mipi_i2c.sh -r slavemode -b your_i2c_bus_number</code>  
 
<code>./gx_mipi_i2c.sh -r slavemode -b your_i2c_bus_number</code>  
  
Whether the sensor is operating in slave mode. In slave mode, the camera relies on external signals to provide XVS and XHS.  
+
该传感器是否处于从机模式。在从机模式下,相机依靠外部信号来获取 XVS XHS 数据。  
  
Writing this parameter will cause the camera to automatically save the current settings and reboot.
+
设置此参数将使相机自动保存当前设置并重新启动。
  
Currently.  
+
=====framecount=====
 +
<code>./gx_mipi_i2c.sh -r framecount -b your_i2c_bus_number</code> <br />获取到传感器帧数为 434,输出帧数为 436。
  
==== framecount ====
+
传感器帧数:
<code>./gx_mipi_i2c.sh -r framecount -b your_i2c_bus_number</code> <br />Get the  Sensor_Frame_Count is 434 , Out_Frame_Count is 436
 
  
Sensor_Frame_Count:
+
从传感器收集到的帧数会在一个循环中进行计数。仅进行累加操作,不进行清零,并且每秒更新一次。
  
The number of frames collected from the sensor is counted in a loop. Only accumulation is performed without clearing, and it is updated once per second.
+
帧计数:
  
Out_Frame_Count:
+
输出帧的数量是在一个循环中进行计数的。只进行累加操作,不进行清零操作,并且每秒更新一次。
  
The number of frames output is counted in a loop. Only accumulation is performed without clearing, and it is updated once per second.
+
=====triggercyclemin=====
 
 
==== triggercyclemin ====
 
 
<code>./gx_mipi_i2c.sh -r triggercyclemin -b your_i2c_bus_number</code>  
 
<code>./gx_mipi_i2c.sh -r triggercyclemin -b your_i2c_bus_number</code>  
  
Get the Trigger_Cycle_Min is 0
+
触发信号最小周期,us为单位,0表示非法值。电平触发模式时,表示上个触发电平的结束信号到下个触发信号最小间隔。
  
==== daynightmode ====
+
=====daynightmode=====
 
<code>./gx_mipi_i2c.sh -w daynightmode [0,2] -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -w daynightmode [0,2] -b your_i2c_bus_number</code>
  
 
<code>./gx_mipi_i2c.sh -r daynightmode -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r daynightmode -b your_i2c_bus_number</code>
  
daynightmode type
+
彩转黑类型
 
{| class="wikitable"
 
{| class="wikitable"
!value
+
!参数
!description
+
!描述
 
|-
 
|-
 
|0
 
|0
|Color mode
+
|彩色模式
 
|-
 
|-
 
|1
 
|1
|Black and white mode
+
|黑白模式
 
|-
 
|-
 
|2
 
|2
|External trigger mode
+
|外触发模式
 
|}
 
|}
  
==== ircutdir ====
+
=====ircutdir=====
 
<code>./gx_mipi_i2c.sh -w ircutdir [0/1] -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -w ircutdir [0/1] -b your_i2c_bus_number</code>
  
 
<code>./gx_mipi_i2c.sh -r ircutdir -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r ircutdir -b your_i2c_bus_number</code>
  
By default, if the voltage at port A is higher than that at port B (A > B), the IRCUT module will drive the filter to enter the optical path. When the direction is switched so that the voltage at port B becomes higher than that at port A (A < B), the polarity of the electromagnetic coil reverses, and the filter is driven to exit the optical path.
+
默认情况下,如果端口 A 处的电压高于端口 B 处的电压(A > B),IRCUT 模块将驱动滤波器进入光路。当方向改变,使得端口 B 处的电压高于端口 A 处的电压(A < B)时,电磁线圈的极性会反转,滤波器则被驱动退出光路。
  
==== pinpolarity ====
+
=====pinpolarity=====
 
<code>./gx_mipi_i2c.sh -w pinpolarity [0/1] -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -w pinpolarity [0/1] -b your_i2c_bus_number</code>
  
 
<code>./gx_mipi_i2c.sh -r pinpolarity -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r pinpolarity -b your_i2c_bus_number</code>
  
Trigger pin polarity reversal day and night. By default, a low level indicates night. After setting this value to 1, a high level indicates night.
+
触发针极性在白天和夜晚会发生变化。默认情况下,低电平表示夜晚。将此值设置为 1 后,高电平则表示夜晚。
  
==== ircuttimer ====
+
=====ircuttimer=====
 
<code>./gx_mipi_i2c.sh -w ircuttimer [0/1] -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -w ircuttimer [0/1] -b your_i2c_bus_number</code>
  
 
<code>./gx_mipi_i2c.sh -r ircuttimer -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r ircuttimer -b your_i2c_bus_number</code>
  
Whether to enable IRCUT periodic control; If enabled, IRCUT control will be performed according to the default cycle. If not enabled, control will only be carried out once during mode switching.
+
是否启用IRCUT周期性控制;如启用则按照默认周期(10秒)进行IRCUT控制,如不启用,则只在模式切换的时候做一次控制。
  
=== Image Properties ===
+
====Image Properties====
  
==== testimg ====
+
=====testimg=====
 
<code>./gx_mipi_i2c.sh -w testimg [0/1] -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -w testimg [0/1] -b your_i2c_bus_number</code>
  
 
<code>./gx_mipi_i2c.sh -r testimg -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r testimg -b your_i2c_bus_number</code>
 
{| class="wikitable"
 
{| class="wikitable"
!value
+
!参数
!description
+
!描述
 
|-
 
|-
 
|0
 
|0
|Common image
+
|普通图像
 
|-
 
|-
 
|1
 
|1
|Vertical color stripes
+
|竖向彩条
 
|}
 
|}
  
==== pixelformat ====
+
=====pixelformat=====
 
<code>./gx_mipi_i2c.sh -w pixelformat [4/5/6/7] -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -w pixelformat [4/5/6/7] -b your_i2c_bus_number</code>
  
 
<code>./gx_mipi_i2c.sh -r pixelformat -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r pixelformat -b your_i2c_bus_number</code>
 
{| class="wikitable"
 
{| class="wikitable"
!value
+
!参数
!description
+
!描述
 +
|-
 +
|0
 +
|Mono8
 +
|-
 +
|1
 +
|Mono10
 +
|-
 +
|2
 +
|Mono12
 +
|-
 +
|3
 +
|Mono14 (预留)
 
|-
 
|-
 
|4
 
|4
Line 436: Line 449:
 
|-
 
|-
 
|6
 
|6
|Temp
+
|Temp (预留)
 
|-
 
|-
 
|7
 
|7
Line 442: Line 455:
 
|}
 
|}
  
==== maxwh ====
+
=====maxwh=====
 
<code>./gx_mipi_i2c.sh -r maxwh -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r maxwh -b your_i2c_bus_number</code>
  
Get the maximum width and height supported by the sensor
+
获取该传感器所能支持的最大宽度和高度。
  
==== minwh ====
+
=====minwh=====
 
<code>./gx_mipi_i2c.sh -r minwh -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r minwh -b your_i2c_bus_number</code>
  
Get the minimum width and height supported by the camera.
+
获取该相机所能支持的最小宽度和高度。
  
==== maxfps ====
+
=====maxfps=====
 
<code>./gx_mipi_i2c.sh -r maxfps -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r maxfps -b your_i2c_bus_number</code>
  
The maximum frame rate supported in the current mode.
+
当前模式所能支持的最大帧率。
  
Depending on the configured ROI, the maximum frame rate will be different. This parameter supports decimals.
+
根据所设定的感兴趣区域(ROI),最大帧率会有所不同,此参数支持小数。
  
==== minfps ====
+
=====minfps=====
 
<code>./gx_mipi_i2c.sh -r minfps -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r minfps -b your_i2c_bus_number</code>
  
Read the minimum frame rate supported by the current module.
+
读取当前模块所支持的最低帧率。
  
==== curwh ====
+
=====curwh=====
 
<code>./gx_mipi_i2c.sh -r curwh -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r curwh -b your_i2c_bus_number</code>
  
Get the current width and height
+
获取当前的宽度和高度。
  
==== imgdir ====
+
=====imgdir=====
 
<code>./gx_mipi_i2c.sh -r imgdir -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r imgdir -b your_i2c_bus_number</code>
  
 
<code>./gx_mipi_i2c.sh -w imgdir [0/1/2/3] -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -w imgdir [0/1/2/3] -b your_i2c_bus_number</code>
  
Image orientation:
+
图像方向:
 
{| class="wikitable"
 
{| class="wikitable"
!value
+
!参数
!description
+
!描述
 
|-
 
|-
 
|0
 
|0
|normal
+
|正常
 
|-
 
|-
 
|1
 
|1
|mirror
+
|镜像
 
|-
 
|-
 
|2
 
|2
|flip
+
|翻转
 
|-
 
|-
 
|3
 
|3
|flip&mirror
+
|翻转与镜像
 
|}
 
|}
  
==== videomode ====
+
=====videomode=====
 
<code>./gx_mipi_i2c.sh -r videomode -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r videomode -b your_i2c_bus_number</code>
  
<code>./gx_mipi_i2c.sh -w videomode [1-8] -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -w videomode [0-7] -b your_i2c_bus_number</code>
  
For cameras that use the VideoMode mode to select the frame rate of width and height, which mode should be chosen? The corresponding capability set is VideomodeCap. Range [1-8]
+
对于使用VideoMode模式选择宽高帧率的相机,选择哪个模式,范围[0-7]。对应能力集为VideomodeCap 。
  
==== readmode ====
+
=====readmode=====
 
<code>./gx_mipi_i2c.sh -r readmode -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r readmode -b your_i2c_bus_number</code>
  
image model:
+
图像模式:
 
{| class="wikitable"
 
{| class="wikitable"
!value
+
!参数
!description
+
!描述
 
|-
 
|-
 
|0
 
|0
|normal mode
+
|normal 模式
 
|-
 
|-
 
|1
 
|1
|2x2binning mode
+
|2x2binning 模式
 
|-
 
|-
 
|2
 
|2
|subsampling mode
+
|subsampling 模式
 
|}
 
|}
  
==== lanenum ====
+
=====lanenum=====
 
<code>./gx_mipi_i2c.shsh -r lanenum -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.shsh -r lanenum -b your_i2c_bus_number</code>
  
Configuration of the number of LANs outputting MIPI signals
+
输出 MIPI 信号的局域网数量的配置。
 
{| class="wikitable"
 
{| class="wikitable"
!value
+
!参数
!description
+
!描述
 
|-
 
|-
 
|2
 
|2
Line 532: Line 545:
 
|}
 
|}
  
==== mipidatarate ====
+
=====mipidatarate=====
 
<code>./gx_mipi_i2c.shh -r mipidatarate -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.shh -r mipidatarate -b your_i2c_bus_number</code>
  
The rate of each LAN in the MIPI system is measured in kbps.
+
mipi每一个lan的速率,kbps为单位。
  
==== fps ====
+
=====fps=====
 
<code>./gx_mipi_i2c.sh -r fps -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r fps -b your_i2c_bus_number</code>
  
 
<code>./gx_mipi_i2c.sh -w fps -b [framerate] your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -w fps -b [framerate] your_i2c_bus_number</code>
  
Configure the actual frame rate of the camera in the current mode.
+
在当前模式下设置相机的实际帧率。
  
Range:(0,maxfps].
+
范围:(0,最大帧率]
  
In video streaming mode, this parameter determines the actual frame rate.
+
在视频流模式下,此参数决定了实际的帧率。
  
In normal trigger mode, it is recommended to set the '''fps''' to the '''maxfps''' value to ensure the highest trigger signal responsiveness.
+
在常规触发模式下,建议将帧率设置为最高帧率值,以确保触发信号的响应速度达到最佳。
  
=== Image Processing ===
+
====Image Processing====
  
==== expmode ====
+
=====expmode=====
 
<code>./gx_mipi_i2c.sh -r expmode -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r expmode -b your_i2c_bus_number</code>
  
Line 559: Line 572:
 
Exposure type
 
Exposure type
 
{| class="wikitable"
 
{| class="wikitable"
!value
+
!参数
!description
+
!描述
 
|-
 
|-
 
|0
 
|0
|manual exposure
+
|手动曝光
 
|-
 
|-
 
|2
 
|2
|auto exposure
+
|自动曝光
 
|}
 
|}
  
==== aetarget ====
+
=====aetarget=====
 
<code>./gx_mipi_i2c.sh -r aetarget -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r aetarget -b your_i2c_bus_number</code>
  
 
<code>./gx_mipi_i2c.sh -w aetarget  [0,255] -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -w aetarget  [0,255] -b your_i2c_bus_number</code>
  
The target brightness of AE and AG algorithm.
+
AE 算法的目标亮度。
  
Within the set range, the algorithm will prioritize the increase in exposure time,
+
在设定的范围内,该算法会优先考虑增加曝光时间。
  
and increase the gain if the exposure time reaches the maximum and still cannot reach the set target brightness value.
+
并且如果曝光时间达到最大值但仍未达到设定的目标亮度值,就应增加增益。
  
==== aestrategy ====
+
=====aestrategy=====
 
<code>./gx_mipi_i2c.sh -r aestrategy -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r aestrategy -b your_i2c_bus_number</code>
  
 
<code>./gx_mipi_i2c.sh -w aestrategy [0/1] -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -w aestrategy [0/1] -b your_i2c_bus_number</code>
  
Automatic exposure strategy
+
自动曝光策略:
 
{| class="wikitable"
 
{| class="wikitable"
!value
+
!参数
!description
+
!描述
 
|-
 
|-
 
|0
 
|0
|Bright Area Priority mode (High Light priority
+
|亮区优先模式(高光优先)
 
|-
 
|-
 
|1
 
|1
|Dark zone priority mode (low light priority)
+
|暗区优先模式(低光优先)
 
|}
 
|}
  
==== metime ====
+
=====metime=====
 
<code>./gx_mipi_i2c.sh -r metime -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r metime -b your_i2c_bus_number</code>
  
 
<code>./gx_mipi_i2c.sh -w metime [us] -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -w metime [us] -b your_i2c_bus_number</code>
  
Range (0,1000000/fps].Because of <u>Note1</u> and range limitation, please read back to confirm the real metime take effect.
+
手动曝光时间。
  
Unit: microseconds.
+
范围:16 至 1,000,000/帧率(单位:微秒)。
  
==== aemaxtime ====
+
=====aemaxtime=====
 
<code>./gx_mipi_i2c.sh -r aemaxtime -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r aemaxtime -b your_i2c_bus_number</code>
  
 
<code>./gx_mipi_i2c.sh -w aemaxtime [16,1000000/fps] -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -w aemaxtime [16,1000000/fps] -b your_i2c_bus_number</code>
  
Automatic maximum exposure time range: 16 to 1,000,000/fps (unit: microseconds)
+
自动最大曝光时间。
 +
 
 +
范围:16 至 1,000,000/帧率(单位:微秒)。
  
==== exptime ====
+
=====exptime=====
 
<code>./gx_mipi_i2c.sh -r exptime -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r exptime -b your_i2c_bus_number</code>
  
Get the current exposure time. This command is valid in any exposure mode.
+
获取当前曝光时间。此命令在任何曝光模式下均有效。
 
 
Unit: microseconds.
 
  
==== curgain ====
+
=====curgain=====
 
<code>./gx_mipi_i2c.sh -r curgain -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r curgain -b your_i2c_bus_number</code>
  
Gets the current gain. This command is valid in any exposure mode.
+
获取当前增益值。此命令在任何曝光模式下均有效。
  
==== mgain ====
+
=====mgain=====
 
<code>./gx_mipi_i2c.sh -r mgain -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r mgain -b your_i2c_bus_number</code>
  
 
<code>./gx_mipi_i2c.sh -w mgain [gain] -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -w mgain [gain] -b your_i2c_bus_number</code>
  
The manual gain value, range and step size vary by model.
+
手动增益值,范围和步长根据型号不同。
  
==== aemaxgain ====
+
=====aemaxgain=====
 
<code>./gx_mipi_i2c.sh -r aemaxgain -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r aemaxgain -b your_i2c_bus_number</code>
  
 
<code>./gx_mipi_i2c.sh -w aemaxgain  [0,maxgain] -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -w aemaxgain  [0,maxgain] -b your_i2c_bus_number</code>
  
Maximum value of auto gain. The range and step vary according to the model.
+
自动增益的最大值。其范围和步长会因型号不同而有所差异。
 
 
Most sensors have a gain step of 0.1dB, some are 0.3dB.
 
  
==== wbmode ====
+
=====wbmode=====
 
<code>./gx_mipi_i2c.sh -r wbmode -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r wbmode -b your_i2c_bus_number</code>
  
 
<code>./gx_mipi_i2c.sh -w wbmode [0/2] -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -w wbmode [0/2] -b your_i2c_bus_number</code>
  
wbmode type
+
白平衡 类型
 
{| class="wikitable"
 
{| class="wikitable"
!value
+
!参数
!description
+
!描述
 
|-
 
|-
 
|0
 
|0
|manual white balance
+
|手动白平衡
 
|-
 
|-
 
|2
 
|2
|auto white balance
+
|自动白平衡
 
|}
 
|}
  
==== awbcolortempmin ====
+
=====awbcolortempmin=====
 
<code>./gx_mipi_i2c.sh -r awbcolortempmin -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r awbcolortempmin -b your_i2c_bus_number</code>
  
 
<code>./gx_mipi_i2c.sh -w awbcolortempmin [1000,15000] -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -w awbcolortempmin [1000,15000] -b your_i2c_bus_number</code>
  
White balance minimum color temperature (K),Range[1000,15000].
+
白平衡最低色温(开尔文单位),范围[1000,15000]
  
==== awbcolortempmax ====
+
=====awbcolortempmax=====
 
<code>./gx_mipi_i2c.sh -r awbcolortempmax -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r awbcolortempmax -b your_i2c_bus_number</code>
  
 
<code>./gx_mipi_i2c.sh -w awbcolortempmax [1000,15000] -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -w awbcolortempmax [1000,15000] -b your_i2c_bus_number</code>
  
White balance maximum color temperature (K),Range[1000,15000].
+
白平衡最高色温(开尔文单位),范围[1000,15000]
  
==== mwbbgain ====
+
=====mwbbgain=====
 
<code>./gx_mipi_i2c.sh -r mwbbgain -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r mwbbgain -b your_i2c_bus_number</code>
  
 
<code>./gx_mipi_i2c.sh -w mwbbgain [0,4095] -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -w mwbbgain [0,4095] -b your_i2c_bus_number</code>
  
Manual white balance B gain [0,4095]
+
手动白平衡 B 增益 [0, 4095]
  
==== mwbrgain ====
+
=====mwbrgain=====
 
<code>./gx_mipi_i2c.sh -r mwbrgain -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r mwbrgain -b your_i2c_bus_number</code>
  
 
<code>./gx_mipi_i2c.sh -w mwbrgain [0,4095] -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -w mwbrgain [0,4095] -b your_i2c_bus_number</code>
  
Manual white balance R gain [0,4095]
+
手动白平衡 R 增益 [0, 4095]
  
==== colortemp ====
+
=====colortemp=====
 
<code>./gx_mipi_i2c.sh -r colortemp -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r colortemp -b your_i2c_bus_number</code>
  
Current color temperature (k)
+
当前色温(开尔文单位)。
  
==== currgain ====
+
=====currgain=====
 
<code>./gx_mipi_i2c.sh -r currgain -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r currgain -b your_i2c_bus_number</code>
  
Current white balance R gain [0,4095]
+
当前白平衡 R 调整值 [0, 4095]
  
==== curbgain ====
+
=====curbgain=====
 
<code>./gx_mipi_i2c.sh -r curbgain -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r curbgain -b your_i2c_bus_number</code>
  
Current white balance B gain [0,4095]
+
当前白平衡 B 调整值 [0, 4095]
  
==== aemintime ====
+
=====aemintime=====
 
<code>./gx_mipi_i2c.sh -r aemintime -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r aemintime -b your_i2c_bus_number</code>
  
 
<code>./gx_mipi_i2c.sh -w aemintime [16,1000000/fps] -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -w aemintime [16,1000000/fps] -b your_i2c_bus_number</code>
  
Automatic minimum exposure time range: 16 to 1,000,000/fps (unit: microseconds)
+
自动最小曝光时间范围:16 至 1,000,000/帧率(单位:微秒)。
  
==== gamma_index ====
+
=====gamma_index=====
 
<code>./gx_mipi_i2c.sh -r gamma_index -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r gamma_index -b your_i2c_bus_number</code>
  
 
<code>./gx_mipi_i2c.sh -w gamma_index [0,12] -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -w gamma_index [0,12] -b your_i2c_bus_number</code>
  
The GX series has preset gamma options, with different values representing different gamma settings:
+
GX 系列具有预设的gamma值选项,不同的数值代表不同的gamma设置:
  
0: Gamma off, that is, linear format.
+
0: Gamma 为零,即采用线性格式。
  
1: Default gamma.
+
1: 默认 gamma.
  
 
2: gamma_1.6
 
2: gamma_1.6
Line 739: Line 750:
 
11: Style 6
 
11: Style 6
  
12: User-defined gamma (TODO)
+
12: 用户自定义 (TODO)
  
==== antiflicker ====
+
=====antiflicker=====
 
<code>./gx_mipi_i2c.sh -r antiflicker -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r antiflicker -b your_i2c_bus_number</code>
  
 
<code>./gx_mipi_i2c.sh -w antiflicker [0/1] [50/60/100/120/200/240] -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -w antiflicker [0/1] [50/60/100/120/200/240] -b your_i2c_bus_number</code>
  
param1:Whether the antiflicker function is enabled [0/1]
+
参数 1:抗闪烁功能是否启用 [0/1]
  
param2:Frame rate [50/60/100/120/200/240]
+
参数 2:Antiflicker freq频率。可选值50,60,100,120,200,240。设置后,相机曝光时间将遵循(1s/(freq*2))的整数倍,以避免出现条纹。建议灯光更强的时候,使用更大的值,避免过曝。
  
==== wdrparam ====
+
=====wdrparam=====
 
<code>./gx_mipi_i2c.sh -r wdrparam -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r wdrparam -b your_i2c_bus_number</code>
  
 
<code>./gx_mipi_i2c.sh -w wdrparam [0/1] [0,255] -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -w wdrparam [0/1] [0,255] -b your_i2c_bus_number</code>
  
param1:Whether the WDR function is enabled [0/1]
+
参数1:WDR 功能是否已启用 [0/1]
  
param2:WDR intensity [0-255]
+
参数 2:WDR 强度(取值范围:0 - 255)。
  
==== sharppen ====
+
=====sharppen=====
 
<code>./gx_mipi_i2c.sh -r sharppen -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r sharppen -b your_i2c_bus_number</code>
  
 
<code>./gx_mipi_i2c.sh -w sharppen [0,255] -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -w sharppen [0,255] -b your_i2c_bus_number</code>
  
Sharpening intensity [0-255]
+
锐化强度 [0 - 255]
  
==== denoise_strength_2D ====
+
=====denoise2d=====
<code>./gx_mipi_i2c.sh -r denoise_strength_2D -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -r denoise2d -b your_i2c_bus_number</code>
  
<code>./gx_mipi_i2c.sh -w denoise_strength_2D [0,255] -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -w denoise2d [0,255] -b your_i2c_bus_number</code>
  
2D noise reduction intensity [0-255]
+
2D 噪声降低强度 [0 - 255]
  
==== denoise_strength_3D ====
+
=====denoise3d=====
<code>./gx_mipi_i2c.sh -r denoise_strength_3D -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -r denoise3d -b your_i2c_bus_number</code>
  
<code>./gx_mipi_i2c.sh -w denoise_strength_3D [0,255] -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -w denoise3d [0,255] -b your_i2c_bus_number</code>
  
3D noise reduction intensity [0-255]
+
3D 噪声降低强度[0-255]
  
==== saturation ====
+
=====saturation=====
 
<code>./gx_mipi_i2c.sh -r saturation -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r saturation -b your_i2c_bus_number</code>
  
 
<code>./gx_mipi_i2c.sh -w saturation [0,100] -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -w saturation [0,100] -b your_i2c_bus_number</code>
  
Saturation [0-100]  
+
饱和度 [0 - 100]
  
==== contrast ====
+
=====contrast=====
 
<code>./gx_mipi_i2c.sh -r contrast -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r contrast -b your_i2c_bus_number</code>
  
 
<code>./gx_mipi_i2c.sh -w contrast [0,100] -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -w contrast [0,100] -b your_i2c_bus_number</code>
  
contrast [0-100]  
+
对比度 [0-100]
  
==== hue ====
+
=====hue=====
 
<code>./gx_mipi_i2c.sh -r hue -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r hue -b your_i2c_bus_number</code>
  
 
<code>./gx_mipi_i2c.sh -w hue [0-100] -b your_i2c_bus_number</code>  
 
<code>./gx_mipi_i2c.sh -w hue [0-100] -b your_i2c_bus_number</code>  
  
hue [0-100]  
+
色温 [0-100]
  
==== slowshutter ====
+
=====slowshutter=====
 
<code>./gx_mipi_i2c.sh -r slowshutter -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r slowshutter -b your_i2c_bus_number</code>
  
<code>./gx_mipi_i2c.sh -w slowshutter [0/1] [200] -b your_i2c_bus_number</code>
+
<code>./gx_mipi_i2c.sh -w slowshutter [0/1] [20] -b your_i2c_bus_number</code>
 +
 
 +
参数 1 : 采用自动降帧模式(1)还是固定帧率模式(0)。
  
Is the automatic frame reduction function for parameter 1 enabled?
+
参数 2 : 设定自动降帧模式下开始降帧的增益阈值。其单位为 0.1 分贝。
  
Parameter 2 sets the gain threshold for automatically reducing frames. The unit is 0.1 dB.
+
注意:自动降帧模式仅在自动曝光模式 + 视频流模式下有效。使用功能使用时,需要最大曝光时间(aemaxtime)配合使用。
  
Note: This setting is only effective in the automatic exposure mode + video stream mode. It determines whether the Aemode is in the fixed frame rate mode or the automatic frame reduction mode.
+
自动降帧模式下,自动曝光调节时会优先增大曝光时间来尽量减小增益。当 sensor 增益达到用户设置的最大值(参数2)时,自动曝光算法会逐渐降帧率并延长曝光时间,持续到曝光时间等于自动曝光的最大时间(aemaxtime)为止。低照度环境下噪声较小但帧率会降低。
  
==== ldc ====
+
=====ldc=====
 
<code>./gx_mipi_i2c.sh -r ldc -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r ldc -b your_i2c_bus_number</code>
  
 
<code>./gx_mipi_i2c.sh -w ldc [0,255] -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -w ldc [0,255] -b your_i2c_bus_number</code>
  
Lens Distortion Correction [0-255], abbreviated as LDC, with 0 indicating disable.
+
镜头畸变校正 [0 - 255],简称为 LDC,其中 0 表示禁用。
  
==== lsc ====
+
注:该功能设置参数一定要在相机采集图像之前设置才会有效。
<code>./gx_mipi_i2c.sh -r lsc -b your_i2c_bus_number</code>
 
  
<code>./gx_mipi_i2c.sh -w lsc [0,255] -b your_i2c_bus_number</code>
+
=====dehaze=====
 +
<code>./gx_mipi_i2c.sh -r dehaze -b your_i2c_bus_number</code>
  
Lens Shadow Correction [0-255], abbreviated as LSC, with 0 indicating off.
+
<code>./gx_mipi_i2c.sh -w dehaze [0,255] -b your_i2c_bus_number</code>
  
==== dehazeparam ====
+
除雾强度 [0 - 255],0 表示关闭状态。
<code>./gx_mipi_i2c.sh -r dehazeparam -b your_i2c_bus_number</code>
 
  
<code>./gx_mipi_i2c.sh -w dehazeparam [0,255] -b your_i2c_bus_number</code>
+
=====drc=====
 
 
Defogging intensity [0-255], 0 indicates off.
 
 
 
==== drc ====
 
 
<code>./gx_mipi_i2c.sh -r drc -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r drc -b your_i2c_bus_number</code>
  
 
<code>./gx_mipi_i2c.sh -w drc [0,255] -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -w drc [0,255] -b your_i2c_bus_number</code>
  
Digital wide dynamic range. Range [0-255], 0 indicates off.
+
数字宽动态范围。范围为[0-255],0 表示关闭。
  
=== IO Control ===
+
====IO Control====
  
==== trgdelay ====
+
=====trgdelay=====
 
<code>./gx_mipi_i2c.sh -r trgdelay -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r trgdelay -b your_i2c_bus_number</code>
  
 
<code>./gx_mipi_i2c.sh -w trgdelay  [0,1000000] -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -w trgdelay  [0,1000000] -b your_i2c_bus_number</code>
  
Trigger delay, effective under both soft trigger and hard trigger mode.
+
触发延迟,在软触发和硬触发模式下均有效。
  
range: 0 to 1000000 (unit: microsecond)
+
范围:0 到 1000000(单位:微秒)。
  
==== trgedge ====
+
=====trgedge=====
 
<code>./gx_mipi_i2c.sh -r trgedge -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r trgedge -b your_i2c_bus_number</code>
  
 
<code>./gx_mipi_i2c.sh -w trgedge  [0,1] -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -w trgedge  [0,1] -b your_i2c_bus_number</code>
  
Effective trigger edge in hard trigger mode.
+
在硬触发模式下具有有效的触发边沿。
 
{| class="wikitable"
 
{| class="wikitable"
!value
+
!参数
!description
+
!描述
 
|-
 
|-
 
|0
 
|0
|Rising edge
+
|上升沿触发
 
|-
 
|-
 
|1
 
|1
|Falling edge
+
|下降沿触发
 
|}
 
|}
  
==== trgexp_delay ====
+
=====trgexp_delay=====
 
<code>./gx_mipi_i2c.sh -r trgexp_delay -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r trgexp_delay -b your_i2c_bus_number</code>
  
 
<code>./gx_mipi_i2c.sh -w trgexp_delay  [0,100000] -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -w trgexp_delay  [0,100000] -b your_i2c_bus_number</code>
  
Exposure delay, i.e. the time to turn on the Strobe signal in advance.
+
曝光延迟,即提前开启闪光信号所需的时间。
  
range: 0 to 1000000 (unit: microsecond)
+
范围:0 到 1000000(单位:微秒)。
  
The difference between trgexp_delay and trgdelay, see manual for details.
+
trgexp_delay trgdelay 之间的区别,请参阅手册以获取详细信息。
  
==== outio1_rvs ====
+
=====outio1_rvs=====
 
<code>./gx_mipi_i2c.sh -r outio1_rvs -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -r outio1_rvs -b your_i2c_bus_number</code>
  
 
<code>./gx_mipi_i2c.sh -w outio1_rvs  [0,1] -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -w outio1_rvs  [0,1] -b your_i2c_bus_number</code>
  
Reverse OUT_IO1 high and low levels if set to 1.
+
如果将 OUT_IO1 设为 1,当前输出信号取反。
  
<br />
+
===Notes===
 +
注1:曝光时间的所有参数均以微秒为单位。然而,由于传感器的特性,传感器的实际曝光时间单位为 1 行,无法精确到 1 微秒。
  
==== Notes ====
+
===典型应用场景的配置方法:===
Note1: All parameters of exposure time are in microseconds. However, due to the properties of the sensor, the actual exposure time unit of the sensor is 1 line, can not be accurate to 1us.
 
  
=== Configuration Method for Typical Application Scenarios: ===
+
====流模式:====
 
 
==== Stream mode: ====
 
 
 <code>./gx_mipi_i2c.sh -w imgacq  1 -b your_i2c_bus_number</code>
 
 <code>./gx_mipi_i2c.sh -w imgacq  1 -b your_i2c_bus_number</code>
  
==== Trigger mode: ====
+
====触发模式:====
 
<code>./gx_mipi_i2c.sh -w imgacq 0 -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -w imgacq 0 -b your_i2c_bus_number</code>
  
Line 909: Line 915:
 
<code>./gx_mipi_i2c.sh -w trgone -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -w trgone -b your_i2c_bus_number</code>
  
According to the above command, you can take a picture.
+
根据上述指令,您可以拍照了。
  
==== Sync mode: ====
+
====同步模式:====
Note: The synchronous mode requires two cameras.
+
注意:同步模式需要两部摄像机。
  
 
<code>./gx_mipi_i2c.sh -w slavemode 0 -b your_i2c_bus_number</code>
 
<code>./gx_mipi_i2c.sh -w slavemode 0 -b your_i2c_bus_number</code>
Line 930: Line 936:
 
./veye_raspipreview -cs 0 -p '600,0,1280,720' -t -1
 
./veye_raspipreview -cs 0 -p '600,0,1280,720' -t -1
  
After completing the above configuration, you can proceed to start capturing images.
+
完成上述配置后,您就可以开始进行图像采集了。
 
 
Please note that if you need to adjust the frame rate during the image acquisition process, you must first stop the acquisition before making the changes.  
 
  
After stopping the acquisition, the camera will still complete the capture of the current frame.
+
请注意,如果在图像采集过程中需要调整帧率,必须先停止采集操作,然后再进行相关设置。在停止采集操作后,相机仍会完成当前帧的采集工作。
  
The newly set parameters will only take effect afterward.<br />
+
新的设定参数要到之后才会生效。<br />

Latest revision as of 09:34, 4 January 2026

English

gx_mipi_i2c.sh Shell 脚本用法

1 概述

gx_mipi_i2c.sh 脚本是一组用于通过 I2C 配置 GX MIPI 系列相机的工具。

此脚本本质上是对寄存器的访问。有关寄存器,请参阅 GX 系列 MIPI 摄像头寄存器映射表

2 下载

我们为不同的嵌入式平台提供 gx_mipi_i2c.sh 的下载链接。

通常,这些链接可以在相应平台的 GitHub 代码库中找到。

以下是脚本命令:

3 准备工作

cd gx_tools_rpi/sources/

./make.sh

cd ..

chmod +x *

4 gx_mipi_i2c.sh 用法

$ ./gx_mipi_i2c.sh

Usage:  ./gx_mipi_i2c.sh [-r/w]  [function name] [param1] [param2 ] [param3] [param4] -b bus

options:

    -r                       read

    -w                       write

    [function name]       function name

    [param1]                        param1 of each function

    [param1]                        param2 of each function

    [param3]                        param3 of each function

    [param4]                        param4 of each function

    -b [i2c bus num]               i2c bus number

    -d [i2c addr]                  i2c addr if not default 0x3b

Please open this srcipt and read the COMMENT on top for support functions and samples

5 不同主板上的 I2C 总线编号

请参考以下文章来确定您需要使用哪个 -b 参数。

I2C 总线编号查询

6 脚本使用常见问题

1.当i2c不通时会有以下提示信息

./i2c_functions.sh: line 235: Read i2c err: syntax error in expression (error token is "i2c err")

2.当执行脚本找不到可执行的二进制文件时会有以下提示

❌ Error: Required tool not found or not executable: /home/pi/nveye_tools/i2c_vread

❌ Error: Required tool not found or not executable: /home/pi/nveye_tools/i2c_vwrite

7 功能列表

7.1 注:

该相机有两种状态,即待机状态和运行状态。在开始图像采集后,相机就会进入运行状态。

在运行状态下,有一些寄存器是被写保护的,它们会用星号进行标记。例如:trgsrc* 。

有些参数有严格的范围限制,当你不确定时,不妨先尝试查看一下这些参数。

7.2 基本参数

7.2.1 manufacturer

./gx_mipi_i2c.sh -r manufacturer -b your_i2c_bus_number

获取制造商名称,VEYE.

7.2.2 model

./gx_mipi_i2c.sh -r model -b your_i2c_bus_number

获取产品型号,例如 GX-MIPI-IMX662.

7.2.3 sensorname

./gx_mipi_i2c.sh -r sensorname -b your_i2c_bus_number

获取传感器型号,例如 IMX662-AAQR.

7.2.4 version

./gx_mipi_i2c.sh -r version -b your_i2c_bus_number

获取控制器版本号和逻辑版本号。

该系统有两个主要的控制芯片,分别负责控制和逻辑运算功能。

7.2.5 serialno

./gx_mipi_i2c.sh -r serialno -b your_i2c_bus_number

获取此模块的唯一序列号。

7.2.6 timestamp

./gx_mipi_i2c.sh -r timestamp -b your_i2c_bus_number

获取系统启动以来的持续时间(以毫秒为单位)。

7.2.7 errcode

预留

7.2.8 fmtcap

./gx_mipi_i2c.sh -r fmtcap -b your_i2c_bus_number

该模块支持多种数据格式

相机所支持的数据格式的能力。

bit0: Mono8

bit1: Mono10

bit2: Mono12

bit3: Mono14 (预留)

bit4: UYVY

bit5: RGB888

bit6: Temp (占位,预留)

bit7: YUYV

7.2.9 readmodecap

./gx_mipi_i2c.sh -r readmodecap -b your_i2c_bus_number

传感器会读取所设定的模式能力集。

该相机支持读取模式的功能。

bit0: 普通模式

bit1: binning 模式

bit2: subsampling 模式

7.2.10 workmodecap

./gx_mipi_i2c.sh -r workmodecap -b your_i2c_bus_number

获取视频流模式功能设置

该相机支持的触发模式功能。

bit0: 视频流模式

bit1: 普通触发模式

bit2: 滚动快门多帧触发模式。

bit3: 脉冲触发模式。

bit4: 多摄像机同步模式。

7.2.11 lanecap

./gx_mipi_i2c.sh -r lanecap -b your_i2c_bus_number

获取该摄像头所支持的 MIPI 通道数量,该相机所支持的 MIPI 通道数量。

较低位到较高位依次对应着单通道、双通道、三通道和四通道所支持的功能。

例如,0x2 表示支持 2 条通道,而 0xA 则表示支持 2 条通道和 4 条通道。

7.2.12 cameramodel0-cameramodel7

./gx_mipi_i2c.sh -r cameramodel0 -b your_i2c_bus_number

获取相机型号,例如:cameramodel0 的型号为 0x47582d4d(对应的 ASCII 码为“GX-M”)。

7.2.13 temp

./gx_mipi_i2c.sh -r temp -b your_i2c_bus_number

当前温度是 25 华氏度。

7.2.14 videomodecap

./gx_mipi_i2c.sh -r videomodecap -b your_i2c_bus_number

获取视频模式捕获值为 2 。

参数 描述
bit0 ROI模式
bit1 VideoMode模式
7.2.15 videomodenum

./gx_mipi_i2c.sh -r videomodenum -b your_i2c_bus_number

获取视频模式 1。

7.2.16 vidoemodewh1-vidoemodewh8

./gx_mipi_i2c.sh -r videomodewh1 -b your_i2c_bus_number

获取vidoemodewh1 的值为 0x7800438(即 1920*1080)。

在第一种模式中,宽度由高位的 16 位表示,高度由低位的 16 位表示。

7.2.17 videomodeparam1-videomodeparam8

./gx_mipi_i2c.sh -r videomode_param1 -b your_i2c_bus_number

获取视频模式参数1,其值为 0x1003c。

第一种模式的帧率和读取方式。高位 8 位为待机状态,中间 8 位用于读取模式,而低位 16 位则用于最大帧率。

参数 描述
0 ordinary
1 binning
2 subsampling
7.2.18 factoryparam

./gx_mipi_i2c.sh -w factoryparam -b your_i2c_bus_number

所有参数已恢复至出厂默认值。此操作将清除系统闪存并重新写入数据。操作过程中请务必确保电源不会中断。

此外,建议不要频繁进行“工厂参数”操作。

7.2.19 paramsave

./gx_mipi_i2c.sh -w paramsave -b your_i2c_bus_number

将所有参数保存至闪存中,这样在断电时这些参数就不会丢失了。

此操作将清除系统闪存并重新写入数据。操作过程中请务必确保电源不会中断。

此外,建议不要频繁进行参数保存操作。

7.2.20 reboot

./gx_mipi_i2c.sh -w reboot -b your_i2c_bus_number

重启摄像机

7.3 Image Acquisition

7.3.1 imgacq

./gx_mipi_i2c.sh -w imgacq [0/1] -b your_i2c_bus_number

开始/停止采集

相机开启后没有图像输出,这意味着它处于待机状态。

在向此寄存器写入 1 后,它便进入运行状态,并开始输出图像或者等待触发信号。

7.3.2 workmode

./gx_mipi_i2c.sh -w workmode [0,1,4] -b your_i2c_bus_number

./gx_mipi_i2c.sh -r workmode -b your_i2c_bus_number

参数 描述
0 流模式
1 触发模式
4 多相机同步模式

请参阅产品使用手册以获取详细信息。

7.3.3 trgsrc

./gx_mipi_i2c.sh -w trgsrc [0,1] -b your_i2c_bus_number

./gx_mipi_i2c.sh -r trgsrc -b your_i2c_bus_number

参数 描述
0 软触发
1 硬触发
7.3.4 trgnum

./gx_mipi_i2c.sh -w trgnum [1,255] -b your_i2c_bus_number

./gx_mipi_i2c.sh -r trgnum -b your_i2c_bus_number

在触发模式下,一个触发信号所能输出的图像帧数。

7.3.5 trginterval

./gx_mipi_i2c.sh -w trginterval [us] -b your_i2c_bus_number

./gx_mipi_i2c.sh -r trginterval -b your_i2c_bus_number

在正常触发模式下的触发间隔,单位为微秒。范围:[0.0xFFFFFF]。

7.3.6 trgone

./gx_mipi_i2c.sh -w trgone -b your_i2c_bus_number

软件触发命令。执行一次, 将执行一次软触发操作。

7.3.7 trgcount

./gx_mipi_i2c.sh -r trgcount -b your_i2c_bus_number

触发次数统计。获取触发的总数以及触发的丢失数量。

./gx_mipi_i2c.sh -w trgcount [1] -b your_i2c_bus_number

清除触发次数。

7.3.8 i2caddr

./gx_mipi_i2c.sh -w i2caddr [new] -b your_i2c_bus_number

./gx_mipi_i2c.sh -r i2caddr -b your_i2c_bus_number
此模块支持通过软件更改 I2C 地址,其 I2C 地址范围为[0x3, 0x77]。

只有在执行了“保存参数”和“重新启动”操作之后,该设置才会真正生效。

7.3.9 nondiscontinuousmode

./gx_mipi_i2c.sh -w nondiscontinuousmode [0/1] -b your_i2c_bus_number

./gx_mipi_i2c.sh -r nondiscontinuousmode -b your_i2c_bus_number

mipi信号的discontinues模式,0为非连续,1为连续。

7.3.10 slavemode

./gx_mipi_i2c.sh -w slavemode [0/1] -b your_i2c_bus_number

./gx_mipi_i2c.sh -r slavemode -b your_i2c_bus_number

该传感器是否处于从机模式。在从机模式下,相机依靠外部信号来获取 XVS 和 XHS 数据。

设置此参数将使相机自动保存当前设置并重新启动。

7.3.11 framecount

./gx_mipi_i2c.sh -r framecount -b your_i2c_bus_number
获取到传感器帧数为 434,输出帧数为 436。

传感器帧数:

从传感器收集到的帧数会在一个循环中进行计数。仅进行累加操作,不进行清零,并且每秒更新一次。

帧计数:

输出帧的数量是在一个循环中进行计数的。只进行累加操作,不进行清零操作,并且每秒更新一次。

7.3.12 triggercyclemin

./gx_mipi_i2c.sh -r triggercyclemin -b your_i2c_bus_number

触发信号最小周期,us为单位,0表示非法值。电平触发模式时,表示上个触发电平的结束信号到下个触发信号最小间隔。

7.3.13 daynightmode

./gx_mipi_i2c.sh -w daynightmode [0,2] -b your_i2c_bus_number

./gx_mipi_i2c.sh -r daynightmode -b your_i2c_bus_number

彩转黑类型

参数 描述
0 彩色模式
1 黑白模式
2 外触发模式
7.3.14 ircutdir

./gx_mipi_i2c.sh -w ircutdir [0/1] -b your_i2c_bus_number

./gx_mipi_i2c.sh -r ircutdir -b your_i2c_bus_number

默认情况下,如果端口 A 处的电压高于端口 B 处的电压(A > B),IRCUT 模块将驱动滤波器进入光路。当方向改变,使得端口 B 处的电压高于端口 A 处的电压(A < B)时,电磁线圈的极性会反转,滤波器则被驱动退出光路。

7.3.15 pinpolarity

./gx_mipi_i2c.sh -w pinpolarity [0/1] -b your_i2c_bus_number

./gx_mipi_i2c.sh -r pinpolarity -b your_i2c_bus_number

触发针极性在白天和夜晚会发生变化。默认情况下,低电平表示夜晚。将此值设置为 1 后,高电平则表示夜晚。

7.3.16 ircuttimer

./gx_mipi_i2c.sh -w ircuttimer [0/1] -b your_i2c_bus_number

./gx_mipi_i2c.sh -r ircuttimer -b your_i2c_bus_number

是否启用IRCUT周期性控制;如启用则按照默认周期(10秒)进行IRCUT控制,如不启用,则只在模式切换的时候做一次控制。

7.4 Image Properties

7.4.1 testimg

./gx_mipi_i2c.sh -w testimg [0/1] -b your_i2c_bus_number

./gx_mipi_i2c.sh -r testimg -b your_i2c_bus_number

参数 描述
0 普通图像
1 竖向彩条
7.4.2 pixelformat

./gx_mipi_i2c.sh -w pixelformat [4/5/6/7] -b your_i2c_bus_number

./gx_mipi_i2c.sh -r pixelformat -b your_i2c_bus_number

参数 描述
0 Mono8
1 Mono10
2 Mono12
3 Mono14 (预留)
4 UYVY
5 RGB888
6 Temp (预留)
7 YUYV
7.4.3 maxwh

./gx_mipi_i2c.sh -r maxwh -b your_i2c_bus_number

获取该传感器所能支持的最大宽度和高度。

7.4.4 minwh

./gx_mipi_i2c.sh -r minwh -b your_i2c_bus_number

获取该相机所能支持的最小宽度和高度。

7.4.5 maxfps

./gx_mipi_i2c.sh -r maxfps -b your_i2c_bus_number

当前模式所能支持的最大帧率。

根据所设定的感兴趣区域(ROI),最大帧率会有所不同,此参数支持小数。

7.4.6 minfps

./gx_mipi_i2c.sh -r minfps -b your_i2c_bus_number

读取当前模块所支持的最低帧率。

7.4.7 curwh

./gx_mipi_i2c.sh -r curwh -b your_i2c_bus_number

获取当前的宽度和高度。

7.4.8 imgdir

./gx_mipi_i2c.sh -r imgdir -b your_i2c_bus_number

./gx_mipi_i2c.sh -w imgdir [0/1/2/3] -b your_i2c_bus_number

图像方向:

参数 描述
0 正常
1 镜像
2 翻转
3 翻转与镜像
7.4.9 videomode

./gx_mipi_i2c.sh -r videomode -b your_i2c_bus_number

./gx_mipi_i2c.sh -w videomode [0-7] -b your_i2c_bus_number

对于使用VideoMode模式选择宽高帧率的相机,选择哪个模式,范围[0-7]。对应能力集为VideomodeCap 。

7.4.10 readmode

./gx_mipi_i2c.sh -r readmode -b your_i2c_bus_number

图像模式:

参数 描述
0 normal 模式
1 2x2binning 模式
2 subsampling 模式
7.4.11 lanenum

./gx_mipi_i2c.shsh -r lanenum -b your_i2c_bus_number

输出 MIPI 信号的局域网数量的配置。

参数 描述
2 2lane
4 4lane
7.4.12 mipidatarate

./gx_mipi_i2c.shh -r mipidatarate -b your_i2c_bus_number

mipi每一个lan的速率,kbps为单位。

7.4.13 fps

./gx_mipi_i2c.sh -r fps -b your_i2c_bus_number

./gx_mipi_i2c.sh -w fps -b [framerate] your_i2c_bus_number

在当前模式下设置相机的实际帧率。

范围:(0,最大帧率]。

在视频流模式下,此参数决定了实际的帧率。

在常规触发模式下,建议将帧率设置为最高帧率值,以确保触发信号的响应速度达到最佳。

7.5 Image Processing

7.5.1 expmode

./gx_mipi_i2c.sh -r expmode -b your_i2c_bus_number

./gx_mipi_i2c.sh -w expmode [0/2] -b your_i2c_bus_number

Exposure type

参数 描述
0 手动曝光
2 自动曝光
7.5.2 aetarget

./gx_mipi_i2c.sh -r aetarget -b your_i2c_bus_number

./gx_mipi_i2c.sh -w aetarget [0,255] -b your_i2c_bus_number

AE 算法的目标亮度。

在设定的范围内,该算法会优先考虑增加曝光时间。

并且如果曝光时间达到最大值但仍未达到设定的目标亮度值,就应增加增益。

7.5.3 aestrategy

./gx_mipi_i2c.sh -r aestrategy -b your_i2c_bus_number

./gx_mipi_i2c.sh -w aestrategy [0/1] -b your_i2c_bus_number

自动曝光策略:

参数 描述
0 亮区优先模式(高光优先)
1 暗区优先模式(低光优先)
7.5.4 metime

./gx_mipi_i2c.sh -r metime -b your_i2c_bus_number

./gx_mipi_i2c.sh -w metime [us] -b your_i2c_bus_number

手动曝光时间。

范围:16 至 1,000,000/帧率(单位:微秒)。

7.5.5 aemaxtime

./gx_mipi_i2c.sh -r aemaxtime -b your_i2c_bus_number

./gx_mipi_i2c.sh -w aemaxtime [16,1000000/fps] -b your_i2c_bus_number

自动最大曝光时间。

范围:16 至 1,000,000/帧率(单位:微秒)。

7.5.6 exptime

./gx_mipi_i2c.sh -r exptime -b your_i2c_bus_number

获取当前曝光时间。此命令在任何曝光模式下均有效。

7.5.7 curgain

./gx_mipi_i2c.sh -r curgain -b your_i2c_bus_number

获取当前增益值。此命令在任何曝光模式下均有效。

7.5.8 mgain

./gx_mipi_i2c.sh -r mgain -b your_i2c_bus_number

./gx_mipi_i2c.sh -w mgain [gain] -b your_i2c_bus_number

手动增益值,范围和步长根据型号不同。

7.5.9 aemaxgain

./gx_mipi_i2c.sh -r aemaxgain -b your_i2c_bus_number

./gx_mipi_i2c.sh -w aemaxgain [0,maxgain] -b your_i2c_bus_number

自动增益的最大值。其范围和步长会因型号不同而有所差异。

7.5.10 wbmode

./gx_mipi_i2c.sh -r wbmode -b your_i2c_bus_number

./gx_mipi_i2c.sh -w wbmode [0/2] -b your_i2c_bus_number

白平衡 类型

参数 描述
0 手动白平衡
2 自动白平衡
7.5.11 awbcolortempmin

./gx_mipi_i2c.sh -r awbcolortempmin -b your_i2c_bus_number

./gx_mipi_i2c.sh -w awbcolortempmin [1000,15000] -b your_i2c_bus_number

白平衡最低色温(开尔文单位),范围[1000,15000]。

7.5.12 awbcolortempmax

./gx_mipi_i2c.sh -r awbcolortempmax -b your_i2c_bus_number

./gx_mipi_i2c.sh -w awbcolortempmax [1000,15000] -b your_i2c_bus_number

白平衡最高色温(开尔文单位),范围[1000,15000]。

7.5.13 mwbbgain

./gx_mipi_i2c.sh -r mwbbgain -b your_i2c_bus_number

./gx_mipi_i2c.sh -w mwbbgain [0,4095] -b your_i2c_bus_number

手动白平衡 B 增益 [0, 4095]。

7.5.14 mwbrgain

./gx_mipi_i2c.sh -r mwbrgain -b your_i2c_bus_number

./gx_mipi_i2c.sh -w mwbrgain [0,4095] -b your_i2c_bus_number

手动白平衡 R 增益 [0, 4095]。

7.5.15 colortemp

./gx_mipi_i2c.sh -r colortemp -b your_i2c_bus_number

当前色温(开尔文单位)。

7.5.16 currgain

./gx_mipi_i2c.sh -r currgain -b your_i2c_bus_number

当前白平衡 R 调整值 [0, 4095]。

7.5.17 curbgain

./gx_mipi_i2c.sh -r curbgain -b your_i2c_bus_number

当前白平衡 B 调整值 [0, 4095]。

7.5.18 aemintime

./gx_mipi_i2c.sh -r aemintime -b your_i2c_bus_number

./gx_mipi_i2c.sh -w aemintime [16,1000000/fps] -b your_i2c_bus_number

自动最小曝光时间范围:16 至 1,000,000/帧率(单位:微秒)。

7.5.19 gamma_index

./gx_mipi_i2c.sh -r gamma_index -b your_i2c_bus_number

./gx_mipi_i2c.sh -w gamma_index [0,12] -b your_i2c_bus_number

GX 系列具有预设的gamma值选项,不同的数值代表不同的gamma设置:

0: Gamma 为零,即采用线性格式。

1: 默认 gamma.

2: gamma_1.6

3: gamma_1.8

4: gamma_2.0

5: gamma_2.2

6: Style 1

7: Style 2

8: Style 3

9: Style 4

10: Style 5

11: Style 6

12: 用户自定义 (TODO)

7.5.20 antiflicker

./gx_mipi_i2c.sh -r antiflicker -b your_i2c_bus_number

./gx_mipi_i2c.sh -w antiflicker [0/1] [50/60/100/120/200/240] -b your_i2c_bus_number

参数 1:抗闪烁功能是否启用 [0/1]。

参数 2:Antiflicker freq频率。可选值50,60,100,120,200,240。设置后,相机曝光时间将遵循(1s/(freq*2))的整数倍,以避免出现条纹。建议灯光更强的时候,使用更大的值,避免过曝。

7.5.21 wdrparam

./gx_mipi_i2c.sh -r wdrparam -b your_i2c_bus_number

./gx_mipi_i2c.sh -w wdrparam [0/1] [0,255] -b your_i2c_bus_number

参数1:WDR 功能是否已启用 [0/1]。

参数 2:WDR 强度(取值范围:0 - 255)。

7.5.22 sharppen

./gx_mipi_i2c.sh -r sharppen -b your_i2c_bus_number

./gx_mipi_i2c.sh -w sharppen [0,255] -b your_i2c_bus_number

锐化强度 [0 - 255]。

7.5.23 denoise2d

./gx_mipi_i2c.sh -r denoise2d -b your_i2c_bus_number

./gx_mipi_i2c.sh -w denoise2d [0,255] -b your_i2c_bus_number

2D 噪声降低强度 [0 - 255]。

7.5.24 denoise3d

./gx_mipi_i2c.sh -r denoise3d -b your_i2c_bus_number

./gx_mipi_i2c.sh -w denoise3d [0,255] -b your_i2c_bus_number

3D 噪声降低强度[0-255]。

7.5.25 saturation

./gx_mipi_i2c.sh -r saturation -b your_i2c_bus_number

./gx_mipi_i2c.sh -w saturation [0,100] -b your_i2c_bus_number

饱和度 [0 - 100]。

7.5.26 contrast

./gx_mipi_i2c.sh -r contrast -b your_i2c_bus_number

./gx_mipi_i2c.sh -w contrast [0,100] -b your_i2c_bus_number

对比度 [0-100]。

7.5.27 hue

./gx_mipi_i2c.sh -r hue -b your_i2c_bus_number

./gx_mipi_i2c.sh -w hue [0-100] -b your_i2c_bus_number

色温 [0-100]。

7.5.28 slowshutter

./gx_mipi_i2c.sh -r slowshutter -b your_i2c_bus_number

./gx_mipi_i2c.sh -w slowshutter [0/1] [20] -b your_i2c_bus_number

参数 1 : 采用自动降帧模式(1)还是固定帧率模式(0)。

参数 2 : 设定自动降帧模式下开始降帧的增益阈值。其单位为 0.1 分贝。

注意:自动降帧模式仅在自动曝光模式 + 视频流模式下有效。使用功能使用时,需要最大曝光时间(aemaxtime)配合使用。

自动降帧模式下,自动曝光调节时会优先增大曝光时间来尽量减小增益。当 sensor 增益达到用户设置的最大值(参数2)时,自动曝光算法会逐渐降帧率并延长曝光时间,持续到曝光时间等于自动曝光的最大时间(aemaxtime)为止。低照度环境下噪声较小但帧率会降低。

7.5.29 ldc

./gx_mipi_i2c.sh -r ldc -b your_i2c_bus_number

./gx_mipi_i2c.sh -w ldc [0,255] -b your_i2c_bus_number

镜头畸变校正 [0 - 255],简称为 LDC,其中 0 表示禁用。

注:该功能设置参数一定要在相机采集图像之前设置才会有效。

7.5.30 dehaze

./gx_mipi_i2c.sh -r dehaze -b your_i2c_bus_number

./gx_mipi_i2c.sh -w dehaze [0,255] -b your_i2c_bus_number

除雾强度 [0 - 255],0 表示关闭状态。

7.5.31 drc

./gx_mipi_i2c.sh -r drc -b your_i2c_bus_number

./gx_mipi_i2c.sh -w drc [0,255] -b your_i2c_bus_number

数字宽动态范围。范围为[0-255],0 表示关闭。

7.6 IO Control

7.6.1 trgdelay

./gx_mipi_i2c.sh -r trgdelay -b your_i2c_bus_number

./gx_mipi_i2c.sh -w trgdelay [0,1000000] -b your_i2c_bus_number

触发延迟,在软触发和硬触发模式下均有效。

范围:0 到 1000000(单位:微秒)。

7.6.2 trgedge

./gx_mipi_i2c.sh -r trgedge -b your_i2c_bus_number

./gx_mipi_i2c.sh -w trgedge [0,1] -b your_i2c_bus_number

在硬触发模式下具有有效的触发边沿。

参数 描述
0 上升沿触发
1 下降沿触发
7.6.3 trgexp_delay

./gx_mipi_i2c.sh -r trgexp_delay -b your_i2c_bus_number

./gx_mipi_i2c.sh -w trgexp_delay [0,100000] -b your_i2c_bus_number

曝光延迟,即提前开启闪光信号所需的时间。

范围:0 到 1000000(单位:微秒)。

trgexp_delay 与 trgdelay 之间的区别,请参阅手册以获取详细信息。

7.6.4 outio1_rvs

./gx_mipi_i2c.sh -r outio1_rvs -b your_i2c_bus_number

./gx_mipi_i2c.sh -w outio1_rvs [0,1] -b your_i2c_bus_number

如果将 OUT_IO1 设为 1,当前输出信号取反。

8 Notes

注1:曝光时间的所有参数均以微秒为单位。然而,由于传感器的特性,传感器的实际曝光时间单位为 1 行,无法精确到 1 微秒。

9 典型应用场景的配置方法:

9.1 流模式:

 ./gx_mipi_i2c.sh -w imgacq 1 -b your_i2c_bus_number

9.2 触发模式:

./gx_mipi_i2c.sh -w imgacq 0 -b your_i2c_bus_number

./gx_mipi_i2c.sh -w workmode 1 -b your_i2c_bus_number

./gx_mipi_i2c.sh -w trgsrc 0 -b your_i2c_bus_number

./gx_mipi_i2c.sh -w trgnum 1 -b your_i2c_bus_number

./gx_mipi_i2c.sh -w trginterval 0 -b your_i2c_bus_number

./gx_mipi_i2c.sh -w trgone -b your_i2c_bus_number

根据上述指令,您可以拍照了。

9.3 同步模式:

注意:同步模式需要两部摄像机。

./gx_mipi_i2c.sh -w slavemode 0 -b your_i2c_bus_number

./gx_mipi_i2c.sh -w slavemode 1 -b your_i2c_bus_number

./gx_mipi_i2c.sh -w workmode 4 -b your_i2c_bus_number

./gx_mipi_i2c.sh -w workmode 4 -b your_i2c_bus_number

./gx_mipi_i2c.sh -w imgacq 1 -b your_i2c_bus_number

./gx_mipi_i2c.sh -w imgacq 1 -b your_i2c_bus_number

./veye_raspipreview -cs 1 -p '0,0,1000,520' -t -1

./veye_raspipreview -cs 0 -p '600,0,1280,720' -t -1

完成上述配置后,您就可以开始进行图像采集了。

请注意,如果在图像采集过程中需要调整帧率,必须先停止采集操作,然后再进行相关设置。在停止采集操作后,相机仍会完成当前帧的采集工作。

新的设定参数要到之后才会生效。