guided filter in gmic


#1

hello
I was wondering if this filter is available in gmic ?

http://kaiminghe.com/publications/pami12guidedfilter.pdf

luc


#2

Yes it is.

See https://gmic.eu/reference.shtml and search for “Kaiming”

in the plug in it is under Repair > [Smooth] Guided


#3

great.thanks Iain


#4

well a few questions arise
about regularisation :
I’m refering to this implementation


I’m working around feathering (matting)
int r = 60;
double eps = 1e-6;
eps *= 255 * 255; // Because the intensity range of our images is [0, 255]

how exactly should I consider the regularization value in gmic’s implementation ?
should I work in [0,1] range while filtering ?


#5

It depends on the image and its content and range. I usually use a very small value for my tasks. Also see: G'MIC exercises.


#6

the strange thing is that after filtering the maximum values in the image are growing.
like for a 0-255 input image (png) i have a 270 max value.
should I [cut 0,255] or normalize 0,255 ?


(Alberto) #7

last time I checked, the guided filter in gmic did not allow to select a channel as a guide… do I remember correctly? if so, would it be possible to allow this? thanks!


#8

this is the command i’m using
gmic image.png guide.png -to_colormode[1] 1 -div 255 -guided[0] [1],$GUIDEDRADIUS,$GUIDEDREGULARIZATION -normalize 0,255 -o[0] result.png

in the gimp version you can’t use a guide


(Alberto) #9

that’s what I meant, yes… any gmic guru willing to add this?


#10

-div 0,255 is in fact useless
cut 0,255 seems to be the way to go otherwise whites becomes gray …


#11

Please include examples so that we can address your problem more directly. Remarks:

– When there is no guide, G’MIC uses the input image as its own guide.
– Generally, cut 0,255 is a good idea, or normalize 0,255, but the latter would flatten the image. I may deal with the overshoots directly; however, that is an advanced topic.