#include <cv.h>
#include <highgui.h>
#include <cvaux.h>
using namespace std;
using namespace cv;
bool showSteps = true;
bool writeModel = true;
bool saveRegions = true;
#define dataNum ( 4381 )
int main()
{
FILE *fp;
int i,j;
if( ( fp=fopen("C:\\Temp\\negtives\\neg.txt","r") )==NULL ){
printf("can not open the file\n");
exit(0);
}
char *fileName = NULL;
fileName = (char *)malloc(dataNum*sizeof(char));
for(i=0;i<dataNum;i++){
//读取一行
fscanf(fp,"%s\n",fileName);
cout<<fileName<<endl;
}
fclose(fp);
waitKey(0);
}
OpenCV数字图像处理十:读写txt文件,在图像训练和测试的时候经常用到
最新推荐文章于 2025-04-17 09:04:08 发布