Based on OpenCV in webcam ubuntu based on video capture
1 Tool Material
Platform: UBUNTU12.04
Installation Library Opencv-2.3
2 Installing the compilation execution steps
Installation compilation opencv-2.3 http://blog.csdn.net/xiabodan/article/details/23547847
Download OpenCV source code package in advance
Official: http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/
my: http://download.csdn.net/detail/xiabodan/7176253
2 |
sudo apt-get update
sudo apt-get upgrade
sudo apt-get 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
|
Extracting source code Packages
3 |
tar -xvf OpenCV-2.4.1. tar .bz2 |
1 |
mkdir build cmake configuration makefile |
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 .. |
Then make
Configure OPENCV
1 |
sudo gedit/etc/ld.so.conf.d/ opencv.conf |
add The following line at the end of the File (it may be a empty file, that's OK) and then save it: Add the following path in opencv.conf
sudoldconfig
1 |
sudo gedit/etc/ Code class= "Functions" >bash .BASHRC |
Add These-lines at the end of the file and SA ve it: Add the following environment variable in BASH.BASHRC
1 |
pkg_config_path= $PKG _config_path:/usr/ local /lib/pkgconfig |
sudo reboot restart your computer
Note: Be sure to pre-install v4l and so on library, or compile can be over, the execution of the time without pictures.
3 Test Code
Compile
g++ cameraCaptrue.cpp- o cameracap ' pkg-config--libs--cflags OpenCV '
Generate File Cameracap
Perform a collection success
./cameracap
CameraCaptrue.cpp
#include <stdio.h> #include <math.h> #include "highgui.h" #include <cv.h> #include <opencv2/ opencv.hpp> #include <opencv2/highgui/highgui.hpp>//#include <cvaux.h>//#include
Then transplant to Zedboard.
References:Http://www.cnblogs.com/liu-jun/archive/2013/12/24/3489675.html
http://xuxd32.blog.163.com/blog/static/48121933201192394550140/
ZEDBOARD-OPENCV open Camera failure resolution and process:
Http://www.openhw.org/wicoboy/blog/13-04/293302_71692.html
Super Day Group Blog
http://www.cnblogs.com/surpassal/
OpenCV porting to arm whole process: Click to open link
"OpenHW12" zedboard-linux-digilent3.6 kernel version number does not support USB camera problem Resolution: http://www.eefocus.com/jefby1990/blog/13-03/ 292301_988aa.html Click to open link
Based on OpenCV in webcam ubuntu based on video capture