PANDORE Version 6 GREYC-IMAGE

plogtransform



Performs logarithmic and exponential transforms of the gray-levels.



Synopsis

plogtransform inverse min max [-m mask] [im_in|-] [im_out|-]

Description

plogtransform expands the gray-levels of the input image using a logarithmic or an exponential transform of the gray-levels. The parameter inverse specifies whether the transform is logarithmic or exponential.

The effect of the logarithmic transform is to map a narrow range of low gray-level values in the input image into a wider range of output levels. The inverse exponential transform is true for higher values of input levels.

The logarithmic transform of pixel 'p' has the form:

im_out[p]=(c*log(im_in[p]-smin+1.0)) + min;
c=(max-min) / (log(smax-smin+1.0))

where smin and smax are the minimum and the maximum values of the input image, and c is a normalization factor for stretching output values between min and max.

The exponential transform of pixel 'p' has the form:

im_out[p]=exp((im_in[p]-smin)/c) -1.0 + min;
c=(smax-smin) / (log(max-min+1.0))

where smin and smax are the minimum and the maximum values of the input image, and c is a normalization factor for stretching output values between min and max.

For color and multispectral images, the transform uses the vectorial approach: the min and max values are calculed from all the bands, and then each band is stretched with the same transform.

Parameters

Inputs

Outputs

Result

Returns SUCCESS or FAILURE in case of invalid parameter values.

Examples

Applies a logarithmic transform followed by an exponential transform to create image b.pan. Because exp is the inverse transform of log, b.pan is (almost) equal to tangram.pan (due to rounding error).

   plogtransform 0 0 255 tangram.pan a.pan
   plogtransform 1 28 165 a.pan b.pan

Applies a logarithmic transform to create a.pan and uses the min and max values of the image type as new bounds.

   plogtransform 0 1 -1 tangram.pan a.pan

See also

Lut transform, plineartransform, ppowerlawtransform

C++ prototype

Errc PLogTransform( const Img2duc &im_in, const Img2duc &im_out, int inverse, float min, float max );

Version française

Transformations des niveaux de gris par loi logarithmique ou exponentielle.


Author: Régis Clouard