Switch to unified view

a b/functions/functions_FeatExtr/featExtrGaborAdapt.m
1
function [ftest_all, numFeatures] = ...
2
    featExtrGaborAdapt(imagesCellTest, V, PCANet, bestWavelets, param, numImagesTest, stepPrint)
3
4
%one iteration to get size and init
5
ftest = Gabor_FeaExt(imagesCellTest(1), V, PCANet, bestWavelets, param);
6
numFeatures = size(ftest,1);
7
%init feature matrix
8
ftest_all = sparse(numFeatures, numImagesTest);
9
ftest_all(:, 1) = ftest;
10
11
%start pool
12
%parto da 2 perchŔ 1 ho giÓ fatto
13
parfor j = 2 : numel(imagesCellTest)
14
% for j = 2 : length(vectorIndexTest)
15
    
16
    %get id of current worker
17
%     t = getCurrentTask();
18
    
19
    %display progress
20
    if mod(j, stepPrint) == 0
21
%         fprintf(1, ['\t\tCore ' num2str(t.ID) ': ' num2str(j) ' / ' num2str(numImagesTest) '\n'])
22
    end %if mod(i, 100) == 0
23
    
24
    %imt = im2double(imread([dirDB filenameTest{j}]));
25
    %image size must be a power of 2
26
    %imt = imresize(imt, imageSize);
27
    
28
    %get image
29
    im = imagesCellTest(j);
30
    
31
    %PCANet output
32
    ftest = Gabor_FeaExt(im, V, PCANet, bestWavelets, param);
33
    
34
    %whos ftest
35
    
36
    %save descriptor
37
    %w/out wpca
38
    ftest_all(:, j) = ftest;
39
    
40
end %parfor i = 1 : numImagesTest
41
42
43