function npyr = addLevel(image, pyr)
%add an image level at the bottom of a pyramid


if(nargin == 2)
   [cols, rows, levels] = size(pyr);
   [icols, irows] = size(image);
   npyr = zeros([icols, irows, levels+1]);
   npyr(:,:,1) = image;
   npyr(1:cols,1:rows,2:levels+1) = pyr;
else
   [icols, irows] = size(image);
   npyr = zeros([icols, irows, 1]);
   npyr(:,:,1) = image;
end

   


