Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the Guided filter to ndimage/filters.py #12459

Open
lobpcg opened this issue Jul 1, 2020 · 0 comments
Open

Add the Guided filter to ndimage/filters.py #12459

lobpcg opened this issue Jul 1, 2020 · 0 comments
Labels
enhancement A new feature or improvement scipy.ndimage

Comments

@lobpcg
Copy link
Contributor

lobpcg commented Jul 1, 2020

Is your feature request related to a problem? Please describe.
(Fast) Guided filter (https://github.com/topics/guidedfilter) is an edge-preserving smoothing filter like the bilateral filter. It is straightforward to implement and has linear complexity independent of the kernel size. It's included in https://docs.opencv.org/master/javadoc/org/opencv/ximgproc/GuidedFilter.html and https://www.mathworks.com/help/images/ref/imguidedfilter.html
and coded in Python for 2d np arrays in
https://github.com/pfchai/GuidedFilter/
and for PyTorch and Tensorflow for 2d data tensors in
https://github.com/wuhuikai/DeepGuidedFilter

Describe the solution you'd like
Add the (Fast) Guided filter to ndimage/filters.py applicable to np arrays with any dimension >0 in a plurality of directions. The guided filter is based on the box filter, which technically is available as https://docs.scipy.org/doc/scipy/reference/generated/scipy.ndimage.convolve1d.html in mode ‘constant’ if I understand correctly, but could probably more efficiently coded using cumsum, as in https://github.com/pfchai/GuidedFilter/blob/master/guidedfilter.py

Describe alternatives you've considered

@tylerjereddy tylerjereddy added enhancement A new feature or improvement scipy.ndimage labels Jul 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A new feature or improvement scipy.ndimage
Projects
None yet
Development

No branches or pull requests

2 participants