-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExtract_features.m
103 lines (76 loc) · 2.38 KB
/
Extract_features.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
function feature_vector = Extract_features(PH,PV,PLD,PRD)
%%%%% f1 : %%%%%
f1H = Angular_Second_Moment(PH);
f1V = Angular_Second_Moment(PV);
f1LD = Angular_Second_Moment(PLD);
f1RD = Angular_Second_Moment(PRD);
f1 = mean([f1H f1V f1LD f1RD]);
%%%%% f2 : %%%%%%
f2H = Contrast(PH);
f2V = Contrast(PH);
f2LD = Contrast(PH);
f2RD = Contrast(PH);
f2 = mean([f2H f2V f2LD f2RD]);
%%%%% f3 : %%%%%%
% f3H = Correlation(PH);
% f3V = Correlation(PH);
% f3LD = Correlation(PH);
% f3RD = Correlation(PH);
% f3 = mean([f3H f3V f3LD f3RD]);
%%%%% f4 : %%%%%%
f4H = Variance(PH);
f4V = Variance(PH);
f4LD = Variance(PH);
f4RD = Variance(PH);
f4 = mean([f4H f4V f4LD f4RD]);
%%%%% f5 : %%%%%%
f5H = Inverse_difference_moment(PH);
f5V = Inverse_difference_moment(PH);
f5LD = Inverse_difference_moment(PH);
f5RD = Inverse_difference_moment(PH);
f5 = mean([f5H f5V f5LD f5RD]);
%%%%% f6 : %%%%%%
f6H = Sum_average(PH);
f6V = Sum_average(PH);
f6LD = Sum_average(PH);
f6RD = Sum_average(PH);
f6 = mean([f6H f6V f6LD f6RD]);
%%%%% f7 : %%%%%%
f7H = Sum_variance(PH);
f7V = Sum_variance(PH);
f7LD = Sum_variance(PH);
f7RD = Sum_variance(PH);
f7 = mean([f7H f7V f7LD f7RD]);
%%%%% f8 : %%%%%%
f8H = Sum_entropy(PH);
f8V = Sum_entropy(PH);
f8LD = Sum_entropy(PH);
f8RD = Sum_entropy(PH);
f8 = mean([f8H f8V f8LD f8RD]);
%%%%% f9 : %%%%%%
f9H = Entropy(PH);
f9V = Entropy(PH);
f9LD = Entropy(PH);
f9RD = Entropy(PH);
f9 = mean([f9H f9V f9LD f9RD]);
%%%%% f10 : %%%%%%
f10H = Difference_variance(PH);
f10V = Difference_variance(PH);
f10LD = Difference_variance(PH);
f10RD = Difference_variance(PH);
f10 = mean([f10H f10V f10LD f10RD]);
%%%%% f11 : %%%%%%
f11H = Difference_entropy(PH);
f11V = Difference_entropy(PH);
f11LD = Difference_entropy(PH);
f11RD = Difference_entropy(PH);
f11 = mean([f11H f11V f11LD f11RD]);
%%%%% f12 & f13 : %%%%%%
[f12H,f13H] = Information_of_correlation(PH);
[f12V,f13V] = Information_of_correlation(PV);
[f12LD,f13LD] = Information_of_correlation(PLD);
[f12RD,f13RD] = Information_of_correlation(PRD);
f12 = mean([f12H f12V f12LD f12RD]);
f13 = mean([f13H f13V f13LD f13RD]);
%%%%% We will remove feature 3 because it doesnt give stable results
feature_vector = [f1,f2,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13];