this is a generic implementation of a guided filter. this version takes no shortcuts and uses both an input and a guided image.
input
the input imageguide
the guide imageoutput
the output image
radius
the size of the blur, relative to the input resolutionepsilon
the edge threshold