source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/BlueCCal/MultiCamSelfCal/LocalAlignments/joinoscars.m @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

File size: 2.0 KB
Line 
1% auxiliary script for joining particular oscar settings
2%
3% The current version is still not optimal. It would be good to have
4% some nicer version. It is not very automatic and it does not use the configdata
5%
6% $Id: joinoscars.m,v 1.5 2004/04/06 12:57:57 svoboda Exp $
7%
8
9clear all;
10
11datapath = '/home/svoboda/viroomData/oscar/demo_3p3c_p%d/';
12setups = [1:3]; % related to the data path
13path2save = '/home/svoboda/viroomData/oscar/oscardemo3/';
14
15% Some dirty scale factors to make ETH Oscar setup compatible
16% with Leuven libraries
17% the coordinates and resolutions will be divided by theses values
18scalefactor.cameras = 1;
19scalefactor.projectors = 1;
20
21% the following indexes are related to the setups
22idxcams = [1:4];
23idxproj = [5];
24
25% load the partial data sets and join them in a consitent way
26% tested with three setups, three cameras and one projector each.
27% the three cameras are the same for all the particular datasets
28Ws = []; IdMat = []; Res = [];
29for i=1:size(setups,2),
30        pts = load([sprintf(datapath,setups(i)),'points.dat']);
31        proj(1:3*size(setups,2),1:size(pts,2)) = NaN;
32        proj(i*3-2:i*3,:) = pts(idxproj*3-2:idxproj*3,:);
33        proj(i*3-2:i*3-1,:) = proj(i*3-2:i*3-1,:)/scalefactor.projectors;
34        pts(1:3:3*size(idxcams,2),:) = pts(1:3:3*size(idxcams,2),:)/scalefactor.cameras;
35        pts(2:3:3*size(idxcams,2),:) = pts(2:3:3*size(idxcams,2),:)/scalefactor.cameras;
36        Ws = [Ws, [pts(1:3*size(idxcams,2),:); proj]];
37        id = load([sprintf(datapath,setups(i)),'IdMat.dat']);
38        projid(1:size(setups,2),1:size(pts,2)) = 0;
39        projid(i,:)=id(idxproj,:);
40        IdMat = [IdMat,[id(idxcams,:); projid]];
41        Res = [Res; load([sprintf(datapath,setups(i)),'Res.dat'])];
42        proj =[]; projid=[];
43end
44% The Res matrix needs a special care when putting
45% camera and projector resolutions together
46Res2 = Res([idxcams,idxproj:size(idxcams,2)+1:end],:);
47Res2(idxcams,:) = Res2(idxcams,:)/scalefactor.cameras;
48Res2(end-2:end,:) = Res2(end-2:end,:)/scalefactor.projectors;
49
50% savings
51save([path2save,'points.dat'],'Ws','-ASCII');
52save([path2save,'IdMat.dat'],'IdMat','-ASCII');
53save([path2save,'Res.dat'],'Res2','-ASCII');
54
Note: See TracBrowser for help on using the repository browser.