PANDORE Version 6 GREYC-IMAGE

ppowerlawtransform



Performs power-law transform of the gray-levels.



Synopsis

ppowerlawtransform gamma min max [-m mask] [im_in|-] [im_out|-]

Description

ppowerlawtransform expands or compresses gray-levels of the input image using a power law transform of the gray-levels according to the value of the parameter gamma. Such transform often refers to the gamma correction.

The effect of the power-law transform is to map a narrow range of low gray-level values in the input image into a wider range of output levels when gamma < 1, and the opposite with gamma >1.

The power-law transform of pixel 'p' has the form:

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

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 positive transform followed by a negative transform to create image b.pan. Because negative is the inverse transform of positive transform, b.pan is (almost) equal to tangram.pan (due to rounding error):

   ppowerlawtransform 2 0 255 tangram.pan a.pan
   ppowerlawtransform 0.5 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:

   ppowerlawtransform 0.4 1 -1 tangram.pan a.pan

See also

Lut transform, plineartransform, plogtransform

C++ prototype

Errc PPowerLawTransform( const Img2duc &im_in, const Img2duc &im_out, float gamma, float min, float max );

Version française

Transformation des niveaux de gris par une loi de puissance.


Author: Régis Clouard