1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| #include "stdafx.h"
#include <cv.h>
#include <vector>
#include <string>
#include <cxcore.h>
#include <highgui.h>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
for (int k=0;k<5;k++)
{
std::string varimg;
char format[] = "name0%d.jpg";
char filename[sizeof format+100];
sprintf(filename,format,k);
varimg = filename ;
IplImage*imgw = cvLoadImage( varimg.c_str() );
cvNamedWindow( "Example1", CV_WINDOW_AUTOSIZE );
cvShowImage("Example1",varimg);
cvWaitKey(0);
cvReleaseImage(&varimg);
cvDestroyWindow( "Example1" );
}
return 0;
} |
Partager