close all;
clear all;
clc
rootpic = 'Outex_TC_00014\';
datadir = 'results';
if exist(datadir,'dir');
else
mkdir(datadir);
end
sigmaSet = [1];
F = makeGDfilters(sigmaSet);
snr = 0;
K = 2;
C = 1;
Ls = 3;
Lr = 5;
picNum = 4080;
tic
Hist=[];
for i=1:picNum
filename = sprintf('%s\\images\\%06d.bmp', rootpic, i-1);
display(['.... ' num2str(i) ])
Gray = imread(filename);
Gray = im2double(Gray);
if snr~=0
Gray = awgn(Gray,10*log10(snr),'measured');
end
I= rgb2gray(Gray);
[cA,cH,cV,cD] = dwt2(I,'coif1');
I=cA;
newHist = getFeatsCodes(F,sigmaSet, I, Ls, Lr, K, C);
Hist = [Hist; newHist];
end
trainTxt = sprintf('%s000\\train.txt', rootpic);
testTxt = sprintf('%s000\\test.txt', rootpic);
[trainIDs, trainClassIDs] = ReadOutexTxt(trainTxt);
[testIDs, testClassIDs] = ReadOutexTxt(testTxt);
Accuracy_in_Percent = cal_AP(Hist,trainIDs, trainClassIDs,testIDs, testClassIDs)
display(['Time consuming ' num2str(toc/60) ' mins'])
save(['./results/TC10_LETRIST.mat'], 'Accuracy_in_Percent');
Best Answer