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

Home » Public Forums » archive » blurring and deblurring for effect
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
blurring and deblurring for effect [message #42841] Tue, 22 February 2005 13:44
Rob Dimeo is currently offline  Rob Dimeo
Messages: 17
Registered: November 1999
Junior Member
Hi all,

I have been messing around a bit with blurring an image to be used for
an intro for a talk. What I want to do is display a series of color
images over time that begin with a very blurry version first and end
with the sharp version. My knowledge of image processing is limited so
I'm hoping that you experts can help me out a bit. The original sharp
image is a PNG file. I use TV to display the image in a window that is
the same size as the image. I've tried the MEDIAN filter where the
width decreases with each image in the sequence but I'm not happy with
the band of unblurred image that extends around the perimeter of the
image. EDGE_TRUNCATE takes care of that in SMOOTH but the effect is
still not great. There seems to be a "mixing" of colors when I use
SMOOTH that isn't present when I use MEDIAN which is also annoying.
I'm looking for a very smooth and relatively seamless transition.

If it helps the code below shows what I've been doing. Any suggestions
would be appreciated.

Thanks,

Rob
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
pro image_smooth_code,img_file
xsize = 835 & ysize = 417
img = read_png(img_file,r,g,b)
tvlct,r,g,b

tlb = widget_base(tlb_frame_attr = 5)
win = widget_draw(tlb,xsize = xsize,ysize = ysize)
window,/free,/pixmap,xsize = xsize,ysize = ysize
winpix = !d.window
widget_control,tlb,/realize

widget_control,win,get_value = winvis
n = 20
i = 3+2*indgen(n)

for i= 0,n-1 do begin
wset,winpix
tv,smooth(img,n-i+1,/edge_truncate)
; tv,median(img,n-i+1)
wset,winvis
device,copy = [0,0,xsize,ysize,0,0,winpix]
endfor
wset,winpix
tv,img
wset,winvis
device,copy = [0,0,xsize,ysize,0,0,winpix]
widget_control,tlb,/destroy
wdelete,winpix
end
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: tick label problem
Next Topic: XML Question

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

Current Time: Wed Oct 08 19:47:34 PDT 2025

Total time taken to generate the page: 0.00435 seconds