Interactive Data Language
Convolving with User defined Kernels
As described previously the SMOOTH function gives equal weight to the neighbouring pixels. IDL also allows us to define the form of our filter (kernel smoother mask etc) and convolve it with an image. We can therefore create a Gaussian-weighted 5?5 kernel of the form
and convolve it with an image using the following commands
kernel = [[12321][271172][31117113] $
[271172][12321]]
tv CONVOL(noisy_imagekernelTOTAL(kernel))
The command: TOTAL(kernel) in the previous line automatically scales the kernel so that the dynamic range of the processed pixel is more or less preserved (it is the same as putting the fraction outside the kernel as in section a).
Exercise 1
Edit the original Kernel to make the output image shifted by 3 pixels to the left.
Attachments: