annotate toolboxes/RBM/observe_reconstruction.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
rev   line source
wolffd@0 1 function observe_reconstruction(Is,num,g,img_row,img_col)
wolffd@0 2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
wolffd@0 3 % Saving images to files %
wolffd@0 4 % Is: Images %
wolffd@0 5 % sNum: Number of images to save %
wolffd@0 6 % g: indices: imaged group gth %
wolffd@0 7 % -*-sontran2012-*- %
wolffd@0 8 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
wolffd@0 9 if num>100, return; end;
wolffd@0 10 dir = 'C://Pros/tmp/obsv/';
wolffd@0 11 col = floor(sqrt(num));
wolffd@0 12 row = ceil(num/col);
wolffd@0 13 gap = 2;
wolffd@0 14 pos = ones(1,col*row);
wolffd@0 15 pos = cumsum(pos);
wolffd@0 16 pos = vec2mat(pos,col);
wolffd@0 17 bigImg = zeros(row*img_row + (row-1)*gap,col*img_col + (col-1)*gap);
wolffd@0 18 for i=1:row
wolffd@0 19 for j=1:col
wolffd@0 20 y = 1 + (i-1)*(img_row+gap);
wolffd@0 21 x = 1 + (j-1)*(img_col+gap);
wolffd@0 22 if pos(i,j) <= num, bigImg(y:y+img_row-1,x:(x+img_col-1)) = vec2mat(Is(pos(i,j),:),img_col); end;
wolffd@0 23 end
wolffd@0 24 end
wolffd@0 25 imwrite(bigImg,strcat(dir,'img_',num2str(g),'.bmp'),'BMP');
wolffd@0 26 end
wolffd@0 27