Why does the image guided filter implemented in Matlab seem to have a nonlinear filtration affect in edge regions for even vs odd neighborhood sizes. For the same 'DegreeofSmoothing' factor even neighborhoods seem to produce heavier filtration in edge regions than odd sized neighborhoods.

for example 

I take a noisy test image with edges, and compute several different filtered outputs only varying neighborhood size,  Then I compute difference images - Unfiltered Input - Filtered Output and compare these across neighborhood sizes I see strange behavior in edge regions depending on whether the neighborhood is even or odd sized.  I have an attached matlab script that demonstrates this.  My question is why this variation in the difference images based on whether the neighborhood size is even or odd?

Similar questions and discussions