comparison 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
comparison
equal deleted inserted replaced
-1:000000000000 0:e9a9cd732c1e
1 function observe_reconstruction(Is,num,g,img_row,img_col)
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 % Saving images to files %
4 % Is: Images %
5 % sNum: Number of images to save %
6 % g: indices: imaged group gth %
7 % -*-sontran2012-*- %
8 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
9 if num>100, return; end;
10 dir = 'C://Pros/tmp/obsv/';
11 col = floor(sqrt(num));
12 row = ceil(num/col);
13 gap = 2;
14 pos = ones(1,col*row);
15 pos = cumsum(pos);
16 pos = vec2mat(pos,col);
17 bigImg = zeros(row*img_row + (row-1)*gap,col*img_col + (col-1)*gap);
18 for i=1:row
19 for j=1:col
20 y = 1 + (i-1)*(img_row+gap);
21 x = 1 + (j-1)*(img_col+gap);
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;
23 end
24 end
25 imwrite(bigImg,strcat(dir,'img_',num2str(g),'.bmp'),'BMP');
26 end
27