2010. 3. 13. 01:16
Computer Vision
// Test: video capturing from a camera
#include <OpenCV/OpenCV.h> // matrix operations
int main()
{
IplImage* image = 0;
// initialize capture from a camera
CvCapture* capture = cvCaptureFromCAM(0); // capture from video device #0
cvNamedWindow("camera");
while(1) {
if ( !cvGrabFrame(capture) ){
printf("Could not grab a frame\n\7");
exit(0);
}
else {
cvGrabFrame( capture ); // capture a frame
image = cvRetrieveFrame(capture); // retrieve the caputred frame
cvShowImage( "camera", image );
if( cvWaitKey(10) >= 0 )
break;
}
}
cvReleaseCapture( &capture ); // release the capture source
cvDestroyWindow( "camera" );
return 0;
}
#include <OpenCV/OpenCV.h> // matrix operations
int main()
{
IplImage* image = 0;
// initialize capture from a camera
CvCapture* capture = cvCaptureFromCAM(0); // capture from video device #0
cvNamedWindow("camera");
while(1) {
if ( !cvGrabFrame(capture) ){
printf("Could not grab a frame\n\7");
exit(0);
}
else {
cvGrabFrame( capture ); // capture a frame
image = cvRetrieveFrame(capture); // retrieve the caputred frame
cvShowImage( "camera", image );
if( cvWaitKey(10) >= 0 )
break;
}
}
cvReleaseCapture( &capture ); // release the capture source
cvDestroyWindow( "camera" );
return 0;
}
'Computer Vision' 카테고리의 다른 글
ARToolKit - simpleTest (0) | 2010.03.17 |
---|---|
Three-dimensional computer vision: a geometric viewpoint By Olivier Faugeras (0) | 2010.03.15 |
Leordeanu & Hebert, "Unsupervised learning for graph matching" (0) | 2010.03.04 |
ARToolKit test log (0) | 2010.03.03 |
Jonathan Mooser et al. "Tricodes: A Barcode-Like Fiducial Design for Augmented Reality Media" (0) | 2010.03.02 |