Quantcast

adding Gaussian noise to 2D image

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

adding Gaussian noise to 2D image

shoosh moosh
Hi,
I need to add Gaussian noise to a 2D image by convolving the image with a Gaussian. Is this implemented as a filter in ITK? Also, is there a difference between Gaussian blurring and Gaussian smoothing filters.
Thanks
 
 


What can you do with the new Windows Live? Find out
_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: adding Gaussian noise to 2D image

Moti Freiman
Hi,
This link might help you:
www.cs.mu.oz.au/~gavinb/
Moti


On Thu, Mar 12, 2009 at 3:22 AM,  <[hidden email]> wrote:

> Message: 1
> Date: Wed, 11 Mar 2009 18:05:04 +0200
> From: shoosh moosh <[hidden email]>
> Subject: [Insight-users] adding Gaussian noise to 2D image
> To: <[hidden email]>
> Message-ID: <[hidden email]>
> Content-Type: text/plain; charset="windows-1256"
>
>
> Hi,
> I need to add Gaussian noise to a 2D image by convolving the image with a Gaussian. Is this implemented as a filter in ITK? Also, is there a difference between Gaussian blurring and Gaussian smoothing filters.
> Thanks
>
>
> _________________________________________________________________
> Drag n? drop?Get easy photo sharing with Windows Live? Photos.
>
> http://www.microsoft.com/windows/windowslive/products/photos.aspx
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://www.itk.org/pipermail/insight-users/attachments/20090311/93f094c7/attachment-0001.htm>
>
> ------------------------------
>

--
__
Moti Freiman, Ph.D Student.
Medical Image Processing and Computer-Assisted Surgery Laboratory.
School of Computer Science and Engineering.
The Hebrew University of Jerusalem Givat Ram, Jerusalem 91904, Israel
Phone: +(972)-2-658-5371 (laboratory)
WWW site: http://www.cs.huji.ac.il/~freiman
_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: adding Gaussian noise to 2D image

Luis Ibanez
In reply to this post by shoosh moosh

Hi Shoosh,

Convolving an image with a 2D Gaussian *will not* add a
Gaussian noise to the image.


On the contrary, it will reduce Noise from the image.


If what you need is to add noise to the image, what you want
to do is to use the generator of Gaussian Distributions:

    Insight/Numerics/Statistics/itkGaussianDistribution.h

and do the following:

    a) Iterate over all the pixels in your image
       (using for example, the ImageRegionIterator)
    b) For every pixel, call the method MersenerTwisterRandom
       generator, in order to produce a random number from
       a uniform distribution
    c) Using the value from (b), pass it as argument to the
       method InverseCDF() of the GaussianDistribution class.
       This will convert the values from the uniform distribution
       into values from a Gaussian Distribution.
    d) Scale the value from (c) to the amplitude of noise that
       you want to insert in your image
    e) add the value from (d) to the current pixel
    f) go to the next pixel.


Note that you could implement this quite easily by modifying the code
of the existing class:


          itkRandomImageSource

if you insert the call to the GaussianDistribution::InverseCDF()
in lines 154 of the file

     Insight/Code/BasicFilters/itkRandomImageSource.txx

You could then rename this modified filter

             itkGaussianImageSource.txx

and submit it as a contribution to the Insight Journal   :-)

        http://wwww.insight-journal.org

so it can be included in the Toolkit later.

An alternative implementation could be like an actual
Image filter, that takes an input and produces an output.

This could be done by deriving your new filter from the
UnaryFunctorImageFilter, and packaging the random number
generator and GaussianDistribution in the Functor of that
filter.

Please let us know if you need help in implementing this filter.



     Thanks


        Luis


---------------------
shoosh moosh wrote:

> Hi,
> I need to add Gaussian noise to a 2D image by convolving the image with
> a Gaussian. Is this implemented as a filter in ITK? Also, is there a
> difference between Gaussian blurring and Gaussian smoothing filters.
> Thanks
>  
>  
>
> ------------------------------------------------------------------------
> What can you do with the new Windows Live? Find out
> <http://www.microsoft.com/windows/windowslive/default.aspx>
>
>
> ------------------------------------------------------------------------
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-users
Loading...