ImageDev

BlendWithValue

Produces a linear combination between an image and a constant value.

Access to parameter description

The formula applied between the input image $I$ and the constant $C$ is: $$ O(n,m)=\left[\lambda I(n,m)+(100-\lambda)C\right]/100 $$ See also

Function Syntax

This function returns outputImage.
// Function prototype
std::shared_ptr< iolink::ImageView > blendWithValue( std::shared_ptr< iolink::ImageView > inputImage, int32_t value, double weight, std::shared_ptr< iolink::ImageView > outputImage = nullptr );
This function returns outputImage.
// Function prototype.
blend_with_value(input_image: idt.ImageType,
                 value: int = 4,
                 weight: float = 60,
                 output_image: idt.ImageType = None) -> idt.ImageType
This function returns outputImage.
// Function prototype.
public static IOLink.ImageView
BlendWithValue( IOLink.ImageView inputImage,
                Int32 value = 4,
                double weight = 60,
                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
value
The constant value. Int32 Any value 4
input
weight
The percentage of the input image intensity. Float64 Any value 60
output
outputImage
The output image. Image nullptr
Parameter Name Description Type Supported Values Default Value
input
input_image
The input image. image Binary, Label, Grayscale or Multispectral None
input
value
The constant value. int32 Any value 4
input
weight
The percentage of the input image intensity. float64 Any value 60
output
output_image
The output image. image None
Parameter Name Description Type Supported Values Default Value
input
inputImage
The input image. Image Binary, Label, Grayscale or Multispectral null
input
value
The constant value. Int32 Any value 4
input
weight
The percentage of the input image intensity. Float64 Any value 60
output
outputImage
The output image. Image null

Object Examples

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

BlendWithValue blendWithValueAlgo;
blendWithValueAlgo.setInputImage( foam );
blendWithValueAlgo.setValue( 4 );
blendWithValueAlgo.setWeight( 60.0 );
blendWithValueAlgo.execute();

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

blend_with_value_algo = imagedev.BlendWithValue()
blend_with_value_algo.input_image = foam
blend_with_value_algo.value = 4
blend_with_value_algo.weight = 60.0
blend_with_value_algo.execute()

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

BlendWithValue blendWithValueAlgo = new BlendWithValue
{
    inputImage = foam,
    value = 4,
    weight = 60.0
};
blendWithValueAlgo.Execute();

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

Function Examples

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

auto result = blendWithValue( foam, 4, 60.0 );

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

result = imagedev.blend_with_value(foam, 4, 60.0)

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

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

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