#include "stdio.h"
#include "conio.h"
#include "cv.h"
#include "highgui.h"
#include "cxcore.h"
#include "cvaux.h"
int main(){
char* nomImages[] = {".\img_1.jpg", ".\img_2.jpg", ".\img_3.jpg", ".\img_4.jpg", ".\img_5.jpg", ".\img_6.jpg", ".\img_7.jpg", ".\img_8.jpg", ".\img_9.jpg", ".\img_10.jpg"};
CvCapture* capture = cvCaptureFromCAM(-1);
if(!capture){
printf("Error: Capture = NULL\n");
getchar();
return -1;
}
cvNamedWindow("cvSaveImage", 1);
for(int i=0; i<10;>
while(1){
IplImage* frame = cvQueryFrame(capture);
if(!frame) {
printf("Error: Frame = NULL\n");
getchar();
return -1;
}
cvShowImage("cvSaveImage", frame);
if((cvWaitKey(10) & 255)==27) break;
}
IplImage* frame = cvQueryFrame(capture);
if(!frame) {
printf("Error: Frame = NULL\n");
getchar();
return -1;
}
cvShowImage("cvSaveImage", frame);
cvSaveImage(nomImages[i], frame);
printf("imagen %d",i);
cvWaitKey(0);
}
cvReleaseCapture(&capture);
cvDestroyWindow("cvSaveImage");
return(0);
}
No hay comentarios:
Publicar un comentario