ImageDev

BlendWithImage

Produces a linear combination between two images.

Access to parameter description

The formula applied between both input images $I_1$ and $I_2$ is: $$ O(n,m)=\left[\lambda I_1(n,m)+(100-\lambda)I_2(n,m)\right]/100 $$ See also

Function Syntax

This function returns the outputImage output parameter.
// Function prototype.
std::shared_ptr< iolink::ImageView >
blendWithImage( std::shared_ptr< iolink::ImageView > inputImage1,
                std::shared_ptr< iolink::ImageView > inputImage2,
                double weight,
                std::shared_ptr< iolink::ImageView > outputImage = NULL );
This function returns the outputImage output parameter.
// Function prototype.
blend_with_image( input_image1,
                  input_image2,
                  weight = 60,
                  output_image = None )
This function returns the outputImage output parameter.
// Function prototype.
public static IOLink.ImageView
BlendWithImage( IOLink.ImageView inputImage1,
                IOLink.ImageView inputImage2,
                double weight = 60,
                IOLink.ImageView outputImage = null );

Class Syntax

Parameters

Class Name BlendWithImage

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 (must have the same dimensions as the first input). Image Binary, Label, Grayscale or Multispectral nullptr
input
weight
The percentage of the first image intensity. Float64 Any value 60
output
outputImage
The output image. Image nullptr

Object Examples

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

BlendWithImage blendWithImageAlgo;
blendWithImageAlgo.setInputImage1( foam );
blendWithImageAlgo.setInputImage2( foam );
blendWithImageAlgo.setWeight( 60.0 );
blendWithImageAlgo.execute();

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

blend_with_image_algo = imagedev.BlendWithImage()
blend_with_image_algo.input_image1 = foam
blend_with_image_algo.input_image2 = foam
blend_with_image_algo.weight = 60.0
blend_with_image_algo.execute()

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

BlendWithImage blendWithImageAlgo = new BlendWithImage
{
    inputImage1 = foam,
    inputImage2 = foam,
    weight = 60.0
};
blendWithImageAlgo.Execute();

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

Function Examples

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

auto result = blendWithImage( foam, foam, 60.0 );

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

result = imagedev.blend_with_image( foam, foam, 60.0 )

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

IOLink.ImageView result = Processing.BlendWithImage( foam, foam, 60.0 );

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