ArithmeticOperationWithImage
Performs a pointwise arithmetic operation between two images.
Access to parameter description
The arithmetic operator to apply between both input images I1 and I2 can be selected from:
See also
See related example
Access to parameter description
The arithmetic operator to apply between both input images I1 and I2 can be selected from:
- Addition
- Subtraction
- Multiply
- Division
- Minimum or maximum
See also
See related example
Function Syntax
This function returns the outputImage output parameter.
// Function prototype. std::shared_ptr< iolink::ImageView > arithmeticOperationWithImage( std::shared_ptr< iolink::ImageView > inputImage1, std::shared_ptr< iolink::ImageView > inputImage2, ArithmeticOperationWithImage::ArithmeticOperator arithmeticOperator, std::shared_ptr< iolink::ImageView > outputImage = NULL );
Class Syntax
Parameters
Class Name | ArithmeticOperationWithImage |
---|
Parameter Name | Description | Type | Supported Values | Default Value | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
inputImage1 |
The first input image.
The supported types for the first input image are grayscale, binary, label, and color. |
Image | Binary, Label, Grayscale or Multispectral | nullptr | |||||||||||||
inputImage2 |
The second input image, must have same dimensions as the first input.
The supported types for the second input image are grayscale, binary, label, and color. |
Image | Binary, Label, Grayscale or Multispectral | nullptr | |||||||||||||
arithmeticOperator |
The arithmetic operator to apply.
|
Enumeration | ADD | ||||||||||||||
outputImage |
The output image.
The output image dimensions are forced to the same values as the inputs. The output image type is deduced from the inputs. |
Image | nullptr |
Object Examples
std::shared_ptr< iolink::ImageView > polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" ); ArithmeticOperationWithImage arithmeticOperationWithImageAlgo; arithmeticOperationWithImageAlgo.setInputImage1( polystyrene ); arithmeticOperationWithImageAlgo.setInputImage2( polystyrene ); arithmeticOperationWithImageAlgo.setArithmeticOperator( ArithmeticOperationWithImage::ArithmeticOperator::ADD ); arithmeticOperationWithImageAlgo.execute(); std::cout << "outputImage:" << arithmeticOperationWithImageAlgo.outputImage()->toString();
Function Examples
std::shared_ptr< iolink::ImageView > polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" ); auto result = arithmeticOperationWithImage( polystyrene, polystyrene, ArithmeticOperationWithImage::ArithmeticOperator::ADD ); std::cout << "outputImage:" << result->toString();