Horus Doc || Global Function Guide || General documentation   | Function documentation  

HxLog10

Synopsis

HxImageRep HxLog10 (HxImageRep img)

Input

HxImageRep img
The image you want to take the of.

Return value

HxImageRep
The of the input image.

Description

The function HxLog10 takes the logarithm, with base 10, of each pixel value. The logarithm of a vector is defined by taking the logarithm of the components of the vector, i.e.

Remarks

Valid input images
Only image with values greater than zero are valid. If one of the values is less or equal than zero (or one of the components of a vector is less or equal than zero), the input image is not valid.

Examples

Taking the logarithm of an image.

#include "HxImageRepGlobalFuncs.h"
#include "HxImageRep.h"

HxImageRep HxLog10Example1(HxImageRep img) {
   img = HxImageAsDouble(img);
   img = HxLog10(img);
   img = HxContrastStretch(img, 255.0);
   img = HxImageAsByte(img);

   return img;
}

int main(int argc, char* argv[])
{
    HxImageRep img = HxMakeFromFile(argv[1]);
    img = HxLog10Example1(img);
    HxWriteFile(img, argv[2]);

    return 0;
}

exampleImage1.gif

Input image for the HxLog10 example.

HxLog10Result1.gif

Output image of the HxLog10 example.

In this example we first convert the input image to a double valued image. We take the logarithm (with base 10), after which we stretch the image to let it contain values ranges from 0.0 to 255.0 for visualization purposes.

See also

HxLog, HxExp, HxPow,

Keywords

Unary, Arithmetic,


Generated on Mon Jan 27 15:45:00 2003 for GlobalFunctionGuide by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001