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))
Image Processing
A byte scaled image is returned.
image: in, required The image to be scaled. Written for 2D images, but arrays of any size are treated alike.
constant: in, optional, type=float, default=1.0 A contant value by which the log result is multiplied. 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, in, optional, type=boolean, default=0 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 of compression stretching:: cgLoadCT, 0 ; Gray-scale colors. image = cgDemoData(22) ; Load image. cgImage, image ; No contrast. cgImage, cgLogScl(image) ; Improved contrast.
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
Change History:: Written by: David W. Fanning, 27 March 2015. DWF.
Copyright (c) 2015, Fanning Software Consulting, Inc.