遍历读取路径下所有图像

 for(int i=1;i<200;i++)
 {
	int number = i;
	char string[25];
	/*sprintf(string,"%d",i);*/
	itoa(number, string, 10);
	CString pathname=CString("C:\\Users\\Administrator\\Desktop\\lot号截图(1)\\lot号截图\\")+CString(string)+CString(".bmp");

	Mat src = imread(pathname.GetBuffer());
	flip(src,src,0);
	imwrite(pathname.GetBuffer(),src);
 }

你可能感兴趣的:(编程基础)