Hi
The "lazy" wavelet from the code I've posted is not good for this application - when you remove the details, the reconstruction gets blocky. Sansgrip, you definetely need another stage to get usable results, the highest frequency bands are of too high frequency, you should have very little energy in these bands (with a good wavelet) so that they make very little difference unless you are too agressive to them :) Some papers I've read state that you get a significant improvement in the smoothness of the reconstructed image if you use redundant wavelets, that is, if each band is not critically sampled and you use several "shifts" for each band. This of course involves LOTS more computation and memory. I think we could try an intermediary thing like this: 1) smooth the image so you get rid of the high frequencies (but dont subsample the blured image, keep it at full resolution). You could try any smoothing filter you want, a moving average filter, splines, etc. You could use separable filters (filter horizontal, then vertical) or non separable filters (that work with a "radius" around a given pixel). 2) Generate a detail image that is the difference of the original image and the blured image. This image is not subsampled too. 3) You can go on and smooth the smoothed image even more, with a more drastic version of your smoothing filter, and generate another difference image. 4) Apply the thresholding to the difference images (low level gate for noise removing, clipping for selective edge smoothing) 5) and then reconstruct the image adding the most smoothed image to its difference, then to the previous difference, etc. You can easily change the smoothing filter without changing the rest of the program, and try different filters until you're satisfied with the smoothness. I think you could even implement the full algorythm in a AVISynth script :) Even if maybe it's not exactly a Wavelet (depends on the filter you use) it will be a subband decomposition with perfect reconstruction, and the fact that we don't subsample the subbands may help the visual quality of the denoised image. I think that eliminating the upsampling + filtering stage is the key to get rid of most of the spurious oscillations on the denoised image. |
Quote:
1) Find average of pixel values in n-by-n block 2) If centre pixel is out by more than threshold, average it with neighours which is pretty much what all smoothers do already, and has the drawback that fine details are smoothed away along with noise. I don't think smoothing the smoothed (or even the difference) image again would help, because noise is generally so low-amplitude that it would be taken away in the first pass. I'm intruiged by (non-lazy) wavelets, though, and would love to find one specifically targeted at denoising. Targeted at video denoising would be even better, but I can dream ;). So if you hear of any wavelet algorithms (even very computationally expensive ones) you think would be particularly suitable, it would be interesting to code one of them up with your mathematical help to see how effective it really is. |
1) The problem: we have a noisy image and we want to recover the best approximation of the clean image we can, from this noisy image.
2) The clean image (the signal) is not available but must be guessed from the noisy image. We can make some assumptions about the clean image. The first is that each pixel in the image is highly correlated to its neighbours. This means that the information is spread all over the image. The second assumption we can make is that we can apply a "transform" to the image, that is, represent the image in an alternate way such that most of the information is "compacted" in a few coefficients, and the other, many, coefficients are not so important. One of such transforms is the DCT, another is the Wavelet Transform (WT). If you look at the DCT of an image or of a block of an image you'll see that most of the energy is compacted near the DC coefficient and it rapidly vanishes as you move to the highest frequencies. In a WT most of the energy is at the lowest resolution subband, and each detail band has less energy as you move to the highest frequency subbands. This is because most images have most of their energy concentrated in the lowest frequencies, and have very little high frequency information. This is, of course, a generalization, but this is what lossy image compressing schemes like JPEG or MPEG rely on. 3) A practical denoising technique must also make some assumptions on the noise. In the so called white noise one pixel of noise is not correlated to other pixels of noise; This means it doesn't have a DC level (zero mean) and that if you take a DCT or WT there won't be any concentration of significant coefficients - the white noise has equal energy at all frequencies. This doesn't hold if the noise is "coloured". White noise is also not related to the clean signal in any way. Some kinds of noise, like JPEG artifacts, are highly correlated to the clean signal. The noise is considered additive, this meaning that the noisy image is a "sum" of the clean image with some amount of pure noise. To be able to make a nice approximation of the clean image using the noisy image, the amount of noise should not be "too much". It's not only much harder to guess what's signal in the middle of an ocean of noise than to remove a little noise in an almost good image, but the more noise you have the worse will be your results. As the level of noise increases, the more subtle information is masked by the noise and you can only extract the more strong features of the clean signal. 4) The Wavelet denoising. Since the noise is supposed to be additive, and the WT is linear, the WT of the noisy image is equal to the WT of the clean signal added to the WT of the pure noise. The WT of the clean image has most energy compacted at the low frequency subbands. The WT of the noise has its energy spread evenly all over the subbands, and its energy level is hopefully very much smaller than the energy level of the lowest frequencies of the clean signal and hopefully smaller than the most important signal features at the highest frequency bands of the clean signal. Since the energy level of the noise is hopefully very much smaller than the energy level of the lowest frequencies of the clean signal, you can leave the low frequencies alone as the noise is masked by the signal and wont bother you :) Traditional denoising kills the noise by attenuating the high frequencies (with some smoothing filter), but this also attenuates the high frequencies of the signal by the same amount. The WT thresholding technique uses a "kill or keep" strategy. If the high frequency coefficient amplitude is below a certain level, it is noise or some detail you can't see anyway because of the noise; so you kill it. If it is above a certain threshold it problably ain't noise, but it is some detail you can see even with the noise; so you keep it. The result is that the noise is "killed" but the details that stand above the noise level are kept intact. The higher the noise level, the more details you have to sacrifice, just like in traditional denoising using "smoothing", but the difference is that even if you're sacrificing lots of details, the most proeminent details are still kept intact. ================================================== ==================================== |
Hi,
take a look at http://www.geocities.com/gfr.geo/teste2.html Looks a lot better than the lazy Wavelet!. here's a nice tutorial (but you need some math): http://cas.ensmp.fr/~chaplais/Waveto...tation_US.html This one is easier to understand, very good: http://engineering.rowan.edu/~polikar/homepage.html In this thesis you've got a chapter about still images and another chapter on video encoding: http://www.informatik.uni-mannheim.d...mmer2002b.html Multimedia Applications of the Wavelet Transform Claudia Kerstin Schremmer There are many papers on still images denoising you can find with google. This book: Signal and Image processing with neural networks (A C++ sourcebook) Timothy Masters John Wiley & Son Inc Has the most intuitive wavelet explanation I've read, and also has got C code for image manipulation... Some interesting stuff: http://www.informatik.uni-mannheim.d...mmer2001d.html http://www.informatik.uni-mannheim.d...mmer2001g.html |
Hi GFR,
Now that's a lot of good information :D Some of it, I can understand, and some I need an ice bag on my head after reading. 8O Excelent references. This one is really nice and graphical: http://engineering.rowan.edu/%7epoli...Ttutorial.html Thanks, -kwag |
More to torture your neurons :)
I've found a C source for Wavelets & images. Note: this Mallat guy is THE guru for wavelets! Quote:
|
This is great!
http://www.informatik.uni-mannheim.d...d/animationen/ It has java applets for Wavelets, DCT, etc. very instructive! |
http://perso.wanadoo.fr/polyvalens/clemens/clemens.html
The above site has an intuitive wavelet tutorial (downloadable in pdf) that covers noise reduction among other things, and it has pascal and c codes. It also has a link to a page with a collection!!! of transforms :) |
Donīt know much about wavelets ( :oops: in fact know nothing), but used Matlab and know it has Wavelets and even an Image Processing Toolbox.
Matlab Homepage These guy at Matlab are very good, so perhaps going through the code of the toolbox functions will be a good start. As far as I know, the coda can be compiled to C++. Hope it helps a little. Gaudi |
Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.