Files
matlab/RBM/jimage.m
T
jens 7b34529b24 imported RBM
git-svn-id: http://moon:8086/svn/matlab/trunk@91 801c6759-fa7c-4059-a304-17956f83a07c
2016-07-12 11:24:12 +00:00

14 lines
554 B
Matlab

function jimage(data, label, nx, ny)
[numTrain, numPixel] = size(data);
for m=1:numTrain,
im0 = reshape(data(m,:), nx, ny)';
imwrite(im0, ['mnist_' num2str(label) '_' num2str(m) '.tif']);
[im_on, im_off] = retina(im0, 7, 0.3);
imwrite(0.5*(im_on - im_off) + 0.5, ['mnist_retina_' num2str(label) '_' num2str(m) '.tif']);
end
%imwrite(im_on, [dst_dir 'images\' filename '.on.tif']);
%imwrite(im_off, [dst_dir 'images\' filename '.off.tif']);
%imwrite(0.5*(im_on - im_off) + 0.5, [dst_dir 'images\' filename '.on_off.tif']);