diff options
Diffstat (limited to 'SD-VBS/common/toolbox/toolbox_basic/affine/simulation.m')
-rwxr-xr-x | SD-VBS/common/toolbox/toolbox_basic/affine/simulation.m | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/SD-VBS/common/toolbox/toolbox_basic/affine/simulation.m b/SD-VBS/common/toolbox/toolbox_basic/affine/simulation.m new file mode 100755 index 0000000..2186a6d --- /dev/null +++ b/SD-VBS/common/toolbox/toolbox_basic/affine/simulation.m | |||
@@ -0,0 +1,42 @@ | |||
1 | clear | ||
2 | |||
3 | figure(1);colormap(gray); | ||
4 | |||
5 | %------------ Parameters -------------------------- | ||
6 | window_size_h = 40; | ||
7 | window_size = 2*window_size_h+1; | ||
8 | noise_level = 40/256; | ||
9 | |||
10 | % define A and D | ||
11 | x_ext = -0.423; | ||
12 | ext = 1.232; | ||
13 | A = [ext+x_ext, 0.2534; 0.3423,ext]; | ||
14 | |||
15 | D = [3,1]; | ||
16 | |||
17 | %------------- compute image I and J --------------- | ||
18 | disp('generating I') | ||
19 | I_init = gen_feature_s(window_size); | ||
20 | [size_y,size_x] = size(I_init); | ||
21 | |||
22 | %define image center | ||
23 | [center_x,center_y] = find_center(size_x,size_y); | ||
24 | |||
25 | % adding noise to image I | ||
26 | I = I_init+noise_level*rand(size_y,size_x); | ||
27 | % make sure all intensities are positive | ||
28 | I = I.*(I>0); | ||
29 | |||
30 | disp('computing J') | ||
31 | J_init = compute_J(A,D,I_init,[center_x,center_y],[window_size_h,window_size_h]); | ||
32 | J = J_init+noise_level*rand(size_y,size_x); | ||
33 | J = J.*(J>0); | ||
34 | |||
35 | |||
36 | %------------- compute A and residue ---------------- | ||
37 | c = [center_x,center_y]; | ||
38 | num_iter = 8; w = 9;win_h = [window_size_h,window_size_h]; | ||
39 | |||
40 | fig_disp = 1; | ||
41 | [Ac,Dc,mask] = compute_AD_disp(I,J,c,c,win_h,num_iter,w,fig_disp); | ||
42 | |||