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

Home » Public Forums » archive » simple deconvolution
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
simple deconvolution [message #75210] Tue, 22 February 2011 07:00 Go to previous message
rogass is currently offline  rogass
Messages: 200
Registered: April 2008
Senior Member
Hi folks,
I want to implement an image deconvolution into a larger package. The
following code performs either the Iterative Wiener (by A.W.
Stevenson) or the Richardson-Lucy deconvolution, but both go wrong for
the recovery of both smoothed images and smoothed images plus noise .
I'm a little bit confused about that. Maybe somebody could help me?
The implemented CONVOLVE comes from the Astrolib. I'm using IDL 8 and
the code is not optimised as you can see :)

function cr_deconv,im,psf,method,small=small
sz1 = size(im,/dimensions)
sz2 = size(psf,/dimensions)
small=~n_elements(small)?1e-5:small
if total(sz1 eq sz2) ne 0 then begin
p=fltarr(sz1)
p[(sz1[0]/2)-(sz2[0]/2) ,(sz1[1]/2)-(sz2[1]/2)]=psf
endif
p/=total(psf)
p[where(p lt small)]=small
if method eq 'iwiener' then begin
psf_fft=fft(p)
psf_fft[where(abs(psf_fft) lt small)]=small
snr=mean(median(im,3))/stddev(im-median(im,3)) : snr
pc=psf_fft*conj(p)
pc[where(abs(pc) lt small)]=small
filter=pc
filter/=(filter+1./snr)
filter[where(abs(filter) lt small)]=small
res=abs(fft(filter*fft(im)/psf_fft,/inverse))
for i=0l,iter-1l do begin
res+=abs(fft((fft(convolve(i eq 0?im:res,p)-im)/psf_fft)*$
(pc/(pc+(1./snr))),/inverse))
snr=mean(median(res,3))/stddev(res-median(res,3))
endfor
else begin
corr_kernel=rot(p,180)
for i=0l,iter-1l do $
res=(i eq 0?im:res)*convolve(im/convolve(i eq 0?
im:res,p),corr_kernel)
endelse
return,res
end


Thanks in advance

CR
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Pixelwise temporal trend, problem with REFORM
Next Topic: IDL on win7 crashing

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

Current Time: Wed Oct 08 15:33:22 PDT 2025

Total time taken to generate the page: 0.00395 seconds