-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathagafaFotos.m
36 lines (29 loc) · 1.35 KB
/
agafaFotos.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
28
29
30
31
32
33
34
35
36
% @c This is part of the SocialDetector Software.
% @c Copyright (C) 2013 Antonio Jesús Urbano Torres
% @c Free Software Foundation, Inc.
% @c See the file README for copying conditions.
function fotosClasificar = agafaFotos()
directoriEntrenament=uigetdir(pwd,'Escull la carpeta on es troben les FOTOS que vols classificar:');
fotos=dir(directoriEntrenament);
L=length(fotos);
directori=uigetdir(pwd,'Escull la carpeta on són les METADADES ID I TITOL');
metadades=dir(directori);
path = strcat(directori,'\',metadades(3).name);
formats = '%s%s%s%s%s%s%s%s';
headerLines = 16;
delimiter = ',';
[basedades{1:8}] = textread(path, formats,'headerlines', headerLines, 'delimiter', delimiter);
for i=3:L
x = strcat(fotos(i).name);
x=x(1:length(x)-4); % Treiem el .jpg
for j= 1:(length(basedades{1,1})-3)
if(strcmp(x, basedades{1,1}{j,1}(3:length(basedades{1,1}{j,1})-1)))
base(i).id=x;
base(i).title= basedades{1,6}{j,1}(2:length(basedades{1,6}{j,1})-1);
break;
end
end
end
base=base(3:length(base));
base=extreuTAGS_minuscula(base);
fotosClasificar=base;