dsdfdsfsdfds
```
#include#include#include "image_utils.h"#include#includeusing namespace std;using namespace cv;int main(void) {//------------将图像文件生成.txt-------------------------string fileName = "F:\\lena\\lena_gray.jpg";Mat image = imread(fileName, 0);FILE* fp = fopen("F:\\lena\\lena_gray_512x512.dat", "wb");for (int i = 0; i < image.rows; i++) {for (int j = 0; j < image.cols; j++) {//写入数据fprintf(fp, "%x\n", (int)image.at(i, j));
}
}
return 0;
}
```
网友评论