IMX462 2MP Starlight Camera是一款星光级摄像头,搭载1/2.8英寸索尼星光级传感器,IMX462 采用Sony被找背照式像素技术,在可见光和近红外段有高质量的成像效果。IXM462 2MP Starlight Camera最大分辨率为1920*1080,板载IR-CUT,可以自由切换日夜模式。摄像头板载ISP处理电路从而进一步增强摄像头成像效果。提供99°和127°两种视场角选项,用户可以根据自己的需求选择。
IMX462-99 | IMX462-127 | |
---|---|---|
图像传感器 | ||
感光芯片 | SONY IMX462LQR-C STARVIS | |
像素 | 2.07MP | |
分辨率 | 1920×1080 | |
像素尺寸 | 2.9um×2.9um | |
快门方式 | 卷帘快门 | |
ISP图像处理 | ||
帧率 | 1080p@25fps、1080p@30fps | |
曝光 | AE(自动曝光)/手动 | |
白平衡 | AWB(自动白平衡), 手动 | |
快门 | 1/25(1/30)s to 1/50,000s (支持慢快门) | |
降噪 | 2D/3D降噪 | |
图像设置 | 亮度、对比度、锐度、饱和度、GAMMA可调、图像翻转、图像镜像 | |
图像增强 | 背光补偿、DOL-WDR、去雾 | |
日夜切换 | 外触发同步转换,手动强制彩色、黑白 | |
镜头 | ||
视场角(FOV) | 99.1°(D) / 83.5°(H) / 44.6°(V) | 127.9°(D) / 106.9°(H) / 56.9°(V) |
光圈 | F1.0 | F1.61 |
焦距 | 4.0mm | 3.18mm |
畸变 | -33.8% | -51% |
对焦方式 | 手动 | |
工作参数 | ||
工作温度 | -10℃~60℃ | |
工作湿度 | <=95%无凝结 |
由于IMX462不是树莓派默认支持的摄像头型号,因此无法使用树莓派自带的libcamera或者raspicam库。需要另外安装驱动和控制脚本使用。
提供的驱动仅支持树莓派Raspberry PI OS系统,暂时未对其他系统做支持。
打开树莓派终端,输入指令
sudo raspi-config
选择Interface Options -> I2c -> Yes
下载驱动前,请确保已经正常烧写最新的树莓派系统,连接好摄像头,并完成开机配置。
打开树莓派终端,并输入以下指令进行安装
wget https://github.com/veyeimaging/raspberrypi_v4l2/releases/latest/download/raspberrypi_v4l2.tgz tar -xzvf raspberrypi_v4l2.tgz cd raspberrypi_v4l2/release/ chmod +x * sudo ./install_driver.sh veyecam2m
如果需要更换其他摄像头型号的额驱动,可以卸载现在的驱动
sudo ./uninstall_driver.sh veyecam2m
注:如果你是通过远程终端操作摄像头,在使用预览指令前请先输入export DISPLAY=:0指令指定一下屏幕输出。
打开树莓派终端,并输入以下指令进行安装:
sudo apt-get install gstreamer1.0-tools sudo apt-get install libx264-dev libjpeg-dev sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-ugly gstreamer1.0-tools gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-plugins-good gstreamer1.0-plugins-bad
gst-launch-1.0 v4l2src num-buffers=1 device=/dev/video0 ! 'video/x-raw, format=(string)UYVY, width=1920,height=1080' ! jpegenc ! filesink location=test_image.jpg
gst-launch-1.0 v4l2src io-mode=dmabuf device=/dev/video0 ! "video/x-raw,format=(string)UYVY, width=(int)1920, height=(int)1080,framerate=(fraction)30/1" ! v4l2convert capture-io-mode=dmabuf output-io-mode=dmabuf ! autovideosink sync=false -v
gst-launch-1.0 v4l2src device=/dev/video0 ! "video/x-raw,format=(string)UYVY, width=(int)1920, height=(int)1080,framerate=(fraction)30/1" ! videoconvert ! videoscale ! clockoverlay time-format="%D %H:%M:%S" ! video/x-raw, width=640, height=360 ! autovideosink sync=false -v
gst-launch-1.0 -e v4l2src io-mode=dmabuf device=/dev/video0 num-buffers=300 ! "video/x-raw,format=(string)UYVY, width=(int)1920, height=(int)1080,framerate=(fraction)30/1" ! v4l2h264enc capture-io-mode=dmabuf output-io-mode=dmabuf extra-controls="controls, h264_profile=4, video_bitrate=6200000" ! 'video/x-h264, profile=high, level=(string)4' ! h264parse ! matroskamux ! filesink location=output.mkv
gst-launch-1.0 -e v4l2src io-mode=dmabuf device=/dev/video0 num-buffers=300 ! "video/x-raw,format=(string)UYVY, width=(int)1920, height=(int)1080,framerate=(fraction)30/1" ! v4l2h264enc capture-io-mode=dmabuf output-io-mode=dmabuf extra-controls="controls, h264_profile=4, video_bitrate=6200000" ! 'video/x-h264, profile=high, level=(string)4' ! h264parse ! mp4mux ! filesink location=video.mp4
gst-launch-1.0 -v v4l2src device=/dev/video0 num-buffers=-1 ! "video/x-raw,format=(string)UYVY, width=(int)1920, height=(int)1080,framerate=(fraction)30/1" ! v4l2h264enc extra-controls="controls, h264_profile=4, video_bitrate=4000000" ! 'video/x-h264, profile=high, level=(string)4' ! h264parse ! rtph264pay config-interval=1 pt=96 ! gdppay ! tcpserversink host=x.x.x.x port=5000
gst-launch-1.0 -v tcpclientsrc host=x.x.x.x port=5000 ! gdpdepay ! rtph264depay ! avdec_h264 ! autovideosink sync=false
注意:x.x.x.x需要根据实际的树莓派IP地址更换,比如gst-launch-1.0 -v tcpclientsrc host=192.168.1.10 port=5000 ! gdpdepay ! rtph264depay ! avdec_h264 ! autovideosink sync=false
gst-launch-1.0 v4l2src device=/dev/video0 ! "video/x-raw,format=(string)UYVY, width=(int)1920, height=(int)1080,framerate=(fraction)30/1" ! videoscale ! "video/x-raw,width=640,height=480" ! videoconvert ! "video/x-raw, format=(string)BGR" ! appsink
注意:这里不是直接在树莓派中单运行的,而是最为video.Capture(str)str的参数做调用。
如果用户使用的是树莓派的CM3或者CM4计算模块,需要安装dtb和设备树文件。
sudo wget https://datasheets.raspberrypi.com/cmio/dt-blob-dualcam.bin -O /boot/dt-blob.bin sudo cp ~/raspberrypi_v4l2/release/driver_bin/$(uname -r)/veyecam2m.dtbo /boot/overlays/veyecam2m.dtbo sudo reboot
CM4采用两路i2c分别与两个摄像头通信,分别是i2c-0和i2c-10。
如果同时接入两路摄像头,会在系统成识别成video0和video2两个节点。
gst-launch-1.0 v4l2src io-mode=dmabuf device=/dev/video0 ! "video/x-raw,format=(string)UYVY, width=(int)1920, height=(int)1080,framerate=(fraction)30/1" ! v4l2convert capture-io-mode=dmabuf output-io-mode=dmabuf ! autovideosink sync=false -v
gst-launch-1.0 v4l2src io-mode=dmabuf device=/dev/video2 ! "video/x-raw,format=(string)UYVY, width=(int)1920, height=(int)1080,framerate=(fraction)30/1" ! v4l2convert capture-io-mode=dmabuf output-io-mode=dmabuf ! autovideosink sync=false -v
由于IMX462 摄像头板载ISP电路,用户可以通过提供的脚本对摄像头参数进行配置。
git clone https://github.com/veyeimaging/raspberrypi.git cd raspberrypi/i2c_cmd/bin/
cd raspberrypi/i2c_cmd/bin/ ./enable_i2c_vc.sh
./camera_i2c_config
./camera_i2c_config 0 #CAM0 ./camera_i2c_config 1 #CAM1
./veye_mipi_i2c.sh -r -f wdrmode
./veye_mipi_i2c.sh -w -f wdrmode -p1 [value]
[value]的数值可以为:
./veye_mipi_i2c.sh -r -f videoformat
./veye_mipi_i2c.sh -w -f videoformat -p1 [value]
[value]参数:
./veye_mipi_i2c.sh -r -f mirrormode
./veye_mipi_i2c.sh -w -f mirrormode -p1 [value]
[value]参数:
./veye_mipi_i2c.sh -r -f denoise
./veye_mipi_i2c.sh -w -f denoise -p1 [value]
[value]参数:
./veye_mipi_i2c.sh -r -f agc
./veye_mipi_i2c.sh -w -f agc -p1 [value]
[value]参数:
./veye_mipi_i2c.sh -r -f lowlight
在低照度模式下,可以通过配置改参数来延长摄像头曝光时间,降低帧率,从而获得更高的低照度成像效果
./veye_mipi_i2c.sh -w -f lowlight -p1 [value]
[value]参数;
./veye_mipi_i2c.sh -r -f daynightmode
./veye_mipi_i2c.sh -w -f daynightmode -p1 [value]
[value]参数:
./veye_mipi_i2c.sh -r -f ircutdir
./veye_mipi_i2c.sh -w -f ircutdir -p1 [value]
设置IR-CUT控制电平,[value]可以是0或者1
./veye_mipi_i2c.sh -r -f irtrigger
./veye_mipi_i2c.sh -w -f irtrigger -p1 [value]
[value]参数:
./veye_mipi_i2c.sh -r -f mshutter
./veye_mipi_i2c.sh -w -f mshutter -p1 [value]
[value]的单位为s, value大于0x4B的时候摄像头进入低帧率模式
Value | 说明 |
---|---|
NTSC (PAL) | |
0x40 | 自动曝光 |
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 -r -f cameramode
./veye_mipi_i2c.sh -w -f cameramode -p1 [value]
[value]参数: