ImageDev

Logarithm

Calculates the natural logarithm value of each pixel in a floating point image.

Access to parameter description

This algorithm applies a pointwise operator that calculates the natural logarithm value of each pixel: $$ O(i,j)=ln(I(i,j)) $$ It works only with a floating point input image, and generates another floating point image.

See also

Function Syntax

This function returns the outputImage output parameter.
// Function prototype.
std::shared_ptr< iolink::ImageView >
logarithm( std::shared_ptr< iolink::ImageView > inputImage, std::shared_ptr< iolink::ImageView > outputImage = NULL );
This function returns the outputImage output parameter.
// Function prototype.
logarithm( input_image, output_image = None )
This function returns the outputImage output parameter.
// Function prototype.
public static IOLink.ImageView
Logarithm( IOLink.ImageView inputImage, IOLink.ImageView outputImage = null );

Class Syntax

Parameters

Class Name Logarithm

Parameter Name Description Type Supported Values Default Value
input
inputImage
The input floating point image. Image Grayscale or Multispectral nullptr
output
outputImage
The output floating point image. Its dimensions are forced to the same values as the input. Image nullptr

Object Examples

auto polystyrene_float = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene_float.vip" );

Logarithm logarithmAlgo;
logarithmAlgo.setInputImage( polystyrene_float );
logarithmAlgo.execute();

std::cout << "outputImage:" << logarithmAlgo.outputImage()->toString();
polystyrene_float = imagedev.read_vip_image(imagedev_data.get_image_path("polystyrene_float.vip"))

logarithm_algo = imagedev.Logarithm()
logarithm_algo.input_image = polystyrene_float
logarithm_algo.execute()

print( "output_image:", str( logarithm_algo.output_image ) );
ImageView polystyrene_float = Data.ReadVipImage( @"Data/images/polystyrene_float.vip" );

Logarithm logarithmAlgo = new Logarithm
{
    inputImage = polystyrene_float
};
logarithmAlgo.Execute();

Console.WriteLine( "outputImage:" + logarithmAlgo.outputImage.ToString() );

Function Examples

auto polystyrene_float = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene_float.vip" );

auto result = logarithm( polystyrene_float );

std::cout << "outputImage:" << result->toString();
polystyrene_float = imagedev.read_vip_image(imagedev_data.get_image_path("polystyrene_float.vip"))

result = imagedev.logarithm( polystyrene_float )

print( "output_image:", str( result ) );
ImageView polystyrene_float = Data.ReadVipImage( @"Data/images/polystyrene_float.vip" );

IOLink.ImageView result = Processing.Logarithm( polystyrene_float );

Console.WriteLine( "outputImage:" + result.ToString() );