function [M] = createMask (S)
%[M] = CREATEMASK (S) - funkce vytvori binarni masku popredi na bazi ridke
%slozky videa: S(i,j) >= var(S) => M(i,j) = 1, jinak M(i,j) = 0.
%   M   - matice masky
%   S   - ridka matice

varS = var(S(:));
ind = find( S.^2 < varS );
M = ones(size(S)) * 255;
M(ind) = 0;

end