%build matrix for ensemble


dir_canny='/home/couturie/BossBase-1.0-canny/';
dir_cover='/localhome/couturie/ensemble/BossBase-1.0-cover/';

b=strcat(dir_canny,'*.pgm')
files=dir(b)

label=[];
scores=[];
l=0;
threshold=200;
for i = 1:size(files, 1)
					if l<threshold
					  img=imread(strcat(dir_canny,files(i).name));
					  scores=[scores;aump(img,16,5)];
						label=[label;'stego'];
          end
					l=l+1;
end
l=0;
for i = 1:size(files, 1)
					if l>=threshold & l<2*threshold
					  img=imread(strcat(dir_cover,files(i).name));
					  scores=[scores;aump(img,16,5)];
						label=[label;'cover'];
          end
					l=l+1;
end
[X,Y,T,AUC] = perfcurve(label,scores,'stego');


l=0;
tp=0;
fp=0;
total=0;
for i = 1:size(files, 1)
					if l>=2*threshold
					  total=total+1;
					  img=imread(strcat(dir_canny,files(i).name));
					  s=aump(img,16,5);
            if s<AUC
						  fp=fp+1;
            else
							tp=tp+1;
            end
          end
					l=l+1;
end
fp/total
tp/total


l=0;
tn=0;
fn=0;
total=0;
for i = 1:size(files, 1)
					if l>2*threshold
					  total=total+1;
					  img=imread(strcat(dir_cover,files(i).name));
					  s=aump(img,16,5);
            if s<AUC
							tn=tn+1;
            else
						  fn=fn+1;
            end
          end
					l=l+1;
end
fn/total
tn/total
