Repository navigation
Conversation
There was a problem hiding this comment.
If this is the public face of wavelet filtering in skimage, we should probably list the available wavelets. That way users don't have to go hunting through pywavelets documentation. Same applies to mode.
|
Thanks for your contribution! I'm really glad to see wavelets arriving in skimage (and hopefully scipy 1.0)! Some minor tweaks will be needed for Python 3 compatibility, and to get Travis happy you'll need to edit I think there are a couple tweaks to be made in the docstring as well, but I'll let someone with better reStructuredTest-fu chime in there. |
|
Sounds good - I appreciate the quick feedback! I'll make the changes and continue with documentation. |
-added wavelet coefficient visualization function
and to example problem
… into wavelets Conflicts: .travis.yml CONTRIBUTORS.txt skimage/filter/__init__.py
…o wavelets Conflicts: skimage/filter/_wavelet.py skimage/filter/tests/test_wavelet.py
|
@thearn I know this is a blast from the past, but we now have PyWavelets in scikit-image. If you have any other wavelet-based algorithms to contribute, this would be a great time to dust things off and take another look! |
|
+1! |
|
To be precise: we now have PyWavelets as a scikit-image dependency, so it is available for implementing wavelet-based algorithms. |
|
Wow, it has been awhile! Might take me a bit to get it back up to speed and correct the tests, but I'll make a point to get back on this. |
|
Looks like the features from my PR have since been provided: https://github.com/scikit-image/scikit-image/blob/master/skimage/restoration/_denoise.py#L338-L377 |
|
@thearn We're playing the long game here :) |
Relevant to #602: I've implemented a basic discrete wavelet transform filter for scikit-image.
At the moment, it's importing pywavelets directly, but it sounds like there will be a closer integration of source to come.
The basics:
An n-level discrete wavelet transform decomposes a digital image into 1 + 3_n coefficient matrices. The first is called the *approximation subband_, which captures the mean (and other low-frequency information) of the original image, and is essentially a down-sampled representation of it.
The remaining coefficient matrices are called the detail subbands. Thresholding functions are applied to these matrices. The wavelet transform is then reversed, to give the denoised result. Thresholding can either be soft or hard.
The main variation between the wavelet denoising methods that are out there in the literature are in how the thresholding values for each detail subband is determined (whether it is uniform across all detail subbands, or individual for each, etc).
The function implemented here allows a user to specify the detail thresholds either uniformly, or by level, or by individual subband. This way, this function can be used to implement the majority of wavelet denoising methods out there (BayesShrink. SureShrink. etc) by writing short wrapping functions which pre-compute the thresholds accordingly.
I'll work on more thorough documentation / examples before moving to implement BayesShrink/VisuShrink/SureShrink. Couldn't hurt to have more tests either. If it desirable to have these things done before issuing a pull request, no problem. I will wait until I have it all together, if desired.
I also have some methods of my own that are pre-publication, but would be happy to include.
Usage is pretty simple. Arguments to
wavelet_filterare the image to be denoised, threshold value(s), and all arguments which could be passed topywt.wavedec2. Note that inwavelet_filter, the wavelet function to use is an optional arguement, and defaults tohaar.Here are results for
Artifacts can be reduced by finer tuning of the thresholds, and careful selection of the wavelet function.