Adding equivalent filters from scipy.ndimage.filters
See original GitHub issueWould be great to support some common filters from scipy.ndimage.filters
. Having convolve
, correlate
and generic_filter
would be great and allow users to build up many common convolutions with relatively little work using a familiar API. There are others that would be very nice as well.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:17 (17 by maintainers)
Top Results From Across the Web
scipy.ndimage.gaussian_filter — SciPy v1.9.3 Manual
The standard deviations of the Gaussian filter are given for each axis as a sequence, or as a single number, in which case...
Read more >Custom filter with scipy ndimage - python - Stack Overflow
I need a filter that, given a structural element located at pixel i,j, it assigns a value of that pixel to all other...
Read more >2.6. Image manipulation and processing using Numpy and Scipy
scipy : scipy.ndimage submodule dedicated to image processing (n-dimensional ... Image filtering: denoising, sharpening; Image segmentation: labeling pixels ...
Read more >Module: filters — skimage v0.19.2 docs
See scipy.ndimage.correlate for a description of cross-correlation. ... Frequency and orientation representations of the Gabor filter are similar to those ...
Read more >Multidimensional image processing (cupyx.scipy.ndimage)
correlate1d (input, weights[, axis, output, ...]) One-dimensional correlate. ; gaussian_filter (input, sigma[, order, ...]) Multi-dimensional Gaussian filter.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @jakirkham. Do you have an immediate need for this or a particular use case in mind?
I recently implemented the equivalent of
ndi.convolve
(built using a GPU-based implementation ofscipy.signal.upfirdn(..., up=1, down=1)
under the hood) that supports float32, float64, complex64 and complex128. I haven’t tried to make a PR for it here or posted it publicly, but can share it if you are interested in collaborating on it.I implemented
scipy.signal.upfirdn
using CuPy and added support for various signal extension modes at the boundary (not currently available in SciPy’supfirdn
). In my case, I started implementing a library expanding the functionality in PyWavelets. The version ofupfirdn
I have currently only supports downsampled convolution withup=1, down=M
or upsampled convolution withup=M, down=1
as those were the only cases I needed for M-band wavelet filterbanks. With a bit more effort, it could be updated to allow the general setting of any positive integerup
,down
and become suitable for a PR here.I finally got around to cleaning things up and making a public repo for some of the things I mentioned about a year ago (better late than never!). A CPU + GPU implementation of
upfirdn
is in the fast_upfirdn package. It differs from the implementation in cusignal in that the GPU implementation usescupy.RawKernel
instead ofNumba
.Building on top of this, cupyimg implements a ton of other functions, primarily from
scipy.ndimage
,scipy.signal
andscikit-image
.I have been working on getting some
scipy.ndimage
and NumPy stuff that was needed implemented as PRs here so that they can benefit from better code review and CI testing. Currentlycupyimg
does not have CI and I have just been running tests locally on linux. There are quite a few tests copied from the corresponding CPU-based packages, but these do not typically conform to the CuPy style, so getting things ready for PR here would still require quite a bit of work. There is also a substantial amount of kernel code duplication that could be avoided by refactoring of the type done by @coderforlife in #3184.I think
scikit-image
functions are out of scope for CuPy itself. I’m not too sure about the viability of maintaining a parallel fork long-term without obtaining any official funding/support to do so, but wanted to try out at least a subset of the library that is built on top ofscipy.ndimage
functions.