close all; clear all; clc;

image = aVytvorKvadr(11,11,11);

rp = regionprops(image, 'basic');


contours = zeros(size(image,1)+2, size(image,2)+2, size(image,3));


for i = 1:size(image,3)
%     imwrite(image(:,:,i), sprintf('kv2/kvadr%s.jpg', num2str(i)));
    [obrys, rada_obrys, vektory_obrysu] = VytvorObrys(image(:,:,i));   
    
    contours(:,:,i) = obrys;
    
end





contours(:,:,1) = imfill(contours(:,:,1));
contours(:,:,size(image,3)) = imfill(contours(:,:,size(image,3)));

vzdalenosti = vzdalenostOdCentroidu3D(contours);



