/**
* Display video from webcam
*
* Author Nash
* License GPL
* Website http://nashruddin.com
*/
#include <stdio.h>
#include "cv.h"
#include "highgui.h"
int main( int argc, char **argv )
{
CvCapture *capture = 0;
IplImage *frame = 0;
IplImage *iframe = 0;
int key = 0;
IplImage *frames[10];
int i = 0;
char *filename = "";
/* initialize camera */
capture = cvCaptureFromCAM( 0 );
/* always check */
if ( !capture ) {
fprintf( stderr, "Cannot open initialize webcam!\n" );
return 1;
}
/* create a window for the video */
cvNamedWindow( "result", CV_WINDOW_AUTOSIZE );
while( key != 'q' ) {
/* get a frame */
frame = cvQueryFrame( capture );
/* always check */
if( !frame ) break;
iframe=cvCloneImage( frame );
/* display current frame */
cvShowImage( "result5555", iframe );
/* copy first 10 frames to buffer */
//if( i < 10 ) {
// frames[i++] = cvCloneImage( frame );
// }
/* exit if user press 'q' */
key = cvWaitKey( 1 );
//fprintf( stderr, "Cannot open initialize webcam!\n" );
//for( i = 0 ; i < 10 ; i++ ) {
//sprintf( filename, "%d.jpg", (i+1) );
//cvSaveImage( filename, frames[i] );
//}
}
/* save images in buffer to disk */
//sprintf( filename, "%d.jpg", (i+1) );
//cvSaveImage( filename, iframe);
/* free memory */
cvDestroyWindow( "result" );
cvReleaseCapture( &capture );
return 0;
}
cam.rar_cam_object track
版权申诉
90 浏览量
2022-09-22
19:58:44
上传
评论
收藏 810B RAR 举报
alvarocfc
- 粉丝: 109
- 资源: 1万+
最新资源
- keil2 + proteus + 8051.exe
- 1961ee27df03bd4595d28e24b00dde4e_744c805f7e4fb4d40fa3f695bfbab035_8(1).c
- mediapipe-0.9.0.1-cp37-cp37m-win-amd64.whl.zip
- windows注册表编辑工具
- mediapipe-0.9.0.1-cp37-cp37m-win-amd64.whl.zip
- 校园通行码预约管理系统20240522075502
- 车类型数据集6250张VOC+YOLO格式.zip
- The PyTorch implementation of STGCN.STGCN-main.zip
- 092300108.cpp
- 车类型数据集6000张VOC+YOLO格式.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
评论0