-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFischerExtraction_production.m
148 lines (118 loc) · 3.65 KB
/
FischerExtraction_production.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
clear all; close all; clc
load fisheriris;
x1=meas(1:50,:); % setosa
x2=meas(51:100,:); % versicolor
x3=meas(101:150,:); % virginica
plot3(x1(:,1),x1(:,2),x1(:,4),'ro','Linewidth',[1],'MarkerEdgeColor','k','MarkerFaceColor',[0 1 0.2],'MarkerSize',8), hold on
plot3(x2(:,1),x2(:,2),x2(:,4),'bo','Linewidth',[1],'MarkerEdgeColor','k','MarkerFaceColor',[0.9 0 1],'MarkerSize',8)
plot3(x3(:,1),x3(:,2),x3(:,4),'bo','Linewidth',[1],'MarkerEdgeColor','k','MarkerFaceColor',[1 0.64 0.098],'MarkerSize',8)
grid on, set(gca,'Fontsize',[15])
legend('','','','Location','NorthWest'),legend boxoff
load dogData.mat
load catData.mat
CD=double([dog cat]);
[u,s,v]=svd(CD-mean(CD(:)),'econ');
figure(3)
for j=1:4
subplot(2,2,j)
U=flipud(reshape(u(:,j),64,64));
U2=U(1:2:64,1:2:64);
pcolor(U2), colormap(hot), axis off
end
figure(4)
for j=1:4
subplot(4,1,j), bar(v(:,j),'FaceColor',[.6 .6 .6],'EdgeColor','k')
set(gca,'Fontsize',[15]), axis([0 160 -0.2 0.2])
end
figure(5)
xbin=linspace(-0.25,0.25,20);
for j=1:4
subplot(4,2,2*j-1)
pdf1=hist(v(1:80,j),xbin)
pdf2=hist(v(81:160,j),xbin)
plot(xbin,pdf1,xbin,pdf2,'Linewidth',[2])
axis([-.2 0.2 0 20]), set(gca,'Fontsize',[15])
end
figure(2)
subplot(2,2,1)
plot3(v(1:80,1),v(1:80,2),v(1:80,3),'ro','Linewidth',[1],'MarkerEdgeColor','k',...
'MarkerFaceColor',[0 1 0.2],...
'MarkerSize',8), hold on % [0.49 1 .63]
plot3(v(81:end,1),v(81:end,2),v(81:end,3),'bo','Linewidth',[1],'MarkerEdgeColor','k',...
'MarkerFaceColor',[0.9 0 1],...
'MarkerSize',8)
view(-138,64), grid on, set(gca,'Fontsize',[15])
axis([-0.2 0.2 -0.2 0.2 -0.5 0.5])
% figure(2), subplot(2,2,3)
% plot(diag(s)/sum(diag(s)),'ko');
% axis([0 100 0 0.06])
% set(gca,'Fontsize',[15])
%dog_wave=dc_wavelet(dog);
%cat_wave=dc_wavelet(cat);
%%
load catData_w.mat
load dogData_w.mat
CD2=[dog_wave cat_wave];
[u2,s2,v2]=svd(CD2-mean(CD2(:)),'econ');
figure(6)
for j=1:4
subplot(2,2,j)
Xd=flipud(reshape(dog_wave(:,j),32,32));
pcolor(Xd), colormap(hot), axis off
end
figure(7)
for j=1:4
subplot(2,2,j)
U3=flipud(reshape(u2(:,j),32,32));
pcolor(U3), colormap(hot), axis off
end
figure(8)
for j=1:4
subplot(4,1,j), bar(v2(:,j),'FaceColor',[.6 .6 .6],'EdgeColor','k')
set(gca,'Fontsize',[15]), axis([0 160 -0.2 0.2])
end
figure(5)
for j=1:4
subplot(4,2,2*j)
pdf1=hist(v2(1:80,j),xbin);
pdf2=hist(v2(81:160,j),xbin);
plot(xbin,pdf1,xbin,pdf2,'Linewidth',[2])
axis([-.2 0.2 0 20]), set(gca,'Fontsize',[15])
end
figure(2)
subplot(2,2,2)
plot3(v2(1:80,1),v2(1:80,2),v2(1:80,3),'ro','Linewidth',[1],'MarkerEdgeColor','k',...
'MarkerFaceColor',[0 1 0.2],...
'MarkerSize',8), hold on % [0.49 1 .63]
plot3(v2(81:end,1),v2(81:end,2),v2(81:end,3),'bo','Linewidth',[1],'MarkerEdgeColor','k',...
'MarkerFaceColor',[0.9 0 1],...
'MarkerSize',8)
view(-138,64), grid on, set(gca,'Fontsize',[15])
axis([-0.2 0.2 -0.2 0.2 -0.5 0.5])
% figure(2), subplot(2,2,4)
% plot(diag(s2)/sum(diag(s2)),'ko');
% axis([0 100 0 0.025])
% set(gca,'Fontsize',[15])
%%
figure(11)
master=zeros(32*5,32*4); count=1;
for jj=1:4
for j=1:5
T2=flipud(reshape(dog(:,count),64,64));
T=T2(1:2:64,1:2:64);
master(1+32*(j-1):32+32*(j-1),1+32*(jj-1):32+32*(jj-1))=T;
count=count+1;
end
end
pcolor(master), shading interp, colormap(gray), axis off
figure(12)
master=zeros(32*5,32*4); count=1;
for jj=1:4
for j=1:5
T2=flipud(reshape(cat(:,count),64,64));
T=T2(1:2:64,1:2:64);
master(1+32*(j-1):32+32*(j-1),1+32*(jj-1):32+32*(jj-1))=T;
count=count+1;
end
end
pcolor(master), shading interp, colormap(gray), axis off