无标题文章

2018-08-26  本文已影响9人  侠之大者_7d3f

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;

}

```

上一篇下一篇

猜你喜欢

热点阅读