I want to use 1D guided filter?

asked 2019-02-04 03:58:13 -0600

Houman gravatar image

I need to apply 1D guided filter for the image denoising. In Matlab implementation, I can define a window of N-1 for the guided filter. But in python version of open cv, I can define a radius for Guided Filter. Would you please help me how can I use this filter for 1D filtering?

edit retag flag offensive close merge delete

Comments

Could you be more specific? Are you referring to this: https://docs.opencv.org/3.4/de/d73/cl... and this: https://www.mathworks.com/help/images...

Grillteller gravatar imageGrillteller ( 2019-02-05 07:09:46 -0600 )edit

Yes. In python, I try to use link text. But you mentioned the correct version in Matlab

Houman gravatar imageHouman ( 2019-02-05 07:22:37 -0600 )edit

When you look at line 160-164 in: https://github.com/opencv/opencv_cont... I assume that OpenCV also uses a window for the filter defined by the radius. The window looks like (2 * radius + 1, 2 * radius + 1). So if you choose a radius of 4 you will get a window of 9x9. The radius is a function parameter of the boxFilterand since the Normalize Flag is set on "true" the whole filter kernel is multiplied with an alpha specified here: https://docs.opencv.org/3.0-beta/modu...

Grillteller gravatar imageGrillteller ( 2019-02-06 02:11:54 -0600 )edit

Thank you for your consideration. I understand your explanation. How, should I change this default square size to windows like 1*N? would you please give one example?

Houman gravatar imageHouman ( 2019-02-06 05:48:06 -0600 )edit

Thank you for your consideration. I understand your explanation. How, should I change this default square size to windows like 1*N? would you please give one example?

Houman gravatar imageHouman ( 2019-02-06 05:48:16 -0600 )edit