1 % =================================================================
\r
2 % Sparse Feature Fidelity (SFF) Version 2.0
\r
3 % Copyright(c) 2013 Hua-wen Chang
\r
4 % All Rights Reserved.
\r
5 % ----------------------------------------------------------------
\r
6 % Please refer to the following paper
\r
8 % Hua-wen Chang, Hua Yang, Yong Gan, and Ming-hui Wang, "Sparse Feature Fidelity
\r
9 % for Perceptual Image Quality Assessment", IEEE Transactions on Image Processing,
\r
10 % vol. 22, no. 10, pp. 4007-4018, October 2013
\r
12 % Hua-wen Chang, Ming-hui Wang, Shu-qing Chen et al., "Sparse feature fidelity for
\r
13 % image quality assessment," in Proceedings of 21st International Conference on
\r
14 % Pattern Recognition (ICPR), Tsukuba, Japan, November 2012, pp. 1619-1622.
\r
15 % ----------------------------------------------------------------------
\r
16 % TRAINING OF FEATURE DETECTOR (Simple Cell Matrix)
\r
19 % sampleSize = 18000; % Number of sample patches
\r
20 % patchSize = 8; % Patch size of samples
\r
21 % retainedDim = 8; % Number of features computed
\r
24 % W % Feature detector
\r
25 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\r
26 function W = TrainW(sampleSize, patchSize, retainedDim)
\r
32 disp('Sampling data')
\r
33 X = sampleimages(sampleSize,patchSize);
\r
34 disp('Removing DC component')
\r
36 disp('Doing PCA and whitening data')
\r
38 Z = V(1:retainedDim,:)*X;
\r
40 disp('Start training. ')
\r
41 W_w = ica(Z,retainedDim);
\r
42 %transform back to original space from whitened space
\r
43 W = W_w*V(1:retainedDim,:);
\r