Based on OpenCV in webcam ubuntu based on video capture

Source: Internet
Author: User

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

sudoapt-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
4

CD  opencv-2.4.1

1

mkdir  build

cmake configuration 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 ..

Then make

1 make
2 sudomakeinstall

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

1 /usr/local/lib

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
2 exportPKG_CONFIG_PATH

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.