五、调整镜头参数
1、64位系统要重新编译下,地址在raspberrypi_v4l2/i2c_cmd/source/,执行下make.sh文件
cd raspberrypi_v4l2/i2c_cmd/source/
chmod +x *
sudo ./make.sh
返回目录raspberrypi_v4l2/i2c_cmd/
cd ..
执行
./veye_mipi_i2c.sh
显示
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 addr if not default 0x3b
support functions: devid,hdver,sensorid,wdrmode,videoformat,mirrormode,denoise,agc,lowlight,daynightmode,ircutdir,irtrigger mshutter,curshutter
cameramode, nodf, capture, csienable,saturation,wdrbtargetbr,wdrtargetbr, brightness ,contrast , sharppen,wdrsharppen aespeed,lsc,boardmodel,yuvseq,i2cauxenable,i2cwen,awbgain,wbmode,mwbgain,antiflicker,awb_boffset,blcstrength,blcpos,paramsave
new_expmode,new_mshutter,new_mgain
2、参考地址
VEYE-MIPI-X I2C.sh用户手册
https://wiki.veye.cc/index.php/VEYE-MIPI-290/327_i2c/zh
3、下载VNC远程打开树莓派
下载地址:https://www.realvnc.com/en/
由于树莓派没有连接显示器,VNC远程连接会提示错误。需要改变树莓派VNC的分辨率
sudo nano /boot/config.txt
语句位置在28、29行。将hdmi_group、hdmi_mode前的#去掉。
新添语句:hdmi_ignore_edid=0xa500080
uncomment to force a specific HDMI mode (this will force VGA)
hdmi_group=2
hdmi_mode=82
hdmi_ignore_edid=0xa500080
要想关闭树莓派的电源指示灯和状态指示灯
dtparam=act_led_trigger=none
dtparam=pwr_led_trigger=none
最后别忘记ctrl+s保存文件,命令终端输入reboot等待重新载入桌面即可。
参考地址https://blog.csdn.net/ownmonent/article/details/126319919?spm=1001.2014.3001.5506
使用VNC连接树莓派,打开VLC, 连接镜头,用于调试参数。
参考地址7.1 使用VLC预览图像
https://wiki.veye.cc/index.php/V4L2_mode_for_Raspberry_Pi/zh
图片一
4、重要参数 调整,监控流星与其他不一样。
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
背光模式
0x00背光模式关闭
0x01背光模式开启,低
0x02背光模式开启,高
0x03 DOL WDR启用
输入:
./veye_mipi_i2c.sh -w -f wdrmode -p1 0x00
查看结果:
./veye_mipi_i2c.sh -r -f wdrmode
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
视频格式
PAL PAL(50Hz)25fps
NTSC NTSC(60Hz)每秒30帧
输入:
./veye_mipi_i2c.sh -w -f videoformat -p1 NTSC
查看:
./veye_mipi_i2c.sh -r -f videoformat
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)
反光镜模式
0x00正常
0x01镜像
0x02 V型翻转
0x03镜像和V型翻转(180度旋转)
./veye_mipi_i2c.sh -w -f mirrormode -p1 0x00
查看:
./veye_mipi_i2c.sh -r -f mirrormode
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
去噪
0x00 NR 2D模式=关闭;NR 3D模式=关闭
0x01 NR 2D模式=关闭;NR 3D模式=低
0x02 NR 2D模式=关闭;NR 3D模式=中间
0x03 NR 2D模式=关闭;NR 3D模式=高
0x04 NR 2D模式=低;NR 3D模式=关闭
0x05 NR 2D模式=低;NR 3D模式=低
0x06 NR 2D模式=低;NR 3D模式=中间
0x07 NR 2D模式=低;NR 3D模式=高
0x08 NR 2D模式=中间;NR 3D模式=关闭
0x09 NR 2D模式=中间;NR 3D模式=低
0x0A NR 2D模式=中间;NR 3D模式=中间
0x0B NR 2D模式=中间;NR 3D模式=高
0x0C NR 2D模式=高;NR 3D模式=关闭
0x0D NR 2D模式=高;NR 3D模式=低
0x0E NR 2D模式=高;NR 3D模式=中间
0x0F NR 2D模式=高;NR 3D模式=高
根据自己需求调整,不要降噪太多
输入:
./veye_mipi_i2c.sh -w -f denoise -p1 0x05
查看:
./veye_mipi_i2c.sh -r -f denoise
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
增益
含义为增益上限,默认为0xC
价值描述
0x00~0x0F AGC强度
夜晚时候可以适当打开增益,建议50或50%左右,不建议0或100
输入:
./veye_mipi_i2c.sh -w -f agc -p1 0x0a
查看:
./veye_mipi_i2c.sh -r -f agc
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)
输出:
./veye_mipi_i2c.sh -w -f lowlight -p1 0x0F
输入:
./veye_mipi_i2c.sh -r -f lowlight
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
昼夜模式描述
0xFF彩色模式
0xFE黑白模式
0xFC触发器模式
输入:
./veye_mipi_i2c.sh -w -f daynightmode -p1 0xFF
查看:
./veye_mipi_i2c.sh -r -f daynightmode0x0A
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
输入:
./veye_mipi_i2c.sh -w -f mshutter -p1 0x41
查看:
./veye_mipi_i2c.sh -r -f mshutter
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.
无DF
要求:hdver>=0x3,在流模式下有效
丢弃的帧数
它是一种帧速率控制方法,输出一帧、丢弃nodf帧、输出下一帧等等。
实际帧速率=原始帧速率/(1+nodf)
例如,如果原始帧速率为30fps,请将nodf设置为2,则实际帧速率是10fps。
./veye_mipi_i2c.sh-r-f nodf
./veye_mipi_i2c.sh-w-f nodf-p1[value]
ntof范围为[0-xFF],默认为0。
执行:
./veye_mipi_i2c.sh -w -f nodf -p1 0x00
查看
./veye_mipi_i2c.sh -r -f nodf
5.18 brightness
./veye_mipi_i2c.sh -r -f brightness
./veye_mipi_i2c.sh -w -f brightness -p1 0x32
AE的目标亮度,范围[0,0x64]
执行:
./veye_mipi_i2c.sh -w -f brightness -p1 0x32
查看:
./veye_mipi_i2c.sh -r -f brightness
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]
执行
./veye_mipi_i2c.sh -w -f aespeed -p1 0x32 -p2 0x32
查看
./veye_mipi_i2c.sh -r -f aespeed
5.20 contrast
./veye_mipi_i2c.sh -r -f contrast
./veye_mipi_i2c.sh -w -f contrast -p1 0x32
图像对比度,范围[0,0xFF],默认为0x80
执行
./veye_mipi_i2c.sh -w -f contrast -p1 0x32
查看
./veye_mipi_i2c.sh -r -f contrast
5.21 saturation
./veye_mipi_i2c.sh -r -f saturation
./veye_mipi_i2c.sh -w -f saturation -p1 0x32
饱和度,范围: [0,0x64]
执行
./veye_mipi_i2c.sh -w -f saturation -p1 0x32
查看
./veye_mipi_i2c.sh -r -f saturation
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]
param1值描述
0x0锐度禁用
0x1锐度启用
默认值:0x1
param2:锐笔强度,范围[0x0-0xA]
执行
./veye_mipi_i2c.sh -w -f sharppen -p1 0x1 -p2 0x03
查看
./veye_mipi_i2c.sh -r -f sharppen
5.24 wdrtargetbr
./veye_mipi_i2c.sh -r -f wdrtargetbr
./veye_mipi_i2c.sh -w -f wdrtargetbr -p1 0x80
宽动态模式下的整体亮度目标值。
WDR模式生效,[0-0xFF]默认值0x80,WDR模式下,值越大,亮度越高。
执行
查看
./veye_mipi_i2c.sh -r -f wdrtargetbr
6.1 paramsave
./veye_mipi_i2c.sh -w -f paramsave
保存isp相关参数到flash中。
备注:如果懒直接用这个参数
晚上模式
./veye_mipi_i2c.sh -w -f wdrmode -p1 0x00
./veye_mipi_i2c.sh -w -f videoformat -p1 NTSC
./veye_mipi_i2c.sh -w -f mirrormode -p1 0x00
./veye_mipi_i2c.sh -w -f denoise -p1 0x02
./veye_mipi_i2c.sh -w -f agc -p1 0x41
./veye_mipi_i2c.sh -w -f lowlight -p1 0x00
./veye_mipi_i2c.sh -w -f ircutdir -p1 0xff
./veye_mipi_i2c.sh -w -f daynightmode -p1 0xff
./veye_mipi_i2c.sh -w -f mshutter -p1 0x41
./veye_mipi_i2c.sh -w -f cameramode -p1 0x0
./veye_mipi_i2c.sh -w -f nodf -p1 0x00
./veye_mipi_i2c.sh -w -f brightness -p1 0x32
./veye_mipi_i2c.sh -w -f aespeed -p1 0x32 -p2 0x32
./veye_mipi_i2c.sh -w -f contrast -p1 0x32
./veye_mipi_i2c.sh -w -f saturation -p1 0x32
./veye_mipi_i2c.sh -w -f sharppen -p1 0x1 -p2 0x5
./veye_mipi_i2c.sh -w -f wdrsharppen -p1 0x0 -p2 0x3
./veye_mipi_i2c.sh -w -f wdrbtargetbr -p1 0x00
./veye_mipi_i2c.sh -w -f wdrtargetbr -p1 0x0A
./veye_mipi_i2c.sh -w -f wbmode -p1 0x18
./veye_mipi_i2c.sh -w -f paramsave
白天
./veye_mipi_i2c.sh -w -f wdrmode -p1 0x00
./veye_mipi_i2c.sh -w -f videoformat -p1 NTSC
./veye_mipi_i2c.sh -w -f mirrormode -p1 0x00
./veye_mipi_i2c.sh -w -f denoise -p1 0x00
./veye_mipi_i2c.sh -w -f agc -p1 0x00
./veye_mipi_i2c.sh -w -f lowlight -p1 0x00
./veye_mipi_i2c.sh -w -f ircutdir -p1 0xff
./veye_mipi_i2c.sh -w -f daynightmode -p1 0xff
./veye_mipi_i2c.sh -w -f mshutter -p1 0x40
./veye_mipi_i2c.sh -w -f cameramode -p1 0x0
./veye_mipi_i2c.sh -w -f nodf -p1 0x00
./veye_mipi_i2c.sh -w -f brightness -p1 0x32
./veye_mipi_i2c.sh -w -f aespeed -p1 0x32 -p2 0x32
./veye_mipi_i2c.sh -w -f contrast -p1 0x32
./veye_mipi_i2c.sh -w -f saturation -p1 0x32
./veye_mipi_i2c.sh -w -f sharppen -p1 0x1 -p2 0x5
./veye_mipi_i2c.sh -w -f wdrsharppen -p1 0x0 -p2 0x3
./veye_mipi_i2c.sh -w -f wdrbtargetbr -p1 0x00
./veye_mipi_i2c.sh -w -f wdrtargetbr -p1 0x0A
./veye_mipi_i2c.sh -w -f wbmode -p1 0x18
./veye_mipi_i2c.sh -w -f paramsave