Repository navigation
Conversation
|
Thanks for this contribution, Scott. We are in the middle of releasing 0.12, so please be patient for feedback, and ping us again if you haven't heard back within a week or so after the release. Thanks! |
There was a problem hiding this comment.
Why do you need extra variable here? Remove im_type
There was a problem hiding this comment.
clip is never used in the code. Remove
|
Hi @scottsievert ! Regarding your questions: sizing : I guess you should investigate better into DWT. As far as I know, the most common implementation is based on /2 downsampling, so it is neccesary (unless another way is proposed) to pad the input image. tests : you should add both basic tests (check if function returns error for >2D arrays, for example) and functional ones (test if result on some image from Regarding other points: you should also add example to gallery (check |
|
@scottsievert yes, in accordance to |
|
Hi guys, this interests me a lot! Thanks @scottsievert for that!
# mirroring parameter: lower pixel number
if (m < n):
par = m
else:
par = n
# mirroring
aux_aprx = np.pad(img, (par, par), 'symmetric')Thanks again! Have a nice one! |
|
I'm traveling but want to clarify a little here. There is absolutely a place for optionally allowing values outside [0, 1] in this package. See for example the implementation of Clipping should probably be the default, but it should be possible to disable for advanced users who want to do further work without throwing away data. |
|
A couple of comments on a few implementation details:
Also, there are substantial improvements in the upcoming release of
|
|
@grlee77 thank you very much for the comment! Version 0.4.0 sounds like a quite major update. |
There was a problem hiding this comment.
I believe you should move function definition outside to avoid overhead during a batch processing.
|
Hi @scottsievert thanks for this useful addition! Could you please write an example for the gallery using wavelet denoising? Also, there is some "staircasing" in the example that you showed, which is a bit surprising. I could have expected staircasing with Haar wavelet but I reckon that have used Daubechies wavelets. Is there a way to make it look better in the example? |
|
@scottsievert @emmanuelle I think you could show two examples on that,
|
|
@emmanuelle The BayesShrink helps with the "stair stepping." In the new implementation, you can (optionally) specify a noise standard deviation. Here's the output (after slightly tuning the noise standard deviation, not the threshold) |
There was a problem hiding this comment.
typo here: img here should be im
There was a problem hiding this comment.
Please enumerate these references.
|
@scottsievert hi! I believe n-dimensionality is considered as generalization in the sense of 1D (timeseries), 2D (images) and 3D (videos) cases. Color channels form a "special" dimension and usually should be processed separately. |
|
@soupault Not exactly. You're correct that color channels are a special case, but let's keep time out of this. For reference, the progression for n-dimensional data is best understood from 0-3 spatial dimensions where 0: Single point Note that n-dimensional analysis almost never mixes units. As we increased the dimensionality, every added dimension was orthogonal to the prior dimensions and and also carried the same spatial units. When you throw time into the mix things get treated very differently (time series analysis, etc.). |
tests every optional argument, in the only manner I could think of. All tests rely on there being less energy in the signal after soft thresholding.
|
Okay, tests and examples added. |
|
@stsievert thanks a lot! I think we should plan this and other wavelets-related issues/PRs for |
|
That PR for soft or hard thresholding, and has an array of thresholds for each wavelet level. I've implemented soft/hard thresholding but am ignoring a list of different coefficients. In the problem formulations I've seen, when it's known that the wavelet coefficients have at most k non-zeros, it's optimal to choose a constant threshold. |
implemented _wavelet_threshold. denoise_wavelet is just a thin wrapper around wavelet_threshold
| db3, db4, haar}``. | ||
| noise_std : float, optional | ||
| The noise is estimated when noise_std is None (the default). It does | ||
| this as mentioned in pull request #1837. |
There was a problem hiding this comment.
Do we want to keep a reference to a PR in a docstring (even for a hiden function)? I think the information can be summarized in a Notes section.
e037256 to
1a7b976
Compare
ENH: Implements wavelet denoising (from #1833)
|
Closed in advance of #2190. |

This pull request implements wavelet denoising (as mentioned in issue #602). This pull request uses PyWavelets to implement this.
CONTRIBUTORS.txt(final step to avoid merge conflicts)_soft_thresholdwith an optional parameter for the threshold. If this parameter is None, we can estimate the threshold from the noise variance, similar to ENH: routine to estimate the noise standard deviation from an image #1837@grlee77 also had useful points
Running the example in docstring yields the following results:
Code changes
denoise_waveletin_denoise.pyoptional_requirements.txt.Unsure about
pywt.thresholdreturns an array of different size than the input (e.g., in my testing, for odd sized arrays when usingdb2). Currently, the code enforces that the output should be the same size as the image -- is that the right approach?makeindocs/) but couldn't find any function definitions.