ImageDev

InvertImage

Calculates the reverse intensities of an image on a given number of significant bits.

Access to parameter description

InvertImage calculates the reverse of an image. The algorithm works in two steps: Remark: Applying InvertImage on all the bits of an image gives the same result as applying LogicalNot.

See also

Function Syntax

This function returns outputImage.
// Function prototype
std::shared_ptr< iolink::ImageView > invertImage( std::shared_ptr< iolink::ImageView > inputImage, int32_t significantBitNumber, std::shared_ptr< iolink::ImageView > outputImage = NULL );

Class Syntax

Parameters

Parameter Name Description Type Supported Values Default Value
input
inputImage
The input image. Image Binary, Label, Grayscale or Multispectral nullptr
input
significantBitNumber
The number of significant bits. Int32 [1, 32] 8
output
outputImage
The output image, size, and type are forced to the same values as the input. Image nullptr

Object Examples

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

InvertImage invertImageAlgo;
invertImageAlgo.setInputImage( foam );
invertImageAlgo.setSignificantBitNumber( 8 );
invertImageAlgo.execute();

std::cout << "outputImage:" << invertImageAlgo.outputImage()->toString();

Function Examples

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

auto result = invertImage( foam, 8 );

std::cout << "outputImage:" << result->toString();