PANDORE Version 6 | GREYC-IMAGE |
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.
inverse is an integer in [0, 1] that specifies whether the transform is logarithmic (inverse=0) or exponential (inverse=1).
min and max specify the bounds of the output
pixel value. They are related to the type of the input image.
Note: if min < max then min and max are set with
the minimum and maximum values of the input image type;
for example, 0 and 255 for Uchar images.
Returns SUCCESS or FAILURE in case of invalid parameter values.
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
Transformations des niveaux de gris par loi logarithmique ou exponentielle.
Author: Régis Clouard