# coyote: SHARPEN

- coyote/Image Processing
- [Source code]

NAME

      Sharpen

PURPOSE

      This function sharpens an image using a Laplacian kernel.
      The final result is color adjusted to match the histogram
      of the input image.

AUTHOR

      FANNING SOFTWARE CONSULTING
      David Fanning, Ph.D.
      1645 Sheely Drive
      Fort Collins, CO 80526 USA
      Phone: 970-221-0438
      E-mail: david@idlcoyote.com
      Coyote's Guide to IDL Programming: http://www.idlcoyote.com

CATEGORY

      Image Processing

CALLING SEQUENCE

      sharp_image = Sharpen(image)

INPUTS

      image - The input image to be sharpened. Assumed to be a 2D byte array.

OUTPUTS

      sharp_image - The sharpened image.

INPUT KEYWORDS

      KERNEL -- By default the image is convolved with this 3-by-3 Laplacian kernel:
          [ [-1, -1, -1], [-1, +8, -1], [-1, -1, -1] ].  You can pass in any  kernel
          of odd width. The filtered image is added back to the original image to provide
          the sharpening effect.
      DISPLAY -- If this keyword is set a window is opened and the details of the sharpening
          process are displayed.

OUTPUT KEYWORDS

      None.

DEPENDENCIES

      None.

METHOD

      This function is based on the Laplacian kernel sharpening method on pages 128-131
      of Digital Image Processing, 2nd Edition, Rafael C. Gonzalez and Richard E. Woods,
      ISBN 0-20-118075-8.

EXAMPLE

      There is an example program at the end of this file.

MODIFICATION HISTORY

      Written by David W. Fanning, January 2003.
      Updated slightly to use Coyote Library routines. 3 Dec. 2010. DWF.
      Modified the example to work with cgImage. 29 March 2011. DWF.