%% Small Image
filename = 'AT3_1m4_10_small.tif';
blocksize = [120 640];
%% Calculate Block Processing
I_final = blockproc(filename,blocksize,@(x) mySegmentation(x.data, 0.055, 832));
imshow(I_final);
%% Calculate Block Processing with Overlapping Regions
blockproc(filename,blocksize,@(x) mySegmentation(x.data, 0.055, 832),...
'BorderSize',[12 12],'destination','myresult.tif');
rset_file = rsetwrite('myresult.tif');
imtool(rset_file)
%% Medium Image
filename = 'AT3_1m4_10_medium.tif';
blocksize = [120 1920];
% Calculate Block Processing
blockproc(filename,blocksize,@(x) mySegmentation(x.data, 0.0223, 2064),...
'BorderSize',[12 12],'destination','myresult.tif');
rset_file = rsetwrite('myresult.tif');
imtool(rset_file)
%% Large Image
filename = 'AT3_1m4_10_large.tif';
blocksize = [120 3840];
% Calculate Block Processing
blockproc(filename,blocksize,@(x) mySegmentation(x.data, 0.0113, 4558),...
'BorderSize',[12 12],'destination','myresult.tif');
rset_file = rsetwrite('myresult.tif');
imtool(rset_file)