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 = [[1,2,3,2,1],[2,7,11,7,2],[3,11,17,11,3], $

         [2,7,11,7,2],[1,2,3,2,1]]

 

tv, CONVOL(noisy_image,kernel,TOTAL(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. 

    • 10 years ago
    IDL program A+ Tutorial use as Guide
    NOT RATED

    Purchase the answer to view it

    • idl_program.doc