批量修改图片后缀

	char name[200];
	char saveName[200];
	for (int i=1;i<=516;i++)
	{
		sprintf(name,"C:\\Users\\Administrator\\Desktop\\Harr\\data\\cars128x128\\car_%04d.ppm",i);
		sprintf(saveName,"C:\\Users\\Administrator\\Desktop\\Harr\\data\\cars128x128\\%04d.bmp",i);
		IplImage *img=cvLoadImage(name);
		if (img)
		{
			cvNamedWindow("res");
			cvShowImage("res",img);
			cvWaitKey(10);
			cvSaveImage(saveName,img);
		}
	}

你可能感兴趣的:(小程序)