Changes

Jump to navigation Jump to search
Line 1: Line 1:  
[[VEYE MIPI 290/327 for Raspberry Pi/zh|查看中文]]
 
[[VEYE MIPI 290/327 for Raspberry Pi/zh|查看中文]]
   −
'''How to Use Veye Mipi Camera with Raspberry Pi'''
+
'''[[VEYE-MIPI-290/327 for Raspberry Pi|<big><big><big><big>How to use VEYE-MIPI-290/327 camera module on Raspberry Pi</big></big></big></big>]]'''
    
===Introduction===
 
===Introduction===
Line 12: Line 12:     
*Raspberry PI Items : RPI, Network, MicroSD Card, Power, Monitor
 
*Raspberry PI Items : RPI, Network, MicroSD Card, Power, Monitor
*Camera Module Items : VEYE-MIPI-290/327, FFC,Dupont Line,Lens,Adaptor Board. (We developed 2 types of adaptor boards, [[Mini Adapter Board|Mini Adaptor Board]] and [[Adapter Board for Raspberry Pi|Adaptor Board]]. Mini board only support Standard RPI,Adaptor Board support both Standard RPI and CM & Zero.)
+
*Camera Module Items : VEYE-MIPI-290/327,FFC,Dupont Wire,Lens,Adaptor Board. (We developed 2 types of adaptor boards, [[Mini Adapter Board|Mini Adaptor Board]] and [[Adapter Board for Raspberry Pi|Adaptor Board]]. Mini board only support Standard RPI,Adaptor Board support both Standard RPI and CM & Zero.)
    
'''Setup guide'''
 
'''Setup guide'''
    
*Connect the VEYE Camera Module the CSI-2 port using FFC Cable('''type B''').
 
*Connect the VEYE Camera Module the CSI-2 port using FFC Cable('''type B''').
*Connect Dupont Line as shown below. VEYE-MIPI-290/327 need an addtional power.
+
*Connect Dupont Wire as shown below. VEYE-MIPI-290/327 need an addtional power.
 
*Startup RaspberryPi.
 
*Startup RaspberryPi.
 +
 +
[[File:Mini adpter with VEYE-MIPI-290-327 front.jpg|center|thumb|Mini adpter with VEYE-MIPI-290-327 front|alt=|600x600px]]
 +
[[File:Mini adpter with VEYE-MIPI-290-327 back.jpg|center|thumb|Mini adpter with VEYE-MIPI-290-327 back|alt=|600x600px]]
 +
 +
    
<br />[[File:Veye-raspberry 3m.jpg|center|thumb|600x600px|Connect VEYE to RPI]][[File:Veye-Wiring scheme01.jpg|center|thumb|600x600px|Connect VEYE to RPI (part1)]]<br />[[File:Veye 290-327Wiring scheme00.jpg|center|thumb|600x600px|Connect VEYE(mini adaptor board) to RPI (part2)]]
 
<br />[[File:Veye-raspberry 3m.jpg|center|thumb|600x600px|Connect VEYE to RPI]][[File:Veye-Wiring scheme01.jpg|center|thumb|600x600px|Connect VEYE to RPI (part1)]]<br />[[File:Veye 290-327Wiring scheme00.jpg|center|thumb|600x600px|Connect VEYE(mini adaptor board) to RPI (part2)]]
Line 38: Line 43:  
*1. Clone from github
 
*1. Clone from github
   −
<code>git clone <nowiki>https://github.com/veyeimaging/raspberrypi</nowiki></code>
+
<code>git clone https://github.com/veyeimaging/raspberrypi<nowiki/>.git</code>
    
*2. Downloading from github ([https://github.com/veyeimaging/raspberrypi link here]),  upload to RPI using samba or USB disk.
 
*2. Downloading from github ([https://github.com/veyeimaging/raspberrypi link here]),  upload to RPI using samba or USB disk.
  −
[[File:Veye 123.png|center|thumb|600x600px|Software Tookits]]
      
====Toolkits Overview====
 
====Toolkits Overview====
 +
[[File:Rpi github overview.jpg|alt=|center|thumb|600x600px|Software Tookits on github]]
 +
Software toolkits contains three parts. ''veye_raspcam'' is raspcam alike Video Stream Toolkits, D_mipi_rpi is D-SDK Video Stream Toolkits, ''i2c_cmd'' is Video Control Toolkits.
   −
*Software toolkits contains two parts. ''veye_raspcam'' is Video Stream Toolkits, ''i2c_cmd'' is Video Control Toolkits.
   
*Video Stream Tookkits provides real-time display, capture, video recording, etc.
 
*Video Stream Tookkits provides real-time display, capture, video recording, etc.
 
*Video Control Toolkits is a shell script which provides ISP parameters configuration capbility.
 
*Video Control Toolkits is a shell script which provides ISP parameters configuration capbility.
Line 52: Line 56:     
===Video Stream Toolkits Manual===
 
===Video Stream Toolkits Manual===
 +
 +
====veye_raspcam: raspcam alike toolkits====
 +
<code>cd raspberrypi/veye_raspcam/bin/</code>
 +
 +
<code>chmod +x *</code>
 +
 
VS toolkits provides several ELF file.
 
VS toolkits provides several ELF file.
    
*veye_raspipreview
 
*veye_raspipreview
   −
<code>./veye_raspipreview -t 20000</code>
+
<code>./veye_raspipreview -t 20000 -p '0,0,1280,720'</code>
   −
Dispaly real-time video to HDMI output, lasts 20 seconds.
+
Dispaly real-time video to HDMI output,preview window is 1280*720, last 20 seconds.
    
<code>./veye_raspipreview -t -1</code>
 
<code>./veye_raspipreview -t -1</code>
   −
If t is -1, Show continuous Real-time display to HDMI output.
+
If t is -1, Show continuous Real-time display to HDMI output,full screen.
    
*veye_raspivid
 
*veye_raspivid
Line 68: Line 78:  
<code>./veye_raspivid -t 5000 -o ~/test.h264</code>
 
<code>./veye_raspivid -t 5000 -o ~/test.h264</code>
   −
Implement H.264 format encoding and record for 5 seconds,Record the stream data to file ~/test.h264.
+
Implement H.264 format encoding and record for 5 seconds,Record the stream data to file ~/test.h264.  
 +
 
 +
At the same time,Dispaly real-time video to HDMI output.(use ''-n'' if you do not want preview)
 +
 
 +
*veye_raspivid  (direct tcp stream with '''netcat,gstreamer''' etc..)
 +
 
 +
'''''RPI side'''''
 +
 
 +
<code>./veye_raspivid -b 4000000 -t 0 -o - | nc -l -p 5000</code>
 +
 
 +
H.264 encoding on bitrate 4Mbps,forever,listen on TCP port 5000.
 +
 
 +
'''''PC side,using gstreamer(Powershell recommended)'''''
 +
 
 +
<code>./gst-launch-1.0 -v tcpclientsrc host=x.x.x.x port=5000 ! decodebin ! autovideosink</code>
 +
 
 +
x.x.x.x is RPI IP address
 +
 
 +
'''''gstreamer''''' windows version [https://gstreamer.freedesktop.org/documentation/installing/on-windows.html?gi-language=c download].
 +
 
 +
'''''PC side, using mplayer'''''
 +
 
 +
<code>./mplayer -x 1280 -y 720 -geometry 0:0 -fps 200 -demuxer h264es -noborder ffmpeg://tcp://x.x.x.x:5000</code>
 +
 
 +
x.x.x.x is RPI IP address
 +
 
 +
mplayer for windows [http://mplayerwin.sourceforge.net/downloads.html download]
    
*veye_raspividyuv
 
*veye_raspividyuv
Line 81: Line 117:     
Record one UYVY data to file /dev/shm/  directory(which is in DDR).
 
Record one UYVY data to file /dev/shm/  directory(which is in DDR).
 +
 +
*veye_raspstillyuv
 +
 +
<code>./veye_raspistillyuv -o /dev/shm/test.yuv</code>
 +
 +
Capturing one image and save to /dev/shm directory(which is in DDR).1920*1080 YUV420 I420 format.
 +
 +
<code>./veye_raspistillyuv -tl 50 -t 1000 -o /dev/shm/test%d.yuv</code>
 +
 +
Capturing one image every 50 milliseconds and save to /dev/shm directory(which is in DDR).1920*1080 YUV420 I420 format.
    
*veye_raspistill
 
*veye_raspistill
   −
Capture a image and save it as jpeg file.DEVELOPING.<br />
+
<code>./veye_raspistill -o ~/test.jpg</code>
 +
 
 +
Capturing one image and save to home directory.1920*1080 JPG  format.
 +
 
 +
<code>./veye_raspistill -e bmp -tl 50 -t 1000  -o /dev/shm/test%d.bmp</code>
 +
 
 +
Capturing one image every 50 milliseconds and save to /dev/shm directory(which is in DDR).1920*1080 BMP format.
 +
 
 +
<code>./veye_raspistill -k -o ~/test%d.jpg -t 0</code>
 +
 
 +
Display video to HDMI,capture jpg image using keyboard,Enter to capture,X Enter to quit.
 +
 
 +
veye_raspistill support preview,-n will not preview。
 +
====D-SDK Toolkits Manual====
 +
It contains three parts: C language SDK(libdmipicam.so),C language sample,Python language sample.
 +
 
 +
=====Install support package=====
 +
<code>sudo apt-get update && sudo apt-get install libopencv-dev</code>
 +
 
 +
<code>sudo apt-get install python-opencv</code>
 +
 
 +
<code>sudo apt-get install libzbar-dev</code>
 +
=====D-SDK=====
 +
 
 +
*interface:
 +
 
 +
opensource,D_mipicam.h
 +
 
 +
*compile:
 +
 
 +
<code>./buildme</code>
 +
 
 +
*install:
 +
 
 +
<code>sudo install -m 644 ./libdmipicam.so /usr/lib/</code>
 +
=====C sample=====
 +
 
 +
*preview
 +
 
 +
Dispaly real-time video to HDMI output
 +
 
 +
*preview-dualcam
 +
 
 +
Dispaly real-time video to HDMI output for dual cameras(RPI CM)
 +
 
 +
*video
 +
 
 +
H.264 format encoding and record to file.
 +
 
 +
*capture
 +
 
 +
Capture one jpeg image.
 +
 
 +
*video2stdout
 +
 
 +
H.264 format encoding and send to stdout,which could be used by pipe. It's like <code>veye_raspivid -o -</code>.
 +
 
 +
<code>./video2stdout | nc -l -p 5000</code>
 +
 
 +
*capture_yuv
 +
 
 +
Capture one yuv image.
 +
 
 +
*capture-dualcam
 +
 
 +
Capture jpeg images for dual cameras.
 +
 
 +
*yuv_stream
 +
 
 +
Shows how to get yuv stream.
 +
 
 +
*capture2opencv
 +
 
 +
Shows how to get yuv stream,transfer to opencv format and display it.
 +
 
 +
*qrcode_detection
 +
 
 +
Shows how to get yuv stream,transfer to opencv format and display it and detect QR code.
 +
 
 +
=====Python sample=====
 +
 
 +
*preview.py
 +
 
 +
Dispaly real-time video to HDMI output
 +
 
 +
*capture.py
 +
 
 +
Capture one jpeg image.
 +
 
 +
*capture_yuv.py
 +
 
 +
capture_yuv
 +
 
 +
*video.py
 +
 
 +
H.264 format encoding and record to file.
 +
 
 +
*capture2opencv.py
 +
 
 +
Shows how to get yuv stream,transfer to opencv format and display it.
 
===Video Control Toolkits Manual===
 
===Video Control Toolkits Manual===
 
On Raspberry Pi, I2C-0 is used by GPU. We use I2C-1 as control bus for VEYE Camera Module. We provide a Shell Script — camera_i2c_config— to config pin usage.
 
On Raspberry Pi, I2C-0 is used by GPU. We use I2C-1 as control bus for VEYE Camera Module. We provide a Shell Script — camera_i2c_config— to config pin usage.
   −
Video Control Toolkits Manual : [[VEYE-MIPI-290/327 i2c/zh|VEYE-MIPI-290/327 i2c]]
+
Video Control Toolkits Manual : [[VEYE-MIPI-290/327 i2c/|VEYE-MIPI-290/327 i2c]]
 
<br />
 
<br />
 
===RPI Computer Module and RPI Zero Additional Info===
 
===RPI Computer Module and RPI Zero Additional Info===
Line 122: Line 267:     
For WAVESHARE CMIO board, as shown below.
 
For WAVESHARE CMIO board, as shown below.
 +
[[File:Adpter with VEYE-MIPI-290-327 front.jpg|center|thumb|Adpter with VEYE-MIPI-290-327 front|alt=|600x600px]]
 +
[[File:Adpter with VEYE-MIPI-290-327 back.jpg|center|thumb|Adpter with VEYE-MIPI-290-327 back|alt=|600x600px]]
 +
<br />
 
[[File:Veye-computer module.jpg|center|thumb|600x600px|RPI CM2 to dual VEYE modules]]
 
[[File:Veye-computer module.jpg|center|thumb|600x600px|RPI CM2 to dual VEYE modules]]
   Line 151: Line 299:  
====Video Control Toolkits====
 
====Video Control Toolkits====
 
Downloading dt-blob.bin file from link,and upload it to /root/,reboot RPI.  
 
Downloading dt-blob.bin file from link,and upload it to /root/,reboot RPI.  
 +
 +
CM3 use I2C-1 to control 2 cameras,It is time-sharing multiplexing.
    
<code>./camera_i2c_config [cameranum]</code>
 
<code>./camera_i2c_config [cameranum]</code>
Line 162: Line 312:  
|1
 
|1
 
|CAM1
 
|CAM1
|}<code>./veye_mipi_i2c.sh -b [i2c bus num]</code>
+
|}<code>./veye_mipi_i2c.sh -b 1</code>
{| class="wikitable"
+
 
!i2c bus num
+
<br />Other options see : [[VEYE-MIPI-290/327 i2c/zh|VEYE-MIPI-290/327 i2c]]
!description
  −
|-
  −
|0
  −
|CAM0
  −
|-
  −
|1
  −
|CAM1
  −
|}<br />Other options see : [[VEYE-MIPI-290/327 i2c/zh|VEYE-MIPI-290/327 i2c]]
   
===FFC Cable Remarks===
 
===FFC Cable Remarks===
  

Navigation menu