%% Function to download different parameters for descriptos and
%% detectors

function conf = loadConfigures(conf)
global confParameter
global r q w t y



if strcmp(conf.benchType,'detector')

% You can download different configures from a file or manually change
% parameters by using global parameters
path = ['/home/antti/Desktop/Work/descriptor_vocbenchmark/matlab' ...
'/DetectorTesting/DetecConfParameters/'];

    switch conf.method
        case 'vl_sift+vl_sift'
%            load([path,'vl_sift']);
%            temp = cell2mat(values);
%            conf.vl_Levels = temp(confParameter).configures.vl_Levels;
%            conf.vl_Levels =   
    
        case 'vl_dense+vl_sift'
%             load([path,'vl_dense'])
%             temp = cell2mat(values);
%             conf.vl_denseStep = temp(confParameter).configures.vl_denseStep;
%             conf.vl_denseStep =

        case 'fs_hesaff+fs_sift'

%             load([path,'fs_hesaff'])
%             temp = cell2mat(values);
%             conf.fs_hesThres = temp(confParameter).configures.fs_hesThres;
%             conf.fs_density = temp(confParameter).configures.fs_density;
%             conf.fs_density =
%             conf.fs_hesThres

        otherwise 
            error(['Unknown method: ' conf.method]);    
    end

elseif strcmp(conf.benchType,'descriptor')
    
% path = ['/home/antti/Desktop/Work/descriptor_vocbenchmark/matlab' ...
% '/DetectorTesting/DetecConfParameters/'];
    
    switch conf.method
        case 'vl_sift+vl_sift'
%            load([path,'vl_sift']);
%            temp = cell2mat(values);
%            conf.vl_Levels = temp(confParameter).configures.vl_Levels;
%            conf.vl_siftEdgeThreshold = temp(confParameter).configures.vl_siftEdgeThreshold;
%            conf.vl_Levels =
%            conf.vl_siftEdgeThreshold =

        case 'vl_dense+vl_sift'
%            load([path,'vl_dense'])
%            temp = cell2mat(values);
%            conf.vl_denseStep = temp(confParameter).configures.vl_denseStep;
%            conf.vl_denseStep =

        case 'fs_hesaff+fs_sift'

%             load([path,'fs_hesaff'])
%             temp = cell2mat(values);
%             conf.fs_hesThres = temp(confParameter).configures.fs_hesThres;
%             conf.fs_density = temp(confParameter).configures.fs_density;
%             conf.fs_hesThres =
%             conf.fs_density =

        case 'vl_dense+mvpr_sg'            
%             Default parameters and results. Next parameters setup are
%             tuned versions of these and the result is show on top.
%             Dataset is caltech101
%             img250 median = 2, mean = 12.864
%             'gabor_fmax', 0.0500,...
%             'gabor_fnum', 4,...
%             'gabor_thetanum', 6,...
%             'gabor_k', sqrt(3),...
%             'gabor_p', 0.65);
%             load([path,'mvpr_sg'])
%             temp = values(1);
            
%             img25 median = 40, mean = 35.4
%             img250 median = 2, mean = 14.816
%             conf.gabor_fmax = 0.0459;
%             conf.gabor_fnum = 3;
%             conf.gabor_thetanum = 18;
%             conf.gabor_k = 1.8439;
%             conf.gabor_p = 0.5800
            
            
%             median = 44 mean = 38.440
%             gabor_fmax: 0.0430
%             gabor_fnum: 3
%             gabor_thetanum: 14
%             gabor_k: 1.7961
%             gabor_p: 0.4941

           
%             img25 median = 39, mean = 38.8800
%             img250 median = 1.5, mean = 15.148
%             conf.gabor_fmax = 0.0410;
%             conf.gabor_fnum = 3;
%             conf.gabor_thetanum = 14;
%             conf.gabor_k = 1.8331;
%             conf.gabor_p = 0.4807;
%           

%             conf.gabor_fmax = 0.0409;
%             conf.gabor_fnum = 3;
%             conf.gabor_thetanum = 14;
%             conf.gabor_k = 1.7961;%-0.002*confParameter;
%             conf.gabor_p =  0.6080;
           
%             conf.gabor_fmax = w;
%             conf.gabor_fnum = 4;
%             conf.gabor_thetanum = 16;
%             conf.gabor_k = t;
%             conf.gabor_p = y;
%             
%             img250 median = 2, mean = 16.2280       
%             conf.gabor_fmax = 0.0406;
%             conf.gabor_fnum = 4;
%             conf.gabor_thetanum = 16;
%             conf.gabor_k = 1.7148;
%             conf.gabor_p = 0.5766;
            
            
%             img250 median = 2, mean = 15.5       
%             conf.gabor_fmax = 0.0459;
%             conf.gabor_fnum = 4
%             conf.gabor_thetanum = 16;
%             conf.gabor_k = 1.8439;
%             conf.gabor_p = 0.5800;
             
        otherwise 
            error(['Unknown method: ' conf.method]);    
    end
    
else
    error(['Unknown benchmark: ' conf.benchType]);
end 

