首页 > 其他 > 详细

mnist数据集转换bmp图片

时间:2015-12-10 12:45:52      阅读:647      评论:0      收藏:0      [点我收藏+]

Mat格式mnist数据集下载地址:http://www.cs.nyu.edu/~roweis/data.html

 

Matlab转换代码:

load(mnist_all.mat);
type = train;
savePath = G:\data\mnist\train\‘;
for num = 0:1:9
    numStr = num2str(num);
    tempNumPath = strcat(savePath, numStr);
    mkdir(tempNumPath);
    tempNumPath = strcat(tempNumPath,\‘);
    tempName = [type, numStr];
    tempFile = eval(tempName);
    [height, width]  = size(tempFile);
    for r = 1:1:height
        tempImg = reshape(tempFile(r,:),28,28);
        tempImgPath = strcat(tempNumPath,num2str(r-1));
        tempImgPath = strcat(tempImgPath,.bmp);
        imwrite(tempImg,tempImgPath);
    end
end

 

mnist数据集转换bmp图片

原文:http://www.cnblogs.com/skyrudy/p/5035253.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!