Line 94: |
Line 94: |
| 与libcamera-stack相同,我们的'''V4L2模式''',也实现了linux驱动层标准的V4L2驱动。基于此驱动,应用层可以直接开发程序获取图像并进行进一步处理。 | | 与libcamera-stack相同,我们的'''V4L2模式''',也实现了linux驱动层标准的V4L2驱动。基于此驱动,应用层可以直接开发程序获取图像并进行进一步处理。 |
| | | |
| + | === 配置命令行全局变量 === |
| + | 为了后面描述方便,此处根据sensor尺寸,配置全局变量。 |
| + | |
| + | *MV-MIPI-IMX178M |
| + | |
| + | <code>export WIDTH=3088</code> |
| + | |
| + | <code>export HEIGHT=2064</code> |
| + | |
| + | <code>export FPS=22</code> |
| + | |
| + | *MV-MIPI-SC130M |
| + | |
| + | <code>export WIDTH=1280</code> |
| + | |
| + | <code>export HEIGHT=1024</code> |
| + | |
| + | <code>export FPS=108</code> |
| + | |
| + | * MV-MIPI-IMX296M |
| + | |
| + | <code>export WIDTH=1440</code> |
| + | |
| + | <code>export HEIGHT=1088</code> |
| + | |
| + | <code>export FPS=60</code> |
| + | |
| + | *MV-MIPI-IMX265M |
| + | |
| + | <code>export WIDTH=2048</code> |
| + | |
| + | <code>export HEIGHT=1544</code> |
| + | |
| + | <code>export FPS=45</code> |
| === V4L2模式用法 === | | === V4L2模式用法 === |
| 我们在这个[https://github.com/veyeimaging/raspberrypi_v4l2 github仓库]保存了v4l2模式的代码。 | | 我们在这个[https://github.com/veyeimaging/raspberrypi_v4l2 github仓库]保存了v4l2模式的代码。 |
Line 248: |
Line 282: |
| | | |
| ===== 设置ROI ===== | | ===== 设置ROI ===== |
− | 以MV-MIPI-IMX178M,3088*2064举例:
| + | <code>v4l2-ctl --set-selection=target=crop,top=0,left=0,width=$WIDTH,height=$HEIGHT</code> |
| | | |
− | <code>v4l2-ctl --set-selection=target=crop,top=0,left=0,width=3088,height=2064</code> | + | ===== 设置帧率 ===== |
| + | <code>v4l2-ctl --set-ctrl frame_rate=$FPS</code> |
| | | |
| ===== 可使用如下命令进行帧率统计 ===== | | ===== 可使用如下命令进行帧率统计 ===== |
− | <code>v4l2-ctl --set-fmt-video=width=3088,height=2064,pixelformat=GREY --stream-mmap --stream-count=-1 --stream-to=/dev/null</code> | + | <code>v4l2-ctl --set-fmt-video=width=$WIDTH,height=$HEIGHT,pixelformat=GREY --stream-mmap --stream-count=-1 --stream-to=/dev/null</code> |
| | | |
| ===== 保存图片到文件 ===== | | ===== 保存图片到文件 ===== |
Line 266: |
Line 301: |
| ==== 触发模式 ==== | | ==== 触发模式 ==== |
| | | |
− | ===== 设置ROI ===== | + | ===== 设置ROI和帧率 ===== |
− | 以MV-MIPI-IMX178M,3088*2064举例:
| + | <code>v4l2-ctl --set-selection=target=crop,top=0,left=0,width=$WIDTH,height=$HEIGHT</code> |
| | | |
− | <code>v4l2-ctl --set-selection=target=crop,top=0,left=0,width=3088,height=2064</code> | + | <code>v4l2-ctl --set-ctrl frame_rate=$FPS</code> |
| ===== 软触发模式 ===== | | ===== 软触发模式 ===== |
| | | |