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 = nullptr );
This function returns outputImage.
// Function prototype.
invert_image(input_image: idt.ImageType,
             significant_bit_number: int = 8,
             output_image: idt.ImageType = None) -> idt.ImageType
This function returns outputImage.
// Function prototype.
public static IOLink.ImageView
InvertImage( IOLink.ImageView inputImage,
             Int32 significantBitNumber = 8,
             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
Parameter Name Description Type Supported Values Default Value
input
input_image
The input image. image Binary, Label, Grayscale or Multispectral None
input
significant_bit_number
The number of significant bits. int32 [1, 32] 8
output
output_image
The output image, size, and type are forced to the same values as the input. image None
Parameter Name Description Type Supported Values Default Value
input
inputImage
The input image. Image Binary, Label, Grayscale or Multispectral null
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 null

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();
foam = imagedev.read_vip_image(imagedev_data.get_image_path("foam.vip"))

invert_image_algo = imagedev.InvertImage()
invert_image_algo.input_image = foam
invert_image_algo.significant_bit_number = 8
invert_image_algo.execute()

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

InvertImage invertImageAlgo = new InvertImage
{
    inputImage = foam,
    significantBitNumber = 8
};
invertImageAlgo.Execute();

Console.WriteLine( "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();
foam = imagedev.read_vip_image(imagedev_data.get_image_path("foam.vip"))

result = imagedev.invert_image(foam, 8)

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

IOLink.ImageView result = Processing.InvertImage( foam, 8 );

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