主题 : 采用V4L接口的CMOS Camera项目驱动代码 复制链接 | 浏览器收藏 | 打印
自由,自强,共享,共创。
级别: 论坛版主
UID: 12573
精华: 27
发帖: 8838
金钱: 46490 两
威望: 9298 点
贡献值: 27 点
综合积分: 18216 分
注册时间: 2010-01-09
最后登录: 2019-07-16
楼主  发表于: 2010-02-15 17:17

 采用V4L接口的CMOS Camera项目驱动代码

我们公司编写的CMOS CAMERA摄像头仅是一个简单的字符设备,它无法使用V4L接口编程,有国外的爱好者设计了标准接口的驱动,感兴趣的可以看看这里;
http://code.google.com/p/s3c2440camera/downloads/list

项目描述:

Implementation of Video 4 Linux interface for embedded systems based on Samsung S3C2440 CPU

Building & Installing

  • obtain ARM-Linux GCC 4.3.2 and Linux 2.6.29 from FriendlyARM 
  • setup environment variables CC,CPP etc, use this as a reference 
  • compile linux kernel , without S3C2440_CAMERA ( find line CONFIG_S3C2440_CAMERA=y and replace with CONFIG_S3C2440_CAMERA=m) 
  • install new kernel 
  • compile new camera module , make KERNELDIR=<whenever you have linux kernel> 
  • (optional) compile test program make test_capture 
  • (optional) compile tiff capture program make tiff_capture TIFFDIR=<where you have libtiff> 
  • copy kernel module s3c2440camera.ko to mini2440 
  • load kernel module insmod s3c2440camera.ko 
  • run the test capture program: ./test_capture /dev/video0 <width> <height> <filename base> [number of frames] 
  • Output of a sample session:

[root@FriendlyARM /] insmod s3c2440camera.ko
  Loading OV9650 driver.........
SCCB address 0x60, manufacture ID 0x7FA2, expect 0x7FA2
SCCB address 0x60, product ID 0x9652, expect 0x9650
OV9650 setting format 1  640x480 126 parameters!
ov9650 init done!
[root@FriendlyARM /]# ./test_capture /dev/video0 640 480 test 10
   OV9650 setting format 0  1280x1024 125 parameters!
OV9650 setting format 1  640x480 126 parameters!
Goint to capture frames 640 x 480 format: 422P framesize: 614400
About to capture 10 images to test
**********
29.886700 fps, Saving collectected frames...
0       1       2       3       4       5       6       7       8       9      
新手如何向我们反馈有效的信息,以便解决问题,见此贴:
http://www.arm9home.net/read.php?tid-14431.html

[注]: 此处签名链接仅为指引方向,而非解答问题本身.
级别: 新手上路
UID: 28361
精华: 0
发帖: 2
金钱: 10 两
威望: 2 点
贡献值: 0 点
综合积分: 4 分
注册时间: 2010-09-09
最后登录: 2012-02-21
1楼  发表于: 2012-02-21 13:47

 回 6楼(exp666) 的帖子

"不过数据格式是YUV422的,有没有RGB888的"这句话是外行,camera的sensor一般是yuv422的,有的有rgb565的,就是没有rgb888。cmos sensor中基本都可以输出raw模式的。