以特定均值向图像添加泊松噪声。

时间:2018-08-31 15:14:38

标签: matlab

如何在Matlab中添加具有特定泊松分布均值的泊松噪声?下面的代码给了我一张完全白色的图像。

img = im2double(phantom(512));
figure; imshow(img)
mean = 1e9;
R = poissrnd(mean, [512, 512]);
J = img + R;
figure; imshow(J);

3 个答案:

答案 0 :(得分:2)

The way you are doing it is good. Your mean is 1000000000 therefore the numbers are very very big.

However to show an image with auto-scaled colormap, do:

img = im2double(phantom(512));
figure; imshow(img,[])
mean = 1e9;
R = poissrnd(mean, [512, 512]);
J = img + R;
figure; imshow(J,[]);

Note the square brakets.

答案 1 :(得分:2)

通常,当将泊松噪声添加到图像时,您希望使用像素值作为平均值(在适当缩放后)。这将更接近于图像采集中的泊松噪声。

例如,假设您的图像是在光子有限的显微镜中获取的,该图像在im2double之后为0-1。假设缩放是这样,一个像素上的1e9个光子表示为像素值1。要在此处模拟光子噪声,(无噪)值为1的一个像素的{噪点)值为{ {1}}。另一个值为0.5的像素的值为poissrnd(1e9)/1e9

在图像处理工具箱中,有一个函数imnoise,该函数在按以下方式调用时可以完全做到这一点:

poissrnd(1e9*0.5)/1e9

此功能的缩放比例为1e12。您希望缩放比例为1e9,因此必须将图片除以1e3:

img = imnoise(img,'poisson');

答案 2 :(得分:0)

这个 wordpress 博客有关于 imnoise 及其行为的详细信息:

https://ruiminpan.wordpress.com/2016/03/10/the-curious-case-of-poisson-noise-and-matlab-imnoise-command/

相关问题