function g =dilate(input, filter)

[x1, y1] = size(input);
[x2, y2] = size(filter);

input2=ones(x1+x2-1, y1+y2-1)*255;
input2((x2+1)/2:end-(x2-1)/2, (y2+1)/2:end-(y2-1)/2)=input;

[x3, y3] = size(input2);

for x=1:(x1)
    for y=1:(y1)

        temp2=sum(sum(filter.*input2(x:(x+x2-1), y:(y+y2-1))));

        
        if temp2>=1
            g(x, y)=255;
        else
            g(x,y)=0;
        end
    end
end






