wolffd@0: function observe_reconstruction(Is,num,g,img_row,img_col) wolffd@0: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% wolffd@0: % Saving images to files % wolffd@0: % Is: Images % wolffd@0: % sNum: Number of images to save % wolffd@0: % g: indices: imaged group gth % wolffd@0: % -*-sontran2012-*- % wolffd@0: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% wolffd@0: if num>100, return; end; wolffd@0: dir = 'C://Pros/tmp/obsv/'; wolffd@0: col = floor(sqrt(num)); wolffd@0: row = ceil(num/col); wolffd@0: gap = 2; wolffd@0: pos = ones(1,col*row); wolffd@0: pos = cumsum(pos); wolffd@0: pos = vec2mat(pos,col); wolffd@0: bigImg = zeros(row*img_row + (row-1)*gap,col*img_col + (col-1)*gap); wolffd@0: for i=1:row wolffd@0: for j=1:col wolffd@0: y = 1 + (i-1)*(img_row+gap); wolffd@0: x = 1 + (j-1)*(img_col+gap); wolffd@0: 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: end wolffd@0: end wolffd@0: imwrite(bigImg,strcat(dir,'img_',num2str(g),'.bmp'),'BMP'); wolffd@0: end wolffd@0: