A = mat2gray( imread('nano.tif') ); %nacteni snimku a prevod na sedoton
B = mat2gray( imread('lyso.tif') ); %nacteni snimku a prevod na sedoton
[m,n, ~] = size(A); %vytvoreni vektoru o velikosti snimku A
Pom = zeros(m,n); %nova promenna nulova matice velikosti m,n
C = zeros(m,n,3);
prah = 0.2; %volba prahu od 0 do 1
for i=1:3 
    Pom(A(:,:,i)>prah) = 1;
    Pom(B(:,:,i)>prah) = 1;
    C(:,:,i) = Pom;
    Pom = zeros(m,n);
end
figure
imshow(C, [])


C =  A + B;
figure
imshow(C, [])