Coyote Graphics Routines

Date: Fri Mar 27 12:14:20 2015

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

.\

cglogscl.pro


top cgLogScl

Image Processing

result = cgLogScl(image [, CONSTANT=float], NEGATIVE=NEGATIVE [, MAX=MAX] [, MIN=MIN] [, OMAX=byte] [, OMIN=byte])

This is a utility routine to perform a logarithmic transformation on an image. The shape of the transformation is similar to the gamma curve (see cgGmaScl), except that the shape of the gamma curve is variable, while the log curve is fixed. The function is used to improve contrast in images. The equation being implemented before scaling between OMIN and OMAX is as follows:

output = constant * Log(1 + double(input))

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

CONSTANT in optional type=float default=1.0

A contant value by which the log result is multiplied.

NEGATIVE

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

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.

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

Examples of compression stretching:

cgLoadCT, 0 ; Gray-scale colors. image = cgDemoData(22) ; Load image. cgImage, image ; No contrast. cgImage, cgLogScl(image) ; Improved contrast.

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) 2015, Fanning Software Consulting, Inc.

History:

Change History:

Written by: David W. Fanning, 27 March 2015. DWF.

File attributes

Modification date: Fri Mar 27 10:06:43 2015
Lines: 157
Docformat: rst rst