Coyote Graphics Routines

Date: Fri Mar 27 12:14:20 2015

single page | use frames     summary     class     fields     routine details     file attributes

.\

cggmascl.pro


top cgGmaScl

Image Processing

result = cgGmaScl(image [, GAMMA=float] [, MAX=MAX] [, MIN=MIN], NEGATIVE=NEGATIVE [, OMAX=byte] [, OMIN=byte])

This is a utility routine to perform basic gray-level pixel transformations of images. I think of it as BYTSCL on steroids. It is similar to IMADJUST in _Digital Image Processing with MATLAB_ by Gonzales, Wood, and Eddins. It performs a log scaling of the image array.

Return value

A byte scaled image is returned.

Parameters

image in required

The image to be scaled. Written for 2D images, but arrays of any size are treated alike.

Keywords

GAMMA in optional type=float default=1.0

The exponent in a power-law transformation (image^gamma). A gamma value of 1 results in a linear distribution of values between OMIN and OMAX. Gamma values less than 1 map darker image values into a wider range of output values, and Gamma values greater than 1 maps lighter image values into a wider range of output values. The gamma value is constrained to be greater than 1.0e-6.

MAX in optional

Any value in the input image greater than this value is set to this value before scaling.

MIN in optional

Any value in the input image less than this value is set to this value before scaling.

NEGATIVE

If set, the "negative" of the result is returned.

OMAX in optional type=byte default=255

The output image is scaled between OMIN and OMAX.

OMIN in optional type=byte default=0

The output image is scaled between OMIN and OMAX.

Examples

cgLoadCT, 0 ; Gray-scale colors. image = cgDemoData(11) ; Load image. TVImage, cgGmaScl(image, Min=30, Max=100) ; Similar to BytScl. TVImage, cgGmaScl(image, /Negative) ; Produce negative image. power = Shift(ALog(Abs(FFT(image,-1))), 124, 124) ; Create power spectrum. TVImage, cgGmaScl(power, Gamma=2.5) ; View power specturm with gamma correction. TVImage, cgGmaScl(power, Gamma=2.5, /Negative) ; Reverse power spectrum.

Author information

Author:

FANNING SOFTWARE CONSULTING:

David W. Fanning 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

Copyright:

Copyright (c) 2006-2015, Fanning Software Consulting, Inc.

History:

Change History:

Written by: David W. Fanning, 17 February 2006. Fixed a problem with output scaling. 1 July 2009. DWF (with input from Bo Milvang-Jensen). Now setting NAN keyword on all MIN and MAX functions. 2 Dec 2011. DWF. Renamed cgGmaScl from GmaScl. 27 March 2015. DWF.

File attributes

Modification date: Fri Mar 27 08:03:22 2015
Lines: 160
Docformat: rst rst