1 % A script for reading the data into three variables:
2 % Visuals - cell array containing matrices of observed data
3 % Boundary1 - cell array containing vectors of height values for thwe
5 % Boundary2 - cell array containing vectors of height values for the
7 % Filenames - cell array containing names of loaded files
9 function[Visuals Boundary1 Boundary2 Filenames]=read_data(path_to_learnprobes)
22 files = dir(path_to_learnprobes);
23 while k <= length(files)
29 if(isempty(findstr('grenzen', file.name)) && isempty(findstr('segmentiert', file.name)))
30 Filenames{i}=file.name;
31 Visuals{i} = imread(strcat(path_to_learnprobes, file.name));
34 grenzen = uint8(rgb2gray(imread(strcat(path_to_learnprobes, file.name))));
35 grenzen(grenzen~=255)=0;
36 b1=-ones(1,size(grenzen,2));
37 b2=-ones(1,size(grenzen,2));
38 for l=1:size(grenzen,2)
40 tmp=find(grenzen(:,l)<255);
42 if(m>1 && tmp(m)-tmp(m-1)>5)
43 b1(l)=mean(tmp(1:(m-1)));
47 if(m==length(tmp)); b1(l)=mean(tmp); end
48 for n=length(tmp):-1:1
50 if(n<length(tmp) && tmp(n+1)-tmp(n)>5)
51 b2(l)=mean(tmp((n+1):end));
56 Boundary1{j} = round(b1);
57 Boundary2{j} = round(b2);
63 clear i j k file files path_to_learnprobes grenzen