Sharpening an image typically involves a high-pass filter to increase the contrast between bright and dark regions to better reveal features. The following kernel is an example of a high-pass filter used to sharpen an image. This is just one example; other filters may include more weighting for the center point.
The following example uses the CONVOL function and the above kernel to sharpen a photomicrograph of cultured endothelial cells (Image courtesy of Michael J. Davis, Ph.D., College of Medicine, Texas A&M University).
This example data is available in the examples/data directory of your IDL installation. The code shown below creates the following three images, each displayed in separate windows.
file = FILEPATH('endocell.jpg', $
SUBDIRECTORY = ['examples', 'data'])
READ_JPEG, file, orig_image
img01 = IMAGE(orig_image, LOCATION = [0, 0], $
TITLE = 'Original image of endothelial cells')
kernelSize = [3, 3]
kernel = REPLICATE(-1./9., kernelSize, kernelSize)
kernel[1, 1] = 1.
filteredImage = CONVOL(FLOAT(orig_image), kernel, $
img02 = IMAGE(filteredImage, LOCATION = [250, 0], $
TITLE = 'Filtered image')
img03 = IMAGE(orig_image + filteredImage, $
LOCATION = [500, 0], $
TITLE = 'Result of adding filtered image to original image')