pocet_rezu =20;
%% NACTENI OBRAZKU Z URCITEHO SOUBORU
obr_data = cell(pocet_rezu + pocet_rezu-1,1); % pocet_rezu-1 pro fuse operace
for i = 1:pocet_rezu
    [filename, pathname] = uigetfile( ...
        {'*.jpg;*.png;*.tif;*.jpeg;*.bmp',...
        'MATLAB Files (*.jpg, *.png, *.tif, *.jpeg,*.bmp)';
        '*.*',  'All Files (*.*)'}, ...
        'Pick a file');
    obr_data{i} = imread([pathname,filename]);
end
%%
        k = 1;
        for i = 1:2:(pocet_rezu+pocet_rezu-2)
            obr_data{pocet_rezu + k} = imfuse(obr_data{i},obr_data{i+1},'blend','Scaling','joint');
            k = k + 1;
        end
        obr_data{end} = imfuse(obr_data{end-2},obr_data{end},'blend','Scaling','joint');
I = obr_data{end};
%ulozeni vysledneho obrazku 
imwrite(I, 'test_1.tif')
%imwrite(I, 'test_2.tif')
%imwrite(I, 'test_3.tif')
        
        