24小时热门版块排行榜    

CyRhmU.jpeg
查看: 5090  |  回复: 3

norbie2008

新虫 (初入文坛)

[求助] 如何给图像加一个大小可控的泊松噪声已有1人参与

如题,请教高手
matlab中用imnoise产生的poisson噪声,但噪声大小由输入图像自动生成,不可控制。
我想要可由参数控制的poisson噪声,从未产生含噪图像,用于图像降噪。
谢谢大家了
回复此楼
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

feixiaolin

荣誉版主 (文坛精英)

优秀版主

【答案】应助回帖

★ ★ ★ ★ ★ ★ ★ ★ ★ ★
感谢参与,应助指数 +1
norbie2008(nono2009代发): 金币+10 2017-07-18 21:53:44
P_noise0= numda *sqrt(-2* log( 1-x) );
numda  自己定,x为 [0, 1] 均布随机噪声。
if(P_noise > 255)
      P_noise =255;      
if(P_noise < 0 )
      P_noise=0;
2楼2014-04-16 21:34:01
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

光信小生

金虫 (小有名气)

可以用poissrnd,不过这样全图都是同一个参数

发自小木虫Android客户端
3楼2017-07-17 10:35:46
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

李震北京理工

铜虫 (小有名气)

图像泊松噪声是没法控制大小的,泊松噪声是和你图像亮度挂钩的,图像越亮,泊松噪声就近似高斯分布了,图像越暗,其影响越严重,因此单论一张图来说,控制其泊松噪声的大小是没有意义的。
如果你非要改变泊松噪声,可以有如下代码
function [ b ] = poisson_fun( a,lamda )
    sizeA = size(a);
    a = double(a();

    %  (Monte-Carlo Rejection Method) Ref. Numerical
    %  Recipes in C, 2nd Edition, Press, Teukolsky,
    %  Vetterling, Flannery (Cambridge Press)
   
    b = zeros(size(a),'like', a);
    idx1 = find(a<50); % Cases where pixel intensities are less than 50 units
    if (~isempty(idx1))
      g = exp(-a(idx1)*lamda);
      em = -ones(size(g));
      t = ones(size(g));
      idx2 = (1:length(idx1))';
      while ~isempty(idx2)
        em(idx2) = em(idx2) + 1;
        t(idx2) = t(idx2) .* rand(size(idx2));
        idx2 = idx2(t(idx2) > g(idx2));
      end
      b(idx1) = em;
    end

    % For large pixel intensities the Poisson pdf becomes
    % very similar to a Gaussian pdf of mean and of variance
    % equal to the local pixel intensities. Ref. Mathematical Methods
    % of Physics, 2nd Edition, Mathews, Walker (Addison Wesley)
    idx1 = find(a >= 50); % Cases where pixel intensities are at least 50 units
    if (~isempty(idx1))
      b(idx1) = round(a(idx1) + sqrt(lamda*a(idx1)) .* randn(size(idx1)));
    end
   
    b =uint8(reshape(b,sizeA));


end
You_are_my_quest
4楼2018-05-02 11:19:26
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 norbie2008 的主题更新
信息提示
请填处理意见