Gaussian Noise in emgucv

久未见 提交于 2019-12-07 20:40:08

问题


How can I add gaussian noise ( with a particular mean and variance ) to an image using emgucv ?


回答1:


I'm not sure quite what your asking as a Gaussian filter tends to be there to remove noise. To use a custom kernel you can use the following code. If you wish to add noise with a set mean and variance then you may have to resort to looping through the my_image.Data property and add it that way. Here is the code for using a custom Kernel if it's not quite what your after let me know and I'll try and find something more appropriate a link to example images may be useful in this case.

Image<Bgr, Byte> my_image = new Image<Bgr, byte>(open.FileName);

float[,] k = { {0, 0, 0},
               {0, 0, -0},
               {0.33F, 0, -0}};

ConvolutionKernelF kernel = new ConvolutionKernelF(k);

Image<Bgr, float> convolutedImage = my_image * kernel;

pictureBox1.Image = convolutedImage.ToBitmap();

I Hope this Helps,

Chris



来源:https://stackoverflow.com/questions/7782941/gaussian-noise-in-emgucv

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!