function [PAD] = pad_image(varargin)
    IMG = varargin{1};
    bordersize = 10;
    if length(varargin) == 2
        bordersize = varargin{2};
    end
    isColor = size(IMG,3) == 3;
    if isColor
     IMG = rgb2gray(IMG);
     warning('please supply gray img');
    end
    PAD = padarray(IMG, [bordersize, bordersize], 'both');
end