嵌入式系统V4L2采集YUYV格式的图像出错

wangwei3421 2017-05-06 05:38:37
Linux系统,USB摄像头利用V4L2采集YUYV格式的图像,在PC上利用QT Creator 和QTOPIA 工具均能采集完美的图像,可是,交叉编译生成arm版程序后,无论运行到友善之臂的Tiny210还是mini2440均得出了条纹状图像?求问大家,我这是哪里出了问题? 在PC上运行来看,程序是没有问题,为什么嵌入式arm运行出错?
...全文
390 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
wangwei3421 2021-01-13
  • 打赏
  • 举报
回复
引用 4 楼 qq_36084395 的回复:
您好,请问您问题解决了吗? 我也遇到了和您一样的问题
图像像素大小修改小点就可以了,可能跟板子USB速度有关系,图片过大数据量大,就没法采集图像
qq_36084395 2020-12-04
  • 打赏
  • 举报
回复
您好,请问您问题解决了吗? 我也遇到了和您一样的问题
jklinux 2017-05-07
  • 打赏
  • 举报
回复
原始的数据是指yuyv数据吗?如果是的话有可能在arm的系统上不支持yuyv数据格式,但基本都支持yuyv的
wangwei3421 2017-05-07
  • 打赏
  • 举报
回复
我试着保存了原始数据流,在PC上可以看到完整图像,移植到arm后,图像就变成了条纹状,模糊不清
jklinux 2017-05-07
  • 打赏
  • 举报
回复
有可能是刷图的处理出问题,可以先试着把一张图像存起来,看单张的文件是否正常。 另,在嵌入式里,usb摄像头的设备文件不一定是/dev/video0的
获取USB摄像头的1080p的JPEG格式的图片20180608_1806.7z 电脑上的系统:ubuntu14.04 // http://www.linuxidc.com/Linux/2011-03/33020.htm // V4L2摄像头获取单幅图片测试程序(MMAP模式) // [日期:2011-03-06] 来源:Linux社区 作者:aokikyon [字体:大 中 小] // // #加了点注释 // // #Rockie Cheng // printf #include #include // memset #include #include #include #include // close write usleep read #include #include #include #include #include #include // mmap #include #include #include #include // pthread_create pthread_join #include #define CLEAR(x) memset (&(x), 0, sizeof (x)) #define REQ_COUNT 6 #define uchar unsigned char struct buffer { void * start; size_t length; }; static char * dev_name = "/dev/video0";//摄像头设备名 static int fd = -1; struct buffer * buffers = NULL; // static unsigned int n_buffers = 0; // 2012-7-13 11:33 camera flag // static int iFlagCamera = 0; volatile int iFlagCamera = 0; // 函数名称:thread1 // 函数功能:用于接受键盘的输入,之后通知thread2抓图 // 参数列表: // 返回值 : void thread1(void) { char ch; printf("\n !!!!Warning!!!!\n Max 1000 color bmp\n Input the char: \n"); printf("\n !!!!press o an capture 1 frame picture! \n"); printf("\n !!!!press t an capture 10 frame picture! \n"); printf("\n !!!!press h an capture 100 frame picture! \n"); while(1) { while((ch=getchar()) != '\n') { printf("%c\n", ch); if('o'==ch) { iFlagCamera = 1; printf("thread1=%d\n", iFlagCamera); } else if('t'==ch) { iFlagCamera = 10; printf("thread1=%d\n", iFlagCamera); } else if('h'==ch) { iFlagCamera = 101; printf("thread1=%d\n", iFlagCamera); } else if('q'==ch) { iFlagCamera = 10001; printf("thread1=%d\n", iFlagCamera

16,216

社区成员

发帖
与我相关
我的任务
社区描述
Qt 是一个跨平台应用程序框架。通过使用 Qt,您可以一次性开发应用程序和用户界面,然后将其部署到多个桌面和嵌入式操作系统,而无需重复编写源代码。
社区管理员
  • Qt
  • 亭台六七座
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧