Quantcast
Channel: OpenCV Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 41027

Adding Noise to Image - Opencv

$
0
0
Hi everyone! I'm trying to to add noise to an Image & then Denoise it to test my DeNoising algorithm! So for benchmark i'm referring this [Online Test samples][1]. I'm trying to replicate the Noise model. With reference to this threads [1][2] , [2][3] I'm adding noise to image like this! Mat mSource_Bgr; mSource_Bgr= imread(FileName_S,1); double m_NoiseStdDev=10; Mat mNoise_Bgr = mSource_Bgr.clone(); Mat mGaussian_noise = Mat(mSource_Bgr.size(),CV_8UC3); randn(mGaussian_noise,0,m_NoiseStdDev); mNoise_Bgr += mGaussian_noise; normalize(mNoise_Bgr,mNoise_Bgr,0, 255, CV_MINMAX, CV_8UC3); imshow("Output Window",mNoise_Bgr); //imshow("Gaussian Noise",mGaussian_noise); My Input Image [![enter image description here][4]][4] Output Image with Noise [![enter image description here][5]][5] **Problem:** **Adding Noise** to the image **alters overall brightness of the Image** which in turn alters my final results PSNR! I want to get the results as much as closer [to this one][7]! [![enter image description here][6]][6] What i have tried so far! I have tried to add the noise only in the color channel. 1. Convert the Input image into YUV Color space 2. Add the Noise only in the UV Color Channels & Keep the Y channel unaltered. Results are very bad & the overall color of the image is getting altered! Will add the code if needed! So any advice regarding this is much appreciated! May be give me some formulas for adding Noise to the image! [1]: http://demo.ipol.im/demo/125/ [2]: http://stackoverflow.com/questions/14435632/impulse-gaussian-and-salt-and-pepper-noise-with-opencv [3]: http://answers.opencv.org/question/36309/opencv-gaussian-noise/ [4]: http://i.stack.imgur.com/ReaMu.png [5]: http://i.stack.imgur.com/3UfkS.jpg [6]: http://i.stack.imgur.com/KgMLn.jpg [7]: http://demo.ipol.im/demo/g_tv_denoising/input_select?alley.x=85&alley.y=34

Viewing all articles
Browse latest Browse all 41027

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>