source: trunk/src/toolbox_calib/mosaic.m @ 962

Last change on this file since 962 was 926, checked in by sommeria, 8 years ago

geometry cqlib updated

File size: 1.5 KB
Line 
1
2if ~exist('I_1'),
3   active_images_save = active_images;
4   ima_read_calib;
5   active_images = active_images_save;
6   check_active_images;
7end;
8
9check_active_images;
10
11if isempty(ind_read),
12   return;
13end;
14
15
16n_col = floor(sqrt(n_ima*nx/ny));
17
18n_row = ceil(n_ima / n_col);
19
20
21ker2 = 1;
22for ii  = 1:n_col,
23   ker2 = conv(ker2,[1/4 1/2 1/4]);
24end;
25
26
27II = I_1(1:n_col:end,1:n_col:end);
28
29[ny2,nx2] = size(II);
30
31
32
33kk_c = 1;
34
35II_mosaic = [];
36
37for jj = 1:n_row,
38   
39   
40    II_row = [];
41   
42    for ii = 1:n_col,
43       
44        if (exist(['I_' num2str(kk_c)])) & (kk_c <= n_ima),
45           
46            if active_images(kk_c),
47                eval(['I = I_' num2str(kk_c) ';']);
48                %I = conv2(conv2(I,ker2,'same'),ker2','same'); % anti-aliasing
49                I = I(1:n_col:end,1:n_col:end);
50            else
51                I = zeros(ny2,nx2);
52            end;
53           
54        else
55           
56            I = zeros(ny2,nx2);
57           
58        end;
59       
60       
61       
62        II_row = [II_row I];
63       
64        if ii ~= n_col,
65           
66            II_row = [II_row zeros(ny2,3)];
67           
68        end;
69       
70       
71        kk_c = kk_c + 1;
72       
73    end;
74   
75    nn2 = size(II_row,2);
76   
77    if jj ~= n_row,
78        II_row = [II_row; zeros(3,nn2)];
79    end;
80   
81    II_mosaic = [II_mosaic ; II_row];
82   
83end;
84
85figure(2);
86image(II_mosaic);
87colormap(gray(256));
88title('Calibration images');
89set(gca,'Xtick',[])
90set(gca,'Ytick',[])
91axis('image');
92
Note: See TracBrowser for help on using the repository browser.