0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 function [g,h,std_i_g,std_i_h,par] = LSM_62_sym_generate_noisy_observing_images...
0018 (g_true,h_true,par)
0019
0020
0021 Mg = size(g_true,1);
0022 gv = min(255,max(0,round(g_true(:) +...
0023 randn(Mg^2,1).*sqrt(par.vg(round(g_true(:))+1)))));
0024 g = reshape(gv,Mg,Mg);
0025
0026
0027 Mh = size(h_true,1);
0028 hv = min(255,max(0,round(h_true(:) +...
0029 randn(Mh^2,1).*sqrt(par.vh(round(h_true(:))+1)))));
0030 h = reshape(hv,Mh,Mh);
0031
0032
0033 diff_g = conv2(g,par.Diff_filter,'valid');
0034 diff_h = conv2(h,par.Diff_filter,'valid');
0035 std_i_g = std(diff_g(:));
0036 std_i_h = std(diff_h(:));
0037
0038
0039 if par.plot_type > 1
0040 figure('Name','generated true images')
0041
0042 subplot(3,3,7);imshow(double(g)/255);title('g');axis equal
0043
0044
0045 subplot(3,3,9);imshow(double(h)/255);title('h');axis equal
0046
0047
0048 colormap(gray)
0049
0050 std_g_and_h = std([g(:);h(:)]-[g_true(:);h_true(:)])
0051 end
0052 end
0053