Changes

Jump to navigation Jump to search
Line 1: Line 1:  
[[VEYE-MIPI-290/327 for Raspberry Pi|English]]
 
[[VEYE-MIPI-290/327 for Raspberry Pi|English]]
   −
'''<big><big><big><big>[[VEYE MIPI 290/327 for Raspberry Pi/zh|如何在树莓派平台使用VEYE-MIPI-X系列摄像头模组]]</big></big></big></big>'''
+
'''<big><big><big><big>[[VEYE MIPI 290/327 for Raspberry Pi/zh|如何在树莓派平台使用VEYE-MIPI-X系列摄像头模组(legacy mode)]]</big></big></big></big>'''
    
===概述===
 
===概述===
 
VEYE-MIPI-X系列摄像头模组,包括VEYE-MIPI-327E,VEYE-MIPI-IMX327S,VEYE-MIPI-IMX462,VEYE-MIPI-IMX385。摄像头模组理论上支持树莓派的所有型号,出于性能最优考虑,建议使用树莓派3以后的版本。本篇文章以树莓派3B为例讲解VEYE-MIPI-X摄像头模组接入树莓派的方法。此外介绍了接入树莓派Computer Module与树莓派Zero特殊之处。
 
VEYE-MIPI-X系列摄像头模组,包括VEYE-MIPI-327E,VEYE-MIPI-IMX327S,VEYE-MIPI-IMX462,VEYE-MIPI-IMX385。摄像头模组理论上支持树莓派的所有型号,出于性能最优考虑,建议使用树莓派3以后的版本。本篇文章以树莓派3B为例讲解VEYE-MIPI-X摄像头模组接入树莓派的方法。此外介绍了接入树莓派Computer Module与树莓派Zero特殊之处。
    +
=== 关于piOS版本---Bullseye ===
 +
The latest system of Raspberry Pi - bullseye has removed the support of raspicam by default. But we still have 2 ways to use it.
 +
 +
最新版本的piOS——Bullseye默认去掉了raspicam的支持。但是我们依然有两种方法来使用。
 +
 +
* 1, 使用 legacy 版本的 piOS,也就是说,不升级到Bullseye。
 +
 +
https://www.raspberrypi.com/software/operating-systems/
 +
 +
* 2, 在Bullseye版本上,打开Open legacy camera的支持。我们已经升级了程序以适应这种应用。
 +
 +
<blockquote><u>If you want to add the legacy camera interfaces to Bullseye, please click your update icon in the taskbar to update. Then open a terminal (Ctrl-Alt-T) and type ‘sudo raspi-config’, go to ‘Interface Options’ and then ‘Legacy Camera’, and reboot. These camera interfaces are deprecated, and we are not supporting them going forwards.</u></blockquote>https://www.raspberrypi.com/news/new-old-functionality-with-raspberry-pi-os-legacy/
 +
 +
使用如下命令查看当前系统版本:
 +
 +
<code>lsb_release -a</code>
 
===硬件准备及安装===
 
===硬件准备及安装===
 
原材料:树莓派3B,网线,Micro SD卡,树莓派电源线,HDMI显示器,FFC线,杜邦线,镜头,摄像头主板,转接板。(树莓派转接板包括mini转接板与增强版转接板,其中mini转接板用来对接树莓派标准版型,增强版转接板可以额外用来对接Computer Module系列和Zero系列版型,两种版本详情请见[http://wiki.veye.cc/index.php/Mini_Adapter_Board/zh Mini Adapter Board]与[http://wiki.veye.cc/index.php/Adapter_Board_for_Raspberry_Pi/zh Adapter Board])
 
原材料:树莓派3B,网线,Micro SD卡,树莓派电源线,HDMI显示器,FFC线,杜邦线,镜头,摄像头主板,转接板。(树莓派转接板包括mini转接板与增强版转接板,其中mini转接板用来对接树莓派标准版型,增强版转接板可以额外用来对接Computer Module系列和Zero系列版型,两种版本详情请见[http://wiki.veye.cc/index.php/Mini_Adapter_Board/zh Mini Adapter Board]与[http://wiki.veye.cc/index.php/Adapter_Board_for_Raspberry_Pi/zh Adapter Board])
Line 14: Line 30:     
==== 供电模式 ====
 
==== 供电模式 ====
VEYE-MIPI-IMX327S,VEYE-MIPI-IMX462,VEYE-MIPI-IMX385均支持杜邦线5V供电和FFC排线供电,并可以自动适应模式。[[File:Mini adpter with VEYE-MIPI-290-327 front.jpg|center|thumb|树莓派经典款模组VEYE-MIPI-327B正面图|alt=|600x600px]]
+
 
[[File:Mini adpter with VEYE-MIPI-290-327 back.jpg|center|thumb|树莓派经典款模组VEYE-MIPI-327B背面图|alt=|600x600px]]
+
'''VEYE-MIPI-IMX327S,VEYE-MIPI-IMX462,VEYE-MIPI-IMX385均支持杜邦线5V供电和FFC排线供电,并可以自动适应模式。'''
<br />[[File:Veye-raspberry 3m.jpg|center|thumb|600x600px|树莓派与摄像头模组VEYE-MIPI-327B连接示意图|alt=]]
+
{| class="wikitable"
[[File:Veye-Wiring scheme01.jpg|center|thumb|600x600px|树莓派插接示意图|alt=]]
+
!VEYE-MIPI-IMX327S与树莓派接线图
[[File:Veye 290-327Wiring scheme00.jpg|center|thumb|600x600px|摄像头模组VEYE-MIPI-327B插接示意图|alt=]]
+
VEYE-MIPI-IMX462与树莓派接线图
[[File:ADP-E 001.jpg|alt=|center|thumb|600x600px|VEYE-MIPI-327E与树莓派接线图]]
+
 
[[File:ADP-E 003.jpg|alt=|center|thumb|600x600px|VEYE-MIPI-327E FPC连接方式]]
+
VEYE-MIPI-IMX385与树莓派接线图
 +
!VEYE-MIPI-IMX327S FPC连接方式
 +
VEYE-MIPI-IMX462 FPC连接方式
 +
 
 +
VEYE-MIPI-IMX385 FPC连接方式
 +
|-
 +
|[[File:RaspberryPi 3B+ -VEYE-MIPI-IMS327S 01.jpg|alt=|center|thumb|400x400px]]
 +
|[[File:RaspberryPi 3B+ -VEYE-MIPI-IMS327S 02.jpg|alt=|center|thumb|400x400px]]
 +
|}
 +
<br />
 +
{| class="wikitable"
 +
!VEYE-MIPI-327E与树莓派接线图
 +
!VEYE-MIPI-327E FPC连接方式
 +
|-
 +
|[[File:ADP-E 001.jpg|alt=|center|thumb|400x400px]]
 +
|[[File:ADP-E 003.jpg|alt=|center|thumb|400x400px]]
 +
|}
 +
<br />
 +
{| class="wikitable"
 +
!树莓派与摄像头模组VEYE-MIPI-327B连接示意图
 +
!摄像头模组VEYE-MIPI-327B插接示意图
 +
|-
 +
|[[File:Veye-raspberry 3m.jpg|center|thumb|400x400px|alt=]]
 +
|[[File:Veye 290-327Wiring scheme00.jpg|center|thumb|400x400px|alt=]]
 +
|}
    
===树莓派系统安装及配置===
 
===树莓派系统安装及配置===
Line 84: Line 124:  
与此同时,实现视频实时显示到HDMI输出。(如不需要preview功能,可以添加 ''-n'' 选项)
 
与此同时,实现视频实时显示到HDMI输出。(如不需要preview功能,可以添加 ''-n'' 选项)
   −
*veye_raspivid 网络传输(gstreamer)
+
*veye_raspivid 网络传输(gstreamer tcp)
    
'''''树莓派一侧执行'''''
 
'''''树莓派一侧执行'''''
Line 101: Line 141:     
gstreamer的windows版本下载地址。只安装runtime files即可。
 
gstreamer的windows版本下载地址。只安装runtime files即可。
 +
 +
*veye_raspivid 网络传输(gstreamer udp)
 +
 +
电脑一侧,如为windows系统,建议使用powershell。
 +
 +
'''''电脑一侧使用gstreamer'''''
 +
 +
<code>gst-launch-1.0.exe -v udpsrc port=5321 ! gdpdepay ! rtph264depay ! avdec_h264 ! autovideosink sync=false</code>
 +
 +
'''''树莓派一侧执行'''''
 +
 +
<code>./veye_raspivid -b 4000000 -t 0 -o -  | gst-launch-1.0 -v fdsrc ! h264parse ! rtph264pay config-interval=1 pt=96 ! gdppay ! udpsink host=x.x.x.x port=5000 sync=false</code>
 +
 +
码流带宽为4Mbps,持续传输,监听端口为5000。
 +
 +
其中x.x.x.x为HOST PC的IP地址,需要先运行pc端程序,再运行树莓派端程序。
    
*veye_raspivid 网络传输(direct tcp stream with netcat)
 
*veye_raspivid 网络传输(direct tcp stream with netcat)
Line 168: Line 224:  
<code>sudo apt-get update && sudo apt-get install libopencv-dev</code>
 
<code>sudo apt-get update && sudo apt-get install libopencv-dev</code>
   −
<code>sudo apt-get install python-opencv</code>
+
<code><s>sudo apt-get install python-opencv</s></code>
 +
 
 +
<code>sudo apt-get install python3-opencv</code>
    
<code>sudo apt-get install  libzbar-dev</code>
 
<code>sudo apt-get install  libzbar-dev</code>
Line 252: Line 310:  
连续获取YUV数据并转为opencv格式,显示。
 
连续获取YUV数据并转为opencv格式,显示。
 
===视频控制软件包使用===
 
===视频控制软件包使用===
我们使用I2C-0作为控制总线。我们提供了一个脚本camera_i2c_config进行总线的管脚复用配置。
+
视频控制软件包实际上是一个i2c命令的shell脚本,在i2c_cmd目录下。
 +
 
 +
我们提供了一个脚本camera_i2c_config进行总线的管脚复用配置。
    
具体使用说明请见:[[VEYE-MIPI-290/327/zh/i2c|I2C脚本使用说明]]
 
具体使用说明请见:[[VEYE-MIPI-290/327/zh/i2c|I2C脚本使用说明]]
  −
PS:新版本PiOS需要使用i2c-10,如果i2c-0不通,请尝试 -b 10。
   
===关于树莓派Computer Module 和树莓派Zero使用的补充说明===
 
===关于树莓派Computer Module 和树莓派Zero使用的补充说明===
   Line 318: Line 376:  
====视频控制软件包使用====
 
====视频控制软件包使用====
 
点击[https://www.raspberrypi.org/documentation/hardware/computemodule/dt-blob-dualcam.bin 链接]下载dt-blob-dualcam.bin,改名为dt-blob.bin文件,将文件放在/boot下,然后执行命令:
 
点击[https://www.raspberrypi.org/documentation/hardware/computemodule/dt-blob-dualcam.bin 链接]下载dt-blob-dualcam.bin,改名为dt-blob.bin文件,将文件放在/boot下,然后执行命令:
  −
===== CM3 =====
  −
CM3模块采用分时复用I2C1的方式来进行I2C通信
  −
  −
<code>./camera_i2c_config [cameranum]</code>
  −
{| class="wikitable"
  −
!cameranum
  −
!description
  −
|-
  −
|0
  −
|CAM0
  −
|-
  −
|1
  −
|CAM1
  −
|}
  −
<code>./veye_mipi_i2c.sh -b 1</code>
  −
  −
===== CM4 =====
  −
CM4模块采用两路I2C分别与两个摄像头通信
  −
  −
<code>./camera_i2c_config</code>
  −
{| class="wikitable"
  −
!i2c bus num
  −
!description
  −
|-
  −
|0
  −
|CAM0
  −
|-
  −
|10
  −
|CAM1
  −
|}<code>./veye_mipi_i2c.sh -b [i2c bus num]</code>
      
其余选项具体使用说明详见:[http://wiki.veye.cc/index.php/VEYE-MIPI-290/327/zh/i2c I2C脚本使用说明]
 
其余选项具体使用说明详见:[http://wiki.veye.cc/index.php/VEYE-MIPI-290/327/zh/i2c I2C脚本使用说明]

Navigation menu