1 | %=======================================================================
|
---|
2 | % Copyright 2008-2015, LEGI UMR 5519 / CNRS UJF G-INP, Grenoble, France
|
---|
3 | % http://www.legi.grenoble-inp.fr
|
---|
4 | % Joel.Sommeria - Joel.Sommeria (A) legi.cnrs.fr
|
---|
5 | %
|
---|
6 | % This file is part of the toolbox UVMAT.
|
---|
7 | %
|
---|
8 | % UVMAT is free software; you can redistribute it and/or modify
|
---|
9 | % it under the terms of the GNU General Public License as published
|
---|
10 | % by the Free Software Foundation; either version 2 of the license,
|
---|
11 | % or (at your option) any later version.
|
---|
12 | %
|
---|
13 | % UVMAT is distributed in the hope that it will be useful,
|
---|
14 | % but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
15 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
16 | % GNU General Public License (see LICENSE.txt) for more details.
|
---|
17 | %=======================================================================
|
---|
18 |
|
---|
19 | if ~exist('I_1'),
|
---|
20 | active_images_save = active_images;
|
---|
21 | ima_read_calib;
|
---|
22 | active_images = active_images_save;
|
---|
23 | check_active_images;
|
---|
24 | end;
|
---|
25 |
|
---|
26 | check_active_images;
|
---|
27 |
|
---|
28 | if isempty(ind_read),
|
---|
29 | return;
|
---|
30 | end;
|
---|
31 |
|
---|
32 |
|
---|
33 | n_col = floor(sqrt(n_ima*nx/ny));
|
---|
34 |
|
---|
35 | n_row = ceil(n_ima / n_col);
|
---|
36 |
|
---|
37 |
|
---|
38 | ker2 = 1;
|
---|
39 | for ii = 1:n_col,
|
---|
40 | ker2 = conv(ker2,[1/4 1/2 1/4]);
|
---|
41 | end;
|
---|
42 |
|
---|
43 |
|
---|
44 | II = I_1(1:n_col:end,1:n_col:end);
|
---|
45 |
|
---|
46 | [ny2,nx2] = size(II);
|
---|
47 |
|
---|
48 |
|
---|
49 |
|
---|
50 | kk_c = 1;
|
---|
51 |
|
---|
52 | II_mosaic = [];
|
---|
53 |
|
---|
54 | for jj = 1:n_row,
|
---|
55 |
|
---|
56 |
|
---|
57 | II_row = [];
|
---|
58 |
|
---|
59 | for ii = 1:n_col,
|
---|
60 |
|
---|
61 | if (exist(['I_' num2str(kk_c)])) & (kk_c <= n_ima),
|
---|
62 |
|
---|
63 | if active_images(kk_c),
|
---|
64 | eval(['I = I_' num2str(kk_c) ';']);
|
---|
65 | %I = conv2(conv2(I,ker2,'same'),ker2','same'); % anti-aliasing
|
---|
66 | I = I(1:n_col:end,1:n_col:end);
|
---|
67 | else
|
---|
68 | I = zeros(ny2,nx2);
|
---|
69 | end;
|
---|
70 |
|
---|
71 | else
|
---|
72 |
|
---|
73 | I = zeros(ny2,nx2);
|
---|
74 |
|
---|
75 | end;
|
---|
76 |
|
---|
77 |
|
---|
78 |
|
---|
79 | II_row = [II_row I];
|
---|
80 |
|
---|
81 | if ii ~= n_col,
|
---|
82 |
|
---|
83 | II_row = [II_row zeros(ny2,3)];
|
---|
84 |
|
---|
85 | end;
|
---|
86 |
|
---|
87 |
|
---|
88 | kk_c = kk_c + 1;
|
---|
89 |
|
---|
90 | end;
|
---|
91 |
|
---|
92 | nn2 = size(II_row,2);
|
---|
93 |
|
---|
94 | if jj ~= n_row,
|
---|
95 | II_row = [II_row; zeros(3,nn2)];
|
---|
96 | end;
|
---|
97 |
|
---|
98 | II_mosaic = [II_mosaic ; II_row];
|
---|
99 |
|
---|
100 | end;
|
---|
101 |
|
---|
102 | figure(2);
|
---|
103 | image(II_mosaic);
|
---|
104 | colormap(gray(256));
|
---|
105 | title('Calibration images');
|
---|
106 | set(gca,'Xtick',[])
|
---|
107 | set(gca,'Ytick',[])
|
---|
108 | axis('image');
|
---|
109 |
|
---|