Difference between revisions of "Gx mipi i2c.sh user guide"
(更新图像采集) |
(更改标题) |
||
| Line 174: | Line 174: | ||
bit4: Multi-camera synchronization mode. | bit4: Multi-camera synchronization mode. | ||
| − | + | ===== 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> | ||
Revision as of 11:43, 20 October 2025
gx_mipi_i2c.sh Shell scripts usage
1 Overview
The gx_mipi_i2c.sh script is a tool set for configuring GX MIPI series cameras through the I2C.
This script is essentially an access to registers. For registers, please refer to GX Series MIPI Camera Register Map.
2 Download
We provide download links for gx_mipi_i2c.sh for different embedded platforms.
Generally, these links can be found in the respective platform's GitHub repository.
Below is the list:
2.1 Nvidia Jetson:
https://github.com/veyeimaging/nvidia_jetson_veye_bsp/tree/master/mv_tools_jetson/i2c_tools
2.2 Raspberry Pi:
https://github.com/veyeimaging/raspberrypi_v4l2/tree/main/mv_tools_rpi
2.3 RK35xx:
https://github.com/veyeimaging/rk35xx_veye_bsp/tree/main/mv_tools_rockchip/i2c_tools
3 Prepare
cd mv_tools_rpi/sources/
./make.sh
cd ..
chmod +x *
4 gx_mipi_i2c.sh USAGE
$ ./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 bus number on different board
Please refer to the following article to determine which -b parameter you need to use.
i2c bus number on different boards
6 Functions list
6.1 Note
The camera has two states, standby and running, after the start of image acquisition into the running state.
There are some registers that are write-protected in the running state, which will be marked with an asterisk. For example: trgsrc* .
There are some parameters that have strict range restrictions, and it's a good idea to try reading them when you're in doubt.
6.2 Basic Parameters
6.2.1 manufacturer
./gx_mipi_i2c.sh -r manufacturer -b your_i2c_bus_number
Get the manufacturer name, which is VEYE.
6.2.2 model
./gx_mipi_i2c.sh -r model -b your_i2c_bus_number
Get the product model, such as GX-MIPI-IMX662.
6.2.3 version
./gx_mipi_i2c.sh -r version -b your_i2c_bus_number
Get the Controller version number and Logical version number.
The system has two main control chips that serve the control and logic functions respectively.
6.2.4 serialno
./gx_mipi_i2c.sh -r serialno -b your_i2c_bus_number
Get the unique serial number of this module.
6.2.5 timestamp
./gx_mipi_i2c.sh -r timestamp -b your_i2c_bus_number
Get the time since the system started, in milliseconds.
6.2.6 errcode
./gx_mipi_i2c.sh -r errcode -b your_i2c_bus_number
System error code, each bit represents an error type.
bit0: sensor
bit1: fpga Startup error
bit2: fpga Communication error
bit3: 2477 error
bit4: N6 error
bit5: AA The adjustment fails to achieve the desired result.
bit6: authorization failed
bit7: hi芯片不通。
6.2.7 fmtcap
./gx_mipi_i2c.sh -r fmtcap -b your_i2c_bus_number
Get the Module supports data formats
Capbility of data formats supported by the camera.
bit0: Mono8
bit1: Mono10
bit2: Mono12
bit3: Mono14
bit4: UYVY
bit5: RGB888
bit6: Temp
bit7: YUYV
6.2.8 readmodecap
./gx_mipi_i2c.sh -r readmodecap -b your_i2c_bus_number
Get the Sensor reads out the capability set of patterns.
Capbility of read mode supported by the camera.
bit0: Normal
bit1: binning mode
bit2: subsampling mode
6.2.9 trgmodecap
./gx_mipi_i2c.sh -r trgmodecap -b your_i2c_bus_number
Get the Video streaming mode capability set
Capbility of trigger mode supported by the camera.
bit0: Video streaming mode
bit1: Normal trigger mode.
bit2: Rolling shutter multi-frame trigger mode.
bit3: Pulse trigger mode.
bit4: Multi-camera synchronization mode.
6.2.10 lanecap
./gx_mipi_i2c.sh -r lanecap -b your_i2c_bus_number
Get the number of MIPI Lanes supported by the camera
The number of MIPI lanes supported by the camera .
The lower to higher bits correspond to the supported capabilities for 1 lane, 2 lanes, 3 lanes, and 4 lanes, respectively.
For example, 0x2 indicates support for 2 lanes, and 0xA indicates support for both 2 lanes and 4 lanes.
cameramodel0-cameramodel7
./gx_mipi_i2c.sh -r cameramodel0 -b your_i2c_bus_number
Get the camera model, such as: cameramodel0 is 0x47582d4d(ascii is GX-M)
Temperature K
./gx_mipi_i2c.sh -r temp -b your_i2c_bus_number
Get the temp is 25K
VideoModeCap
./gx_mipi_i2c.sh -r videomodecap -b your_i2c_bus_number
Get the videomodecap is 2
| value | description |
|---|---|
| bit0 | ROI模式 |
| bit1 | Set the VideoMode mode as the default. |
VideoModeNum
./gx_mipi_i2c.sh -r videomodenum -b your_i2c_bus_number
Get the videomodenum 1
VidoeMode_WH1-VidoeMode_WH8
./gx_mipi_i2c.sh -r videomodewh1 -b your_i2c_bus_number
Get the videomodewh1 is 0x7800438 (1920*1080)
In the first mode, the width is represented by the high 16 bits and the height by the low 16 bits.
VideoMode_Param1-VideoMode_Param8
./gx_mipi_i2c.sh -r videomode_param1 -b your_i2c_bus_number
Get the videomodeparam1 is 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.
| value | description |
|---|---|
| 0 | ordinary |
| 1 | binning |
| 2 | subsampling |
6.2.11 factoryparam
./gx_mipi_i2c.sh -w factoryparam -b your_i2c_bus_number
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.
6.2.12 paramsave
./gx_mipi_i2c.sh -w paramsave -b your_i2c_bus_number
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.
6.2.13 reboot
./gx_mipi_i2c.sh -w reboot -b your_i2c_bus_number
Reboot the camera.
7 image acquisition
7.1 imgacq
./gx_mipi_i2c.sh -w imgacq [0/1] -b your_i2c_bus_number
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.
Writing 0 will stop the output image and enter the standby state.
7.2 trgmode
./gx_mipi_i2c.sh -w trgmode [0,1,4] -b your_i2c_bus_number
./gx_mipi_i2c.sh -r trgmode -b your_i2c_bus_number
| value | description |
|---|---|
| 0 | Video streaming mode |
| 1 | Normal trigger mode |
| 4 | Multi-camera synchronization mode |
See product manual for details.
7.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
| value | description |
|---|---|
| 0 | Software trigger |
| 1 | Hardware trigger |
7.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
The number of image frames output by one trigger signal in trigger mode.
7.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
Trigger interval in normal trigger mode, in microseconds. Range:[0.0xFFFFFF].
7.6 trgone
./mv_mipi_i2c_new.sh -w trgone -b your_i2c_bus_number
Software trigger command.One execution will perform a soft trigger.
7.7 trgcount
./mv_mipi_i2c_new.sh -r trgcount -b your_i2c_bus_number
Trigger count statistics.
Get the total number of triggers and the number of trigger loss.
./mv_mipi_i2c_new.sh -w trgcountclr [1] -b your_i2c_bus_number
Clear trigger count.
7.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
This module support i2c address changed by software, i2c address range[0x3,0x77].
Will really take effect only after paramsave and reboot .
7.9 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
Whether the sensor is operating in slave mode. In slave mode, the camera relies on external signals to provide XVS and XHS.
Writing this parameter will cause the camera to automatically save the current settings and reboot.
Currently.
7.10 framecount
./gx_mipi_i2c.sh -r framecount -b your_i2c_bus_number
7.11 minwh
./gx_mipi_i2c.sh -r minwh -b your_i2c_bus_number
Get the minimum width and height supported by the camera.
7.12 temp
./gx_mipi_i2c.sh -r temp -b your_i2c_bus_number
For cameras that support temperature sensors, obtain the temperature inside the camera chip.
7.13 minfps
./mv_mipi_i2c_new.sh -r minfps -b your_i2c_bus_number
Read the minimum frame rate supported by the current module.
7.14 Image Acquisition
7.14.1 trgcycle
./mv_mipi_i2c_new.sh -r trgcycle -b your_i2c_bus_number
Reads the lowest trigger cycle in the current trigger mode.
7.14.2 framecount
./mv_mipi_i2c_new.sh -r framecount -b your_i2c_bus_number
Frame count statistics.
The number of frames output by the sensor and the number of frames output by the camera module. Cyclic counting.
7.15 IO Control
For RAW series cameras, the input IO supports trigger edge and trigger delay, and does not support trigger filtering function. The output IO is the strobe out pin of the sensor that leads directly.
7.15.1 trgdelay*
./mv_mipi_i2c_new.sh -r trgdelay -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -w trgdelay [us] -b your_i2c_bus_number
Trigger delay, effective under both soft trigger and hard trigger mode.
range: 0 to 1000000 (unit: microsecond)
7.15.2 trgedge*
./mv_mipi_i2c_new.sh -r trgedge -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -w trgedge [0,1] -b your_i2c_bus_number
Effective trigger edge in hard trigger mode.
| value | description |
|---|---|
| 0 | Rising edge |
| 1 | Falling edge |
7.15.3 trgfilter_enable*
./mv_mipi_i2c_new.sh -r trgfilter_enable -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -w trgfilter_enable [0,2] -b your_i2c_bus_number
| value | description |
|---|---|
| 0 | No filtering |
| 1 | Rising edge filtering (filtering out low-level interference signals) |
| 2 | Falling edge filtering (filtering out high level interference signals) |
| 3 | Both rising edge and falling edge filtering |
7.15.4 trgfilter_time*
./mv_mipi_i2c_new.sh -r trgfilter_time -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -w trgfilter_time [us] -b your_i2c_bus_number
Trigger signal filtering window width.
range: 1 to 1000000 (unit: microsecond)
7.15.5 trgexp_delay*
./mv_mipi_i2c_new.sh -r trgexp_delay -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -w trgexp_delay [us] -b your_i2c_bus_number
Exposure delay, i.e. the time to turn on the Strobe signal in advance.
range: 0 to 1000000 (unit: microsecond)
The difference between trgexp_delay and trgdelay, see manual for details.
7.15.6 gpios_status
./mv_mipi_i2c_new.sh -r gpios_status -b your_i2c_bus_number
Get TriggerIN_IO, OUT_IO1 and OUT_IO2 status.
7.15.7 outio1_mode
./mv_mipi_i2c_new.sh -r outio1_mode -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -w outio1_mode [0,1] -b your_i2c_bus_number
| value | description |
|---|---|
| 0 | strobe |
| 1 | user out |
strobe: High level active.
user out: defined by outio1_usr.
7.15.8 outio1_usr
./mv_mipi_i2c_new.sh -r outio1_usr -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -w outio1_usr [0,1] -b your_i2c_bus_number
| value | description |
|---|---|
| 0 | low |
| 1 | high |
7.15.9 outio1_rvs
./mv_mipi_i2c_new.sh -r outio1_rvs -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -w outio1_rvs [0,1] -b your_i2c_bus_number
Reverse OUT_IO1 high and low levels if set to 1.
7.15.10 outio2_mode
./mv_mipi_i2c_new.sh -r outio2_mode -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -w outio2_mode [0,5] -b your_i2c_bus_number
| value | description |
|---|---|
| 0 | strobe |
| 1 | user out |
| 2 | trigger wait |
| 3 | XVS |
| 4 | XHS |
| 5 | Effective trigger signal (Sony's global shutter sensor only) |
strobe: High level active.
user out: defined by outio2_usr.
trigger wait: High level active. Indicate that the camera is not busy now, able to respond to the trigger signal.
XHS, XVS: The signal from the corresponding pin of the sensor. (For rolling shutter only).
7.15.11 outio2_usr
./mv_mipi_i2c_new.sh -r outio2_usr -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -w outio2_usr [0,1] -b your_i2c_bus_number
| value | description |
|---|---|
| 0 | low |
| 1 | high |
7.15.12 outio2_rvs
./mv_mipi_i2c_new.sh -r outio2_rvs -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -w outio2_rvs [0,1] -b your_i2c_bus_number
Reverse OUT_IO1 high and low levels if set to 1.
7.16 Image Features
7.16.1 maxwh
./mv_mipi_i2c_new.sh -r maxwh -b your_i2c_bus_number
Get the maximum supported resolution of the sensor.
7.16.2 maxfps
./mv_mipi_i2c_new.sh -r maxfps -b your_i2c_bus_number
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.
7.16.3 fps*
./mv_mipi_i2c_new.sh -w fps [framerate] -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -r fps -b your_i2c_bus_number
Configure the actual frame rate of the camera in the current mode.
Range:(0,maxfps].
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.
7.16.4 fps_ex*
./mv_mipi_i2c_new.sh -w fps_ex [framerate] -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -r fps_ex -b your_i2c_bus_number
Extended functionality of fps: fps_ex supports a precision of up to 1/10,000, primarily for more accurate exposure time control in long exposure mode.
7.16.5 roi*
./mv_mipi_i2c_new.sh -w roi [x] [y] [width] [height] -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -r roi -b your_i2c_bus_number
ROI(region of interest) is the sensor output area, and the default is full screen output.
Parameter requirements:
[x] [y] [height] must be 4-aligned;
[width] must be 8-aligned;
The minimum ROI resolution will be different for different sensors.
For example, MV-MIPI-IMX178M minimum resolution is: 376*320;MV-MIPI-SC130M minimum resolution is 64*64.
The camera will make necessary adjustments to the user parameters to meet the parameter requirements.
So it is highly recommended that you read out the actual ROI parameters after writing them.
7.16.6 imgdir
./mv_mipi_i2c_new.sh -w imgdir [0,3] -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -r imgdir -b your_i2c_bus_number
| value | description |
|---|---|
| 0 | normal |
| 1 | mirror |
| 2 | flip |
| 3 | flip&mirror |
The image is first flipped/mirrored and then ROI cropped. For details, please refer to the manual.
7.16.7 pixelformat
./mv_mipi_i2c_new.sh -w pixelformat [0,2] -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -r pixelformat -b your_i2c_bus_number
| value | description |
|---|---|
| 0 | Mono8 |
| 1 | Mono10 |
| 2 | Mono12 |
| 4 | UYVY |
Note that for the MV-MIPI-IMX178M, the AD bits of the sensor is always 12 bits, and the logic unit performs data rounding to achieve a different pixel format.
7.16.8 blacklevel
./mv_mipi_i2c_new.sh -w blacklevel [blacklevel] -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -r blacklevel -b your_i2c_bus_number
This black level value will be set directly to the sensor.
7.16.9 blcmode
./mv_mipi_i2c_new.sh -w blcmode [0/1] -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -r blcmode -b your_i2c_bus_number
Black level calibration modes:
0: Sensor automatic calibration or use default black level.
1: Manually specify black level.
7.16.10 testimg
./mv_mipi_i2c_new.sh -w testimg [0,2] -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -r testimg -b your_i2c_bus_number
| value | description |
|---|---|
| 0 | Normal image |
| 1 | Test image 1 |
| 2 | Test image 2 |
7.16.11 readmode*
./mv_mipi_i2c_new.sh -w readmode [0/1/2] -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -r readmode -b your_i2c_bus_number
Read mode:
0: Normal
1: Binning
2: Subsampling
7.16.12 lanenum*
./mv_mipi_i2c_new.sh -w lanenum [2/4] -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -r lanenum -b your_i2c_bus_number
For modules that support lane number configuration, use this register to modify the lane number.
7.16.13 mipidatarate
./mv_mipi_i2c_new.sh -r mipidatarate -b your_i2c_bus_number
The MIPI datarate for each lane, measured in Kbps.
7.16.14 osdmode
./mv_mipi_i2c_new.sh -r osdmode -b your_i2c_bus_number
OSD mode bit definition:
0: Disabled
1: Crosshair enabled, overlays a crosshair at the center of the image for assisting with coordinate calibration.
7.17 ISP
7.17.1 Special Note
Generally, only manual exposure and manual gain are supported by RAW series cameras in this section. However, RAW-MIPI-AR0234M does support AEC control.
Commands supported by RAW-MIPI-AR0234M include:
expmode,metime,gainmode,mgain,aatarget,aemaxtime,exptime,curgain,aaroi,aaroienable.
7.17.2 gamma
./mv_mipi_i2c_new.sh -r gamma -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -w gamma [gamma] -b your_i2c_bus_number
Range (0,4.0],accurate is 0.01.
For now, gamma only works on 8bit depth image.
7.17.3 gammaenable
./mv_mipi_i2c_new.sh -r gammaenable -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -w gammaenable [0,1] -b your_i2c_bus_number
Enable/Disable gamma function.
7.17.4 dpcenable
./mv_mipi_i2c_new.sh -r dpcenable -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -w dpcenable [0,1] -b your_i2c_bus_number
Enable/Disable DPC(Defect Point Correction) function.
7.17.5 lutenable
./mv_mipi_i2c_new.sh -r lutenable -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -w lutenable [0,1] -b your_i2c_bus_number
Enable/Disable LUT(Look-Up-Table) function.
7.17.6 lut
./mv_mipi_i2c_new.sh -r lut [lutfilename] -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -w lut [lutfilename] -b your_i2c_bus_number
Import or export a lut curve to a file, refer to the provided lut_linear.txt for the file format.
7.17.7 expmode
./mv_mipi_i2c_new.sh -r expmode -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -w expmode [0,2] -b your_i2c_bus_number
| value | description |
|---|---|
| 0 | ME: manual exposure |
| 1 | AE once: auto exposure once |
| 2 | AE: auto exposure continuous |
Both ME and AE are easy to understand.
AE once: Execute automatic exposure in the set range once, then stop the adjustment.
RAW-MIPI-AR0234M do not support AE once mode.
7.17.8 metime
./mv_mipi_i2c_new.sh -w metime [us] -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -r metime -b your_i2c_bus_number
Range (0,1000000/fps].Because of Note1 and range limitation, please read back to confirm the real metime take effect.
Unit: microseconds.
7.17.9 gainmode
./mv_mipi_i2c_new.sh -r gainmode -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -w gainmode [0,3] -b your_i2c_bus_number
| value | description |
|---|---|
| 0 | MG: manual gain |
| 1 | AG once: auto gain once |
| 2 | AG: auto gain continuous |
Both MG and AG are easy to understand.
AG once: Execute automatic gain in the set range once, then stop the adjustment.
RAW-MIPI-AR0234M do not support AG once mode.
RAW-MIPI-AR0234M can not enable AG in ME mode.
7.17.10 mgain
./mv_mipi_i2c_new.sh -w mgain [gain] -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -r mgain -b your_i2c_bus_number
Range [0,MAX_Gain],MAX_Gain varies from sensor to sensor, for example, IMX178 is 48dB.
Read back to confirm the real mgain take effect.
7.17.11 aatarget
./mv_mipi_i2c_new.sh -r aatarget -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -w aatarget [1,255] -b your_i2c_bus_number
The target brightness of AE and AG algorithm.
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.
7.17.12 aemaxtime
./mv_mipi_i2c_new.sh -r aemaxtime -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -w aemaxtime [16,1000000/fps] -b your_i2c_bus_number
Maximum exposure time in AE mode.Range[16,1000000]. Note1.
Please read back to confirm the real aemaxtime take effect.
Unit: microseconds.
7.17.13 agmaxgain
./mv_mipi_i2c_new.sh -r agmaxgain -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -w agmaxgain [0,maxgain] -b your_i2c_bus_number
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.
Note:For RAW-MIPI-AR0234M, agmaxgain cannot be configured and remains fixed at 24dB.
7.17.14 exptime
./mv_mipi_i2c_new.sh -r exptime -b your_i2c_bus_number
Get the current exposure time. This command is valid in any exposure mode.
Unit: microseconds.
7.17.15 curgain
./mv_mipi_i2c_new.sh -r curgain -b your_i2c_bus_number
Gets the current gain. This command is valid in any exposure mode.
7.17.16 aaroienable
./mv_mipi_i2c_new.sh -w aaroienable [0,1] -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -r aaroienable -b your_i2c_bus_number
Whether to enable AAROI statistics function, not enable means full ROI statistics.
7.17.17 aaroi
./mv_mipi_i2c_new.sh -w aaroi [x] [y] [width] [height] -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -r aaroi -b your_i2c_bus_number
The AAROI coordinates are relative coordinates within the ROI area. So the area must be smaller than the image ROI.
7.17.18 exptime_range
./mv_mipi_i2c_new.sh -r exptime_range -b your_i2c_bus_number
Maximum and minimum exposure time in the current mode.
Unit: microseconds.
7.17.19 aeag_run_once_save
./mv_mipi_i2c_new.sh -w aeag_run_once_save -b your_i2c_bus_number
Execute AE&AG once operation and save the results to the camera as manual values!
This is a function that is useful when the camera is installed.
Please make sure that the image preview has already been started before executing this command.
It performs the following operations:
- Set AE and AG range to MAX.
- Run AE once and AG once.
- Wait 5 seconds.
- Check AE once and AG once result.
- Save the previous result to manual mode.
- Run paramsave,save to flash.
7.17.20 snsreg
./mv_mipi_i2c_new.sh -r snsreg [sensor reg addr] -b your_i2c_bus_number
Read the sensor's register indirectly via the camera controller unit.
7.18 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.
Note2: AE: Auto exposure; AG: Auto Gain; AA: AE and AG.
Note3: The AAROI coordinates are relative coordinates within the ROI area.
Note4: For RAW Series, there are some functions that are not supported, please refer to the register list for details.
8 Configuration Method for Typical Application Scenarios:
8.1 Manual Exposure Mode:
./mv_mipi_i2c_new.sh -w expmode 0 -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -w gainmode 0 -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -w metime exptime_you_want_to_set_us -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -w mgain gain_you_want_to_set_dB -b your_i2c_bus_number
After configuration, read the parameters with the following commands to confirm they have taken effect:
./mv_mipi_i2c_new.sh -r exptime -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -r curgain -b your_i2c_bus_number
Note: The maximum exposure time must be strictly less than the reciprocal of the fps.
8.2 Continuous Auto Exposure Mode:
./mv_mipi_i2c_new.sh -w expmode 2 -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -w gainmode 2 -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -w aatarget brightness_target -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -w aemaxtime [16,1000000/fps] -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -w agmaxgain [0,maxgain] -b your_i2c_bus_number
After continuous imaging for a while, you can read the current actual exposure time and gain using the following commands:
./mv_mipi_i2c_new.sh -r exptime -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -r curgain -b your_i2c_bus_number
8.3 Normal Trigger Mode:
First, stop the image acquisition to enter a state where the trigger mode can be modified:
./mv_mipi_i2c_new.sh -w imgacq 0 -b your_i2c_bus_number
In the following example, configure the camera for normal hardware trigger mode, where each trigger signal captures 1 image:
./mv_mipi_i2c_new.sh -w trgmode 1 -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -w trgsrc 1 -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -w trgnum 1 -b your_i2c_bus_number
You may optionally execute the following two commands to set the trigger edge and delay:
./mv_mipi_i2c_new.sh -w trgedge [0,1] -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -w trgdelay [us] -b your_i2c_bus_number
After configuration, you can start the image acquisition to accept trigger signals:
./mv_mipi_i2c_new.sh -w imgacq 1 -b your_i2c_bus_number
8.4 Long Exposure Mode
Some models support long exposure times, such as the MV-MIPI-IMX178M, which supports exposure times up to 100 seconds. The usage is as follows:
1. Stop image acquisition.
./mv_mipi_i2c_new.sh -w imgacq 0 -b your_i2c_bus_number
2. Set exposure and gain to manual mode:
./mv_mipi_i2c_new.sh -w expmode 0 -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -w gainmode 0 -b your_i2c_bus_number
3. Read the minimum frame rate:
./mv_mipi_i2c_new.sh -r minfps -b your_i2c_bus_number
r minfps @ current setting is 0.0100 fps
4. Set the current frame rate to 0.016:
./mv_mipi_i2c_new.sh -w fps_ex 0.016 -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -r fps_ex -b your_i2c_bus_number
5. Read the current exposure time range:
./mv_mipi_i2c_new.sh -r exptime_range-b your_i2c_bus_number
6. Set the exposure time:
./mv_mipi_i2c_new.sh -w metime 10000000 -b your_i2c_bus_number
./mv_mipi_i2c_new.sh -r exptime-b your_i2c_bus_number
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.