function [ maska ] = tvorMaskuPohybu( listing, cameraParams, tform, orez, pocetSnimku)

pic=imread(strcat('snimkyVidea/', listing(1).name));
sizePic=size(pic);
maska=false(sizePic(1), sizePic(2));
maska=logical(vysekZBB(maska, orez));

prazdny=maska;

sizeListing=size(listing);
sizeListing=sizeListing(1);

if (pocetSnimku<=sizeListing)&&(pocetSnimku>0)
   
else
    pocetSnimku=size(listing);
    pocetSnimku=pocetSnimku(1);
end


for pocitadloSnimku=1:1:pocetSnimku
pic=imread(strcat('snimkyVidea/', listing(pocitadloSnimku).name));

prah=prah4(imhist(sepBC(pic,1)));
bin=(sepBC(pic,1)<prah);
[binWithHoles,~] = undistortImage(bin,cameraParams);
bin=imfill(binWithHoles, 'holes');
binS=imwarp(bin, tform);
binS=vysekZBB(binS, orez);

s1 = regionprops(binS, 'Area', 'PixelIdxList');
indexNejObj=indexNejvetsihoObjektu(s1);
aktualni=prazdny;
aktualni(s1(indexNejObj).PixelIdxList)=true;
maska=maska|aktualni;

end

end







