%===========================================================
%
%        FILE: setup_experiements.m
%  Written by: Joao Oliveira
% Last review: Sep 2009 
%         WWW: http://www.lx.it.pt/~jpaos/
%
%===========================================================
% Description: 
%
% This file sets the experiment parameters, like image file, 
% noise level, blur, for experience number 'exp' from paper 
% 
% João P. Oliveira, José M. Bioucas-Dias, Mário A.T. Figueiredo, 
% "Adaptive total variation image deblurring: A
% majorization?minimization approach",  Signal Processing,
% Volume 89, Issue 9, September 2009, Pages 1683-1693. 
%
%===========================================================

% Warning: in the paper, by a missprint, the results in table 1
%          of experiments 2 and 3 are swapped.
%


if ispc
    dirsep = '\';
else
    dirsep = '/';
end


if exp==1
    imagem='cameraman.tif';
    dados=strcat('data',dirsep,'camera');
    img=double(imread(imagem));
    img=img-mean(img(:));
    % Blur Kernel
    h=ones(9)/81;
    sigma=0.56;
    theta=0.4;
elseif exp==2
    imagem='cameraman.tif';
    dados=strcat('data',dirsep,'camera');
    img=double(imread(imagem));
    img=img-mean(img(:));
    % Blur Kernel
    h=zeros(15);
    for ii=1:15
        for jj=1:15
            h(ii,jj)=inv(1+(ii-8)^2+(jj-8)^2);
        end
    end
    h=h/(sum(h(:)));
    sigma=sqrt(2); 
    theta=0.4;
    
elseif exp==3
    imagem='cameraman.tif';
    dados=strcat('data',dirsep,'camera');
    img=double(imread(imagem));
    img=img-mean(img(:));
    % Blur Kernel
    h=zeros(15);
    for ii=1:15
        for jj=1:15
            h(ii,jj)=inv(1+(ii-8)^2+(jj-8)^2);
        end
    end
    h=h/(sum(h(:)));
    sigma=sqrt(8); 
    theta=0.4;
elseif exp==4
    imagem='lena_256.gif';
    dados=strcat('data',dirsep,'lena');
    img=double(imread(imagem));
    img=img-mean(img(:));
    % Blur Kernel
    h=[1 4 6 4 1]'*[1 4 6 4 1]/256;
    sigma=7;
    theta=0.4;


elseif exp==5
    imagem='phantom';
    dados=strcat('data',dirsep,'phantom');
    img=256*phantom(256);
    img=img-mean(img(:));
    % Blur Kernel
    h=ones(9)/81;
    sigma=0.4; 
    theta=0.4;
end


