It probably wants a gray scale image, not a color image. At least that's what I'd try to get rid of the error message.
I = rgb2gray(I);
S = regcovsmooth(I,10,4,0.2,'M1');
By the way, please pick a more descriptive variable name than I. It looks too must like 1 (one) and l (lower case L).