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
|