-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDCTNet_FeaExtraction.m
More file actions
31 lines (24 loc) · 1.07 KB
/
DCTNet_FeaExtraction.m
File metadata and controls
31 lines (24 loc) · 1.07 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
% Author : Cong Jie, Ng
% Paper : Ng, C. J., and Teoh, A. B. J. "DCTNet: A Simple Learning-Free Approach for Face Recognition." In 2015 Asia-Pacific Signal and Information Processing Association Annual Summit and Conference (APSIPA), 761-68, 2015.
function feature = DCTNet_FeaExtraction(InImg, Filters, Params)
%% Represent Multi-Channel image with cell
filteredImgs = {};
for i = 1:length(InImg)
filteredImgs = cat(1, filteredImgs, {InImg(i)});
end
%% Convolution Layers
for layer = 1:Params.NumLayers
filteredImgs = DCTNet_Convolution(filteredImgs, Filters, Params, layer);
end
%% Binary Hashing
hashedImgs = DCTNet_BinaryHashing(filteredImgs, Params);
%% Block-wise Histogram
blockwiseHists = DCTNet_Blockwise_Histogram(hashedImgs, Params);
%% Tied Rank Normalization
if (Params.TiedRankNormalization)
blockwiseHists = DCTNet_TiedRank_Normalization(blockwiseHists);
end
%% Vectorize to get final feature vector
feature = cell2mat(blockwiseHists);
feature = feature(:);
end