%Name:		 TheMask
%Course:	 Data Hiding
%Components: Francesco Filippi, Marco Scarpa, Lorenzo Marchiori, Riccardo Longo
%Project: 	 Attack (all)

%image watermarked
imm=('barbara_noisymarkers.bmp');

%imm oringinal
imm_original=('Barbara.bmp');

%attacks: average filter
disp('Average filter attack');
hsize= input('window (int) ');
average_filter(imm,hsize);
%recover
Detection3(imm_original,'Wat_average_TheMask.bmp')

%wait key press
disp ('continue');
pause

%attacks: gaussian filter
disp('Gaussian filter attack');
size= input('window (int) ');
sigma= input('filter power (0.5) ');
gaussian_filter(imm,size,sigma);
%Detection3
Detection3(imm_original,'Wat_gfilter_TheMask.bmp')

%wait key press
disp ('continue');
pause

%attacks: gaussian noise
disp('Gaussian noise attack');
v= input('noise power (positive dB) ');
gaussian_noise(imm,v);
%Detection3
Detection3(imm_original,'Wat_gnoise_TheMask.bmp')

%wait key press
disp ('continue');
pause

%attacks: motion
disp('Motion attack');
len= input('length of pixels (9) ');
theta= input('angle (0) ');
motion (imm,len,theta);
%Detection3
Detection3(imm_original,'Wat_motion_TheMask.bmp')

%wait key press
disp ('continue');
pause

%attacks: resize
disp('Resize attack');
scaling= input('percent (0...10) ');
resize(imm,scaling);
%Detection3
Detection3(imm_original,'Wat_resized_TheMask.bmp')

%wait key press
disp ('continue');
pause

%attacks: jpeg2000
disp('Jpeg2000 attack');
comp= input('compression rate (0...8) ');
jpeg2000(imm,comp);
%Detection3
Detection3(imm_original,'Wat_jpeg2000_TheMask.bmp')

%wait key press
disp ('continue');
pause

%attacks: jpeg
disp('Jpeg attack');
qual= input('quality (0...100) ');
jpeg(imm,qual);
%Detection3
Detection3(imm_original,'Wat_motion_TheMask.bmp')

%wait key press
disp ('continue');
pause

%attacks: blurring
disp('Blurring attack');
rad= input('circular averaging filter with a 2*radius+1 matrix (10) ');
blur(imm,rad);
%Detection3
Detection3(imm_original,'Wat_blurred_TheMask.bmp')

%wait key press
disp ('continue');
pause

%attacks: sharpening
disp('Sharpening attack');
alp= input('controls the shape of the Laplacian is positive less than 1 (0.2) ');
sharp(imm,alp);
%Detection3
Detection3(imm_original,'Wat_sharpened_TheMask.bmp')

%wait key press
disp ('continue');
pause

%attacks: equalization
disp('Equalization attack');
n= input('number of discrete levels in image (5000) ');
equal(imm,n);
%Detection3
Detection3(imm_original,'Wat_equalized_TheMask.bmp')