티스토리 뷰

OS/Banana Pi /BPI-Bit

BPI-M2 ZERO - CSI camera

파란크리스마스 2017. 12. 23. 02:48
728x90

BPI-M2 Berry CSI camera Camera(OV5640)

출처 : BPI-M2+ OV5640 camera linux driver is work fine
BPI-M2+ camera module

Camera 모듈 설치

$ sudo vi /etc/modules

내용 추가

ov5640
vfe_v4l2

Camera 설치 확인

$ dmesg | grep OV
[    9.147594] [OV5640@lex]init_sensor - frame_rate: 0, max_win_size: 11
[    9.252262] [OV5640@lex]CSI_SUBDEV_PWR_ON!
[    9.331910] [OV5640@lex]sensor_init 0x0
[    9.380640] [OV5640@lex]CSI_SUBDEV_PWR_OFF!
$ ls /dev/video*
/dev/video0

Camera 정보

$ modinfo ov5640
filename:       /lib/modules/3.4.113-BPI-M2Z-Kernel/kernel/drivers/media/video/sunxi-vfe/device/ov5640.ko
license:        GPL
description:    A low-level driver for ov5640 sensors (H3 / A20)
author:         @lex
author:         raymonxiu
alias:          i2c:ov5640
depends:        cci,vfe_subdev
intree:         Y
vermagic:       3.4.113-BPI-M2Z-Kernel SMP preempt mod_unload modversions ARMv7 p2v8 
parm:           frame_rate:frame_rate=0 (default with no parameters), frame_rate=1 (7.5 FPS), frame_rate=2 (15 FPS), frame_rate=3 (30 FPS) (default=0 - or no parms - default settings) (uint)

Camera 캡쳐 프로그램 컴파일 및 실행

출처 : https://github.com/avafinger/ov5640

$ git clone https://github.com/avafinger/cap-v4l2
$ cd cap-v4l2
$ sudo ./install_deps.sh
$ ./build_script.sh

캡쳐

$ ./cap 1280 768 4 1 -999 -1 -1
---- cap parameters -----
width: 1280
height: 768
v4l2 buffers: 4
exposure: -999
hflip: -1
vflip: -1
Mode: V4L2_MODE_VIDEO
Driver: "sunxi-vfe"
Card: "sunxi-vfe"
Bus: "sunxi_vfe sunxi_vfe.0"
Version: 1.0
Capabilities: 05000001
Input: 0
V4L2 pixel formats:
0: [0x50323234] '422P' (planar YUV 422)
1: [0x32315559] 'YU12' (planar YUV 420)
2: [0x32315659] 'YV12' (planar YVU 420)
3: [0x3631564E] 'NV16' (planar YUV 422 UV combined)
4: [0x3231564E] 'NV12' (planar YUV 420 UV combined)
5: [0x3136564E] 'NV61' (planar YUV 422 VU combined)
6: [0x3132564E] 'NV21' (planar YUV 420 VU combined)
7: [0x32314D48] 'HM12' (MB YUV420)
8: [0x56595559] 'YUYV' (YUV422 YUYV)
9: [0x55595659] 'YVYU' (YUV422 YVYU)
10: [0x59565955] 'UYVY' (YUV422 UYVY)
11: [0x59555956] 'VYUY' (YUV422 VYUY)
12: [0x31384142] 'BA81' (RAW Bayer BGGR 8bit)
13: [0x47524247] 'GBRG' (RAW Bayer GBRG 8bit)
14: [0x47425247] 'GRBG' (RAW Bayer GRBG 8bit)
15: [0x47425247] 'GRBG' (RAW Bayer RGGB 8bit)
16: [0x30314742] 'BG10' (RAW Bayer BGGR 10bit)
17: [0x30314247] 'GB10' (RAW Bayer GBRG 10bit)
18: [0x30314142] 'BA10' (RAW Bayer GRBG 10bit)
19: [0x30314142] 'BA10' (RAW Bayer RGGB 10bit)
20: [0x32314742] 'BG12' (RAW Bayer BGGR 12bit)
21: [0x32314247] 'GB12' (RAW Bayer GBRG 12bit)
22: [0x32314142] 'BA12' (RAW Bayer GRBG 12bit)
23: [0x32314142] 'BA12' (RAW Bayer RGGB 12bit)
V4L2 pixel sizes:
( 2592 x 1936 ) Pixels
( 2048 x 1536 ) Pixels
( 1920 x 1080 ) Pixels
( 1600 x 1200 ) Pixels
( 1280 x 960 ) Pixels
( 1280 x 720 ) Pixels
( 1024 x 768 ) Pixels
( 800 x 600 ) Pixels
( 640 x 480 ) Pixels
( 320 x 240 ) Pixels
( 176 x 144 ) Pixels
 
Sensor size adjusted to: 1280x720 pixels
Pixel Format: V4L2_PIX_FMT_YUV420 [0x32315559]
Frame #10 will be saved!
Length: 1384448         Bytesused: 1384448      Address: 0x395528
FPS[0]: 11.37
Length: 1384448         Bytesused: 1384448      Address: 0x395530
FPS[1]: 33.30
Length: 1384448         Bytesused: 1384448      Address: 0x395538
FPS[2]: 33.02
Length: 1384448         Bytesused: 1384448      Address: 0x395540
FPS[3]: 33.03
Length: 1384448         Bytesused: 1384448      Address: 0x395528
FPS[4]: 32.11
Length: 1384448         Bytesused: 1384448      Address: 0x395530
FPS[5]: 33.46
Length: 1384448         Bytesused: 1384448      Address: 0x395538
FPS[6]: 33.70
Length: 1384448         Bytesused: 1384448      Address: 0x395540
FPS[7]: 33.77
Length: 1384448         Bytesused: 1384448      Address: 0x395528
FPS[8]: 33.42
Length: 1384448         Bytesused: 1384448      Address: 0x395530
FPS[9]: 4.21
------- Avg FPS: 33.23 --------
댓글
300x250
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/12   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
글 보관함