2016-06-17 08:37:26 -0500 commented answer Adding Noise to Image - Opencv Another fact is I am adding same amount of noise to different color images. But when calculating MSE, their values are different for different images. Why is that? According to my understanding it should same for all images, if the amount of noise being added is same. 2016-06-07 09:12:46 -0500 commented answer How to add noise to color image, so that the MSE becomes square of the standard deviation of the noise? I am getting the same value as yours while considering the three channels. 2016-06-07 09:06:42 -0500 commented question How to add noise to color image, so that the MSE becomes square of the standard deviation of the noise? //For gray level image for(int y = 0; y < width; y++){ for(int x = 0; x < height;x++){  difference = (original.at(x,y) - ref.at(x,y)); sum = sum + difference*difference; } } mse = (float)sum /(width*height); printf("MSE =%.3f\n",mse);  2016-06-07 08:53:16 -0500 commented answer How to add noise to color image, so that the MSE becomes square of the standard deviation of the noise? I am calculating MSE for M-pixel gray level images MSE=1/M ∑_(j=1)^M [ I_target (j)- I_reference (j) ] ^2 where I_target is the degraded image and I_reference is the original image 2016-06-07 06:19:44 -0500 asked a question How to add noise to color image, so that the MSE becomes square of the standard deviation of the noise? I have added noise to color image. But when I am calculating the MSE, it is very low compared to the added noise. For std=20, the MSE is below 200. But I think MSE should be close to square of standard deviation of the added random noise(if std=20 then MSE around 400). 2016-06-07 06:15:02 -0500 commented answer Adding Noise to Image - Opencv I have added noise to color image in this way. But when I am calculating the MSE, it is very low compared to the added noise. For std=20, the MSE is below 200. But I think MSE should be close to square of std of the random noise(if std=20 then MSE around 400). How to add noise so that the MSE becomes square of the standard deviation of the noise? 2016-06-07 04:34:56 -0500 received badge ● Supporter (source) 2016-06-07 04:34:43 -0500 commented answer Adding Noise to Image - Opencv Thanks a lot for your prompt update 2016-04-06 23:45:58 -0500 asked a question opencv cl_texture.h not found I got this error while running a code 2016-01-26 21:40:20 -0500 commented question Convert RGB to XYZ Thanks, done 2016-01-25 21:59:38 -0500 asked a question Convert RGB to XYZ I have an image in RGB and I need the Y component of CIE XYZ color space. What is difference between grayscale image and the Y component of CIE XYZ color space? 2015-12-30 07:22:21 -0500 received badge ● Editor (source) 2015-12-30 07:21:38 -0500 asked a question How to find the width of an edge I need to apply Sobel filter on image and detect the local maximum gradient for each edges direction. Pixels whose gradient are larger than threshold considered as edge pixel. Now the task is to find the width (pixel width) between the local maximum and local minimum for edge (edge pixels). 2015-12-29 21:22:31 -0500 commented answer Adding Noise to Image - Opencv This solved my problem 2015-12-29 00:20:40 -0500 received badge ● Enthusiast 2015-12-28 06:28:42 -0500 commented question add gaussian noise to colour image Thanks it fixed the error but the resulting noisy image is some how different. It is a yellowish image. And this is not my desired target. Is my way is wrong ? I am very new at opencv and image processing 2015-12-28 06:23:24 -0500 commented question add gaussian noise to colour image Please suggest is there any better and simple way to add noise to colour with varying std of gaussian noise. 2015-12-28 06:16:50 -0500 commented question add gaussian noise to colour image This is the error OpenCV Error: Assertion failed (mv[i].size == mv[0].size && mv[i].depth() == depth) in merge, file /Users/hossainmdshakhawat/opencv-3.0.0/modules/core/src/convert.cpp, line 950 libc++abi.dylib: terminating with uncaught exception of type cv::Exception: /Users/hossainmdshakhawat/opencv-3.0.0/modules/core/src/convert.cpp:950: error: (-215) mv[i].size == mv[0].size && mv[i].depth() == depth in function merge 2015-12-28 06:13:11 -0500 commented question add gaussian noise to colour image my code: Mat ycrcb = input.clone(); cvtColor(input, ycrcb, CV_BGR2YCrCb); Mat channel[3]; Mat result[3]; split(ycrcb,channel); Mat noise = Mat(channel[0].size(),CV_64F); normalize(channel[0], result[0], 0.0, 1.0, CV_MINMAX, CV_64F); randn(noise, 0, .1); result[0] = result[0] + noise; normalize(result[0], result[0], 0.0, 1.0, CV_MINMAX, CV_64F); result[0].convertTo(channel[0], CV_32F, 255, 0); imwrite("gaussiannoisy.jpg",channel[0]); Mat output; merge(channel,3,output); imwrite("merge.jpg",output);  2015-12-28 04:00:32 -0500 commented question add gaussian noise to colour image I can split the Y Cr, and Cb. I can add noise to Y too. But while I am trying to merge I am getting assertion error. 2015-12-28 03:41:17 -0500 commented question add gaussian noise to colour image I have tried to separate the colour channels and add noise to each of them and merge them. And succeed to do so. But I want to separate the Y Cr Cb components and then add noise to only Y. Finally merge the components but could not. My code for colour channels: for (int i=0;i<3;i++) { Mat noise = Mat(channel[i].size(),CV_64F); normalize(channel[i], result[i], 0.0, 1.0, CV_MINMAX, CV_64F); randn(noise, 0, .2); result[i] = result[i] + noise; normalize(result[i], result[i], 0.0, 1.0, CV_MINMAX, CV_64F); result[i].convertTo(result[i], CV_32F, 255, 0); } merge(result,3,input); imwrite("/Users/hossainmdshakhawat/developer/subimg/Noisy/merge.jpg",input);  2015-12-28 03:27:32 -0500 asked a question add gaussian noise to colour image I want to add gaussian noise to colour image where the standard deviation of gaussian noise were varied from 0.2 to 2 at 0.2 intervals. 2015-12-27 23:52:36 -0500 received badge ● Scholar (source) 2015-12-22 07:40:24 -0500 commented answer apply a 3X3 window kernel in an image Would please explain the line center = image(centerRect); 2015-12-22 02:29:17 -0500 commented answer apply a 3X3 window kernel in an image Actually I have done this using for loop and taking image an mat. But the problem is when accessing (x-1,y-1) point for x=0 and y=0. As it is out of matrix. Is there any way to test if a matrix position is out of range. Thanks for you help. Would you please explain it more? 2015-12-20 23:40:21 -0500 asked a question apply a 3X3 window kernel in an image I want to apply a 3X3 window kernel in an image and replace the center pixel with the minimum difference between its surrounding pixels. Anybody please provide me with some help. I am new with OpenCV. And want to apply this process on whole image.