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

Last change on this file since 903 was 810, checked in by g7moreau, 10 years ago
  • Add license
File size: 2.4 KB
Line 
1%=======================================================================
2% Copyright 2008-2014, 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
19if ~exist('I_1'),
20   active_images_save = active_images;
21   ima_read_calib;
22   active_images = active_images_save;
23   check_active_images;
24end;
25
26check_active_images;
27
28if isempty(ind_read),
29   return;
30end;
31
32
33n_col = floor(sqrt(n_ima*nx/ny));
34
35n_row = ceil(n_ima / n_col);
36
37
38ker2 = 1;
39for ii  = 1:n_col,
40   ker2 = conv(ker2,[1/4 1/2 1/4]);
41end;
42
43
44II = I_1(1:n_col:end,1:n_col:end);
45
46[ny2,nx2] = size(II);
47
48
49
50kk_c = 1;
51
52II_mosaic = [];
53
54for 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   
100end;
101
102figure(2);
103image(II_mosaic);
104colormap(gray(256));
105title('Calibration images');
106set(gca,'Xtick',[])
107set(gca,'Ytick',[])
108axis('image');
109
Note: See TracBrowser for help on using the repository browser.