


newim = pad4conv(im, kernelsize, dim)
Pad the input image ready for convolution. The edges of the image
(of width=kernelsize/2, or half of the image size, which ever is smaller)
are reflected on all sides.
kernelsize -- size of the convolution kernel in the format
[numRows numCol]. If one number is given, assume numRows=numCols.
dim -- when set at 1, pad extra rows, but leave number of columns unchanged;
when set at 2, pad extra columns, leave number of rows unchanged;
when not specified, pad both columns and rows.
Xuemei Zhang
Last modified 3/1/96