img = logical(zeros(8, 8));
img(2:5, 2:5) = fliplr(tril(ones(4)));
result = imerode(img, strel('arbitrary', fliplr(tril(ones(2)))))
imshow(result);