forked from brada/caltag
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.m
27 lines (20 loc) · 850 Bytes
/
main.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
function main(dataFile, outputFile, varargin)
% eg: main('test/output.mat', 'test/points.h5', 'test/test1.png', 'test/test2.png')
% when calling from deployed version this becomes:
% ./run_caltag.sh /path/to/MCR test/output.mat test/points.h5 test/*.png
nFiles = size( varargin, 2 );
if nFiles == 0
error( 'No input files found' );
end
for i = 1:nFiles
file = varargin{i};
fprintf( '%s', file );
[wPt,iPt] = caltag( file, dataFile, false );
fprintf( ': %d\n', size(wPt,1) );
dset = ['/', file, '/world'];
h5create( outputFile, dset, size(wPt), 'ChunkSize',[16,2], 'Deflate',9, 'Shuffle',true );
h5write( outputFile, dset, wPt );
dset = ['/', file, '/image'];
h5create( outputFile, dset, size(iPt), 'ChunkSize',[16,2], 'Deflate',9, 'Shuffle',true );
h5write( outputFile, dset, iPt );
end