Download this file
1 2 3 4 5 6 7 8
function fgClose = modifyMask(fgMask,strelType,strelSize) %finding foregorund mask, filling holes and closing gaps fgFill = imfill(fgMask,'holes'); fgClose = imclose(fgFill,strel(strelType,strelSize)); end