资源简介
纯C深度学习库,采用VS2010编译,里面包含训练数据MNIST,点击就能生成,包括训练和预测,另外送一个C读取图片的文件,有必要自己改写代码

代码片段和文件信息
/*
*This program will open a imageand output to another file
*Author:hujian in nankai 2016/3/29
*/
#include
#include
using namespace std;
#define __FILENAME “./img/in.jpg“ //this is the default imageif no input filenamethe image will be used
int main()
{
//the fp is the file stream of reading data
//the out is the file stream of writing to file(hex)
//the dst file is the file stream of dest image
//
FILE *fp *out *dstFile;
//this is the image size
//we will use fseek and ftell to get the size
//
long int size;
unsigned char ch ch1 ch2;
//get the higt bites and low bites
//
unsigned char high low;
//this is the image name buffer
//
char pic_name[30];
memset(pic_name 0 sizeof(pic_name));
//we can input the file‘s nameand the program will open the image and do some
//oprtationsuch as read datawrite from image data..
//
//#define INPUT
#ifdef INPUT //if we want to input the filename just define the input.
printf(“\nPlease input the image‘s name:“);
cin >> pic_name;
#else //okyou don‘t want to input
strcpy_s(pic_name__FILENAME);
#endif INPUT
printf_s(“The filename is:%s\n“ pic_name);
//the follow lines will open the file
//
{
//open the src image for reading the image data
//
fopen_s(&fp pic_name “rb“);
//open the text stream(write)
//
fopen_s(&out“res.txt“ “wb+“);
//open the dest image file stream
//
fopen_s(&dstFile“./img/res.jpg“ “wb+“);
//okcheck the file stream
//
{
if (!fp || !out || !dstFile){
printf_s(“Can not open the file you inputcheck the filename and re-try\n“);
//exit(EXIT_FAILURE);
}
}
}//end of open filenow we get the file stream done.
//we want to get the size of the imagewe just use the fseek and ftell get the size
//
fseek(fp 0 SEEK_END);
size = ftell(fp);
//printf the size
printf(“get the size is: %d\n“ size);
//rewind means jump to start of the file
//
rewind(fp);
//traversal the image data
//
long int i;
for (i = 0; i {
ch = fgetc(fp);
high = ch >> 4;
low = ch & 0x0f;
if (high < 10)
high += ‘0‘;
else
high += 55;
if (low < 10)
low += ‘0‘;
else
low += 55;
//write to file stream out
//
fputc(high out);
fputc(low out);
fputc(‘ ‘ out);
//16 one line
//
if (i % 16 == 0)
fprintf(out “\r\n“);
}
//jump to start of the image file
//
rewind(fp);
bool FormatRight = false;
for (i = 0; i {
ch1 = fgetc(fp);
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
....... 876 2017-04-27 03:40 CNN\CNN.sln
....... 3515 2017-04-27 03:40 CNN\CNN\CNN.vcxproj
....... 1493 2017-04-27 03:40 CNN\CNN\CNN.vcxproj.filters
....... 143 2017-04-27 03:40 CNN\CNN\CNN.vcxproj.user
文件 21411 2018-02-12 14:02 CNN\CNN\cnn.cpp
....... 4059 2017-04-27 03:40 CNN\CNN\cnn.h
文件 5161 2018-02-12 19:49 CNN\CNN\main.cpp
....... 5817 2017-04-27 03:40 CNN\CNN\mat.cpp
....... 1357 2017-04-27 03:40 CNN\CNN\mat.h
....... 15592 2017-04-27 03:40 CNN\CNN\minst.cnn
文件 4242 2018-02-10 19:41 CNN\CNN\minst.cpp
....... 934 2017-04-27 03:40 CNN\CNN\minst.h
....... 37 2017-04-27 03:40 CNN\CNN\Minst\ReadMe.txt
文件 7840016 2017-12-24 23:01 CNN\CNN\Minst\test-images.idx3-ubyte
文件 10008 2017-12-24 23:00 CNN\CNN\Minst\test-labels.idx1-ubyte
文件 47040016 2017-12-24 23:00 CNN\CNN\Minst\train-images.idx3-ubyte
文件 60008 2017-12-24 23:00 CNN\CNN\Minst\train-labels.idx1-ubyte
文件 3801 2018-02-12 19:34 CNN\readImageC.c
目录 0 2018-02-10 19:37 CNN\CNN\Minst\testImgs
目录 0 2018-02-12 14:01 CNN\CNN\PicTrans\CNNData
目录 0 2017-04-27 03:40 CNN\CNN\Minst
目录 0 2018-02-10 19:38 CNN\CNN\PicTrans
目录 0 2017-04-27 03:40 CNN\CNN
目录 0 2017-04-27 03:40 CNN
----------- --------- ---------- ----- ----
55018486 24
- 上一篇:JSN-SR04T超声波测距资料
- 下一篇:矩形检测OPENCV
相关资源
- 异质超电势的有限变形:全纯Chern-S
- 广联达6.0写锁包,2020年11月最新
- 机器学习个人笔记完整版v5.2-A4打印版
- 深度学习卷积神经网络可检测和分类
- GAN对抗式生成网络的应用:从图片上
- [en]深度学习[Deep Learning: Adaptive Compu
- 李宏毅-机器学习(视频2017完整)
- 吴恩达深度学习第一课第四周作业及
- 机器学习深度学习 PPT
- 麻省理工:深度学习介绍PPT-1
- Wikipedia机器学习迷你电子书之四《D
- 深度学习在遥感中的应用综述
- 深度学习数据集标注
- 深度学习算法实践源码-吴岸城
- 李宏毅深度学习ppt
- SSD目标检测算法论文-英文原版
- 台湾李宏毅教授深度学习讲义 pdf
- 基于深度学习实现人脸识别包含模型
- 深度学习与PyTorch-代码和PPT.zip
- 测试工程源码1(一种基于深度学习的
- 深度学习: MNIST的数据集
- 《深度学习》 高清版本中文PDFIan Go
- 今日头条38万条新闻数据标题
- 深度学习算法论文
- TensorFlow Machine Learning Cookbook+无码高清
- Hands-On Machine Learning with Scikit-Learn an
- Neural Networks:Tricks of the Trade+无码高清
- 基于深度学习的图像超分辨率算法论
- DES 纯c实现(des.c和des.h) 含pkcs1填充
- 人工智能初步学习总结
评论
共有 条评论