If you have a webcam attached to your computer, you can display video stream using OpenCV easily. Here's the basic code.
Listing 1: Display Video from Webcam
Save it to webcam.c and compile with command like this:
gcc webcam.c -o webcam
-I"C:\OpenCV\cv\include"
-I"C:\OpenCV\cxcore\include"
-I"C:\OpenCV\otherlibs\highgui"
-L"C:\OpenCV\lib" -lcxcore -lcv -lhighgui
Be sure to change C:\OpenCV with your OpenCV base directory. To run the program, type webcam from your command line.
What's next?
After you have successfully displayed video from your webcam, here are some possible things you can do to play around:
Learning OpenCV: Computer Vision with the OpenCV Library
By: Gary Bradski, Adrian Kaehler
This book is the "de facto" OpenCV User's Manual. It provides a practical, pragmatic, accessible book on computer vision, with algorithmic explanation and concrete example code snippets. Written by the creators of OpenCV, no doubt you should obtain a copy.
Nash on Jul 11, 2008:
lancer on Oct 5, 2008:
Jose on Nov 7, 2008:
Nash on Nov 8, 2008:
Yosef on Dec 14, 2008:
jackson on Dec 14, 2008:
Nash on Dec 14, 2008:
jackson on Dec 14, 2008:
Nash on Dec 14, 2008:
jackson on Dec 15, 2008:
lucky on Jan 6, 2009:
Nash on Jan 7, 2009:
Tab Khan on Jan 27, 2009:
Nash on Jan 28, 2009:
1.jpg, 2.jpg, ..., 10.jpg vishal on Mar 12, 2009:
Nash on Mar 13, 2009:
Robert on Mar 16, 2009:
Nash on Mar 16, 2009:
Kent on Mar 18, 2009:
Nash on Mar 18, 2009:
nel on Mar 22, 2009:
Deena on Apr 19, 2009:
Nash on Apr 20, 2009:
Deena on Apr 20, 2009:
| Tel. | +62 31 8662872 +62 856 338 6017 |
| ICQ | 489571630 |
| Skype | dede_bl4ckheart |
| Yahoo | dede_bl4ckheart |
| nashruddin.amin |
Tien Loc on Jul 10, 2008:
After I read I don't understand how to do it. How to put the code inside CamVideo.