Mercurial > hg > simscene-py
comparison nonExposed/saveAnnotationTxt.m @ 14:b1901e8d8f5f
initial commit
author | Mathieu Lagrange <mathieu.lagrange@cnrs.fr> |
---|---|
date | Tue, 17 Mar 2015 09:34:13 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 14:b1901e8d8f5f |
---|---|
1 function [] = saveAnnotationTxt(sceneSchedule,outputPath,outputFileName) | |
2 | |
3 % This program was written by Mathias Rossignol & Grégoire Lafay | |
4 % is Copyright (C) 2015 IRCAM <http://www.ircam.fr> | |
5 % | |
6 % This program is free software: you can redistribute it and/or modify it | |
7 % under the terms of the GNU General Public License as published by the Free | |
8 % Software Foundation, either version 3 of the License, or (at your option) | |
9 % any later version. | |
10 % | |
11 % This program is distributed in the hope that it will be useful, but | |
12 % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | |
13 % or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
14 % for more details. | |
15 % | |
16 % You should have received a copy of the GNU General Public License along | |
17 % with this program. If not, see <http://www.gnu.org/licenses/>. | |
18 | |
19 sceneSchedule=sceneSchedule([sceneSchedule.isBackground]==0); | |
20 | |
21 onsets=[sceneSchedule.position]; | |
22 offsets=[sceneSchedule.position]+[sceneSchedule.duration]; | |
23 classes={sceneSchedule.classLabel}; | |
24 | |
25 [~,ind]=sort(onsets); | |
26 | |
27 fid = fopen([outputPath 'annotation/' outputFileName '.txt'],'w+'); | |
28 for jj=ind | |
29 fprintf(fid,'%.2f\t%.2f\t%s\n',onsets(jj),offsets(jj),classes{jj}); | |
30 end | |
31 fclose(fid); | |
32 | |
33 end | |
34 |