I noticed some edge artifacts in images I had filtered using a filter from fspecial, so I decided to take a look at the filter shape itself.
aa=fspecial('gaussian',sz+1,alph*max(sz)/2);
aa=imlnc(aa,'independent','tol',1E-6);
The cropped edges explains why there were edge displacement artifacts in the filtered image. Certainly, the documentation clearly says it's supposed to be a rotationally symmetric gaussian, but for some reason, I had been expecting something more like this when given an asymmetric size parameter:
[xx yy]=meshgrid(1:szf(2),1:szf(1));
r=sqrt(((xx-ceil(szf(2)/2))/(szf(2)/2)).^2 + ((yy-ceil(szf(1)/2))/(szf(1)/2)).^2);
bb=exp(-(r/(1.414*alph)).^2);
bb=imlnc(bb,'independent','tol',1E-6);
Which again, I shouldn't really have expected given the documentation. My question is more of a conceptual/usage question then. I can understand the case when HSIZE is symmetric, but handling asymmetry by cropping instead of reshaping seems counterintuitive to me. I assume that the behavior of fspecial() is not without purpose. What are good reasons/applications for an asymmetrically cropped round filter like fspecial produces? My initial assumption would be that the strong edge step defeats some of the benefits of using a gaussian, but maybe there are good reasons for technical applications that I don't understand. On the other hand, are there cases where my second example would be preferred or disfavored? I feel like I'm missing something important.