Processing math: 100%
ImageDev

CombineByMask

Produces a combination of two images in a complementary way.

Access to parameter description

CombineByMask produces an output image O which is the combination of two images I1 and I2 by following a binary mask B as follows:
O(n,m)={I1(n,m) if B(n,m)=1I2(n,m) if B(n,m)=0 See also

Function Syntax

This function returns outputImage.
// Function prototype
std::shared_ptr< iolink::ImageView > combineByMask( std::shared_ptr< iolink::ImageView > inputImage1, std::shared_ptr< iolink::ImageView > inputImage2, std::shared_ptr< iolink::ImageView > inputBinaryImage, std::shared_ptr< iolink::ImageView > outputImage = NULL );

Class Syntax

Parameters

Parameter Name Description Type Supported Values Default Value
input
inputImage1
The first input image. Image Binary, Label, Grayscale or Multispectral nullptr
input
inputImage2
The second input image. It must have same dimensions and type as other input images. Image Binary, Label, Grayscale or Multispectral nullptr
input
inputBinaryImage
The input binary mask. It must have same dimensions and type as other input images. Image Binary nullptr
output
outputImage
The output image. Its dimensions and type are forced to the same values as the inputs. Image nullptr

Object Examples

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

CombineByMask combineByMaskAlgo;
combineByMaskAlgo.setInputImage1( foam );
combineByMaskAlgo.setInputImage2( foam );
combineByMaskAlgo.setInputBinaryImage( foam_sep );
combineByMaskAlgo.execute();

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

Function Examples

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

auto result = combineByMask( foam, foam, foam_sep );

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