comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: How to add 5% possion noise for a image in IDL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: How to add 5% possion noise for a image in IDL [message #83995 is a reply to message #83994] Fri, 12 April 2013 04:33 Go to previous messageGo to previous message
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
On Friday, April 12, 2013 7:29:09 AM UTC-4, wlandsman wrote:

Ooops, found a bug in the code as soon as I posted it. I left out the number of values to compute in RANDOMU

function addpoisson,im, seed = seed
h = histogram(im, min=0, reverse=rr)
newim = im

for i = 0,N_elements(h)-1 do begin
if h[i] NE 0 then begin
sub = rr[rr[i]:rr[i+1]-1] ;Get subscripts
newim[sub] = randomu(seed,N_elements(sub),poisson=i)
endif
endfor

return, newim
end
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: plotting vertical lines
Next Topic: Spaces in Mac file names

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 14:55:38 PDT 2025

Total time taken to generate the page: 0.72042 seconds