>  Docs Center  >  Libraries  >  Coyote  >  CGSTRETCH


  The program implements an interactive way to stretch an image histogram and provide
  contrast for 2D image arrays. This is commonly known as "contrast stretching."
  The program supports the following stretches::
      LINEAR Linear stretch between end points.
      CLIP Linear, except a 2% of pixels are clipped at either end of histogram.
      GAMMA An exponential function.
      LOG A natural logarithmic function, similar to gamma but with fixed shape.
      ASINH An inverse hyperbolic sine function (strong log function).
      SQUARE ROOT The square-root of the image pixels is stretched linearly.
      EQUALIZATION Image histogram is equalized before stretching.
      ADAPTIVE EQUALIZATION Image histogram is equalized with Adapt_Hist_Equal before stretching.
      GAUSSIAN A gaussian normal distribution function is applied to the stretch.
      STDDEV The image is stretched by multiples of its standard deviation from its mean value.
      COMPRESSION The mid-tones of the image are compressed by varying amounts.


    Image Processing, Widgets


  If you have a 2D image in the variable "image", you can run this program like this::
      IDL> image = cgDemoData(7)
      IDL> cgStretch, image
      IDL> cgStretch, image, TYPE='GAMMA'
      IDL> cgStretch, image, TYPE='LOG', EXPONENT=5.5
      IDL> cgStretch, image, TYPE='ASINH', BETA=0.1


      David W. Fanning
      1645 Sheely Drive
      Fort Collins, CO 80526 USA
      Phone: 970-221-0438
      E-mail: davidf@dfanning.com
      Coyote's Guide to IDL Programming: http://www.dfanning.com


    Change History::
        Written by David W. Fanning, April 1996, as XStretch.
        XStretch retired and the program was renamed cgStretch, 21 October 2012.
        Added Compression stretch and updated to Coyote Graphics stretch functions. 27 March 2015. DWF.
        Missed a couple of retire program name changes in the program. 7 April 2015. DWF.


    Copyright (c) 1996-2012, Fanning Software Consulting, Inc.

© 2019 Harris Geospatial Solutions, Inc. |  Legal
My Account    |    Store    |    Contact Us