-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_load_exc.m
More file actions
57 lines (44 loc) · 1.09 KB
/
Copy pathtest_load_exc.m
File metadata and controls
57 lines (44 loc) · 1.09 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
cd dataset\train\resized
fname = ls;
N = length(fname);
for i=3:N
data = imread(fname(i,:));
data = double(rgb2gray(data));
data = data(:,:,1);
Dmat_x(:,i-2) = reshape(data,size(data,1)*size(data,2),1);
end
% Training Set
cats = Dmat_x(:,1:50);
dogs = Dmat_x(:,51:100);
cd ..\..\
cd test\resized
fname = ls;
N = length(fname);
for i=3:N
TestSet = imread(fname(i,:));
TestSet = double(rgb2gray(TestSet));
TestSet = TestSet(:,:,1);
Dmat_y(:,i-2) = reshape(TestSet,size(TestSet,1)*size(TestSet,2),1);
end
hiddenlabels = [1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0];
% Testing Set
probes = Dmat_y(:,:);
% Number of features
feature = 20;
cd ..\..\..
% Classify the probes as cats or dogs
[clsfy,sortdog,sortcat,pval]= waveFDA(cats,dogs,probes,feature);
% counter = abs(clsfy - hiddenlabels);
true=0;
for i=1:20
if(i>11)
if(clsfy(i)==hiddenlabels(i))
true=true+1;
end
else
if(clsfy(i)==hiddenlabels(i))
true=true+1;
end
end
end
percent = (true/20)*100;