基于opencv在摄像头ubuntu根据视频获取
2015-08-16 13:45
501 查看
解压源代码包
然后进行make
配置opencv
Add the following line at the end of the file(it may be an empty file, that is ok) and then save it: 在opencv.conf中加入下面路径
sudo
Add these two lines at the end of the file and save it: 在bash.bashrc中加入下面环境变量
sudo reboot 重新启动电脑注意:一定要提前安装V4L等等库,不然编译能过。执行的时候没有画面。
http://xuxd32.blog.163.com/blog/static/48121933201192394550140/
ZedBoard-OpenCV打开摄像头失败解决方式及过程:
http://www.openhw.org/wicoboy/blog/13-04/293302_71692.html
超级天群博客
http://www.cnblogs.com/surpassal/
OpenCV移植到ARM 全过程 :点击打开链接【OpenHW12參赛手记】Zedboard-Linux-digilent3.6内核版本号不支持USB摄像头问题的解决方式 :http://www.eefocus.com/jefby1990/blog/13-03/292301_988aa.html点击打开链接
基于opencv在摄像头ubuntu根据视频获取
1 工具 原料
平台 :UBUNTU12.04安装库 Opencv-2.32 安装编译执行步骤
安装编译opencv-2.3 參考/article/1495659.html提前下载OPENCV源代码包官方:http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/我的:http://download.csdn.net/detail/xiabodan/7176253
2 | sudoapt-get update[code]sudo apt-get upgrade sudoapt-get[code]install build-essential libgtk2.0-dev libjpeg-dev libtiff4-dev libjasper-dev libopenexr-dev cmake python-dev python-numpy python-tk libtbb-dev libeigen2-dev yasm libfaac-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev libx264-dev libqt4-dev libqt4-opengl-dev sphinx-common texlive-latex-extra libv4l-dev libdc1394-22-dev libavcodec-dev libavformat-dev libswscale-dev |
3 | tar -xvf OpenCV-2.4.1. tar .bz2 |
4 | cd OpenCV-2.4.1 |
1 | mkdir build cmake配置MAKEFILE |
2 | cd build |
3 | cmake -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON .. |
1 | make |
2 | sudo make install |
1 | sudo gedit /etc/ld.so.conf.d/opencv.conf |
1 | /usr/ local /lib |
ldconfig
1 | sudo gedit /etc/ bash .bashrc |
1 | PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/ local /lib/pkgconfig |
2 | export PKG_CONFIG_PATH |
3 測试代码
编译g++ cameraCaptrue.cpp -o cameraCap `pkg-config --libs --cflags opencv`生成文件cameraCap执行 採集成功
./cameraCapcameraCaptrue.cpp
#include<stdio.h>接下来移植到zedboard上去
#include<math.h>
#include "highgui.h"
#include <cv.h>
#include <opencv2/opencv.hpp>
#include <opencv2/highgui/highgui.hpp>//#include <cvaux.h>
//#include <highgui\highgui_c.h>
//#include <core\types_c.h>
//#include <photo\photo_c.h>
//#include <imgproc\imgproc_c.h>
//#include <photo\photousing namespace cv;int main( int argc, char** argv )
{
printf("I am start \n");
VideoCapture cap(0); // open the default camera
if(!cap.isOpened()) // check if we succeeded
return -1;printf("%f, %f\n",cap.get(CV_CAP_PROP_FRAME_WIDTH),cap.get(CV_CAP_PROP_FRAME_HEIGHT));
cap.set(CV_CAP_PROP_FRAME_WIDTH, 320);
cap.set(CV_CAP_PROP_FRAME_HEIGHT, 240);
cap.set(CV_CAP_PROP_FPS, 15);
printf("%f, %f\n",cap.get(CV_CAP_PROP_FRAME_WIDTH),cap.get(CV_CAP_PROP_FRAME_HEIGHT));
Mat src_gray;
cvNamedWindow( "video", CV_WINDOW_AUTOSIZE );while(1)
{
Mat frame;
cvWaitKey(10);
cap >> frame;
imshow("video", frame);
}return 0;
}
參考:
http://www.cnblogs.com/liu-jun/archive/2013/12/24/3489675.htmlhttp://xuxd32.blog.163.com/blog/static/48121933201192394550140/
ZedBoard-OpenCV打开摄像头失败解决方式及过程:
http://www.openhw.org/wicoboy/blog/13-04/293302_71692.html
超级天群博客
http://www.cnblogs.com/surpassal/
OpenCV移植到ARM 全过程 :点击打开链接【OpenHW12參赛手记】Zedboard-Linux-digilent3.6内核版本号不支持USB摄像头问题的解决方式 :http://www.eefocus.com/jefby1990/blog/13-03/292301_988aa.html点击打开链接
相关文章推荐
- linux下配置phpInterperter
- dos命令pushd和popd讲解
- nginx启动、重启、关闭
- Linux下权限管理-文件特殊权限setUID/sticky BIT
- linux学习之路(3)
- linux设置默认启动的服务 NFS VSFTPD
- linux下安装phpstorm
- Stop Googling!
- Tomcat7.0.22安装配置
- 分享一个Chrome内核浏览器下比较好用的去视频广告插件
- 500 OOPS: cannot change directory:/root
- PHP连接Nginx服务器并解析Nginx日志的方法
- centos 7 图形界面 文本界面切换
- 2014 牡丹江现场赛 i题 (zoj 3827 Information Entropy)
- centos7 配置vim编辑器
- linux常见类库及简单介绍
- BASH脚本第五课
- OpenCL size_t error
- linux学习之路(2)
- nginx 常用配置说明