ImageDev

DirectionalBlending2d

Combines two images following a direction axis.

Access to parameter description

This algorithm may be very useful in stitching operations in order to manage the overlapping areas.
Remarks: Both input images must have the same dimensions.

See also

Function Syntax

This function returns outputImage.
// Function prototype
std::shared_ptr< iolink::ImageView > directionalBlending2d( std::shared_ptr< iolink::ImageView > inputImage1, std::shared_ptr< iolink::ImageView > inputImage2, DirectionalBlending2d::Axis axis, std::shared_ptr< iolink::ImageView > outputImage = NULL );
This function returns outputImage.
// Function prototype.
directional_blending_2d( input_image1,
                         input_image2,
                         axis = DirectionalBlending2d.Axis.X_AXIS,
                         output_image = None )
This function returns outputImage.
// Function prototype.
public static IOLink.ImageView
DirectionalBlending2d( IOLink.ImageView inputImage1,
                       IOLink.ImageView inputImage2,
                       DirectionalBlending2d.Axis axis = ImageDev.DirectionalBlending2d.Axis.X_AXIS,
                       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 (must have same dimensions and type as the first input). Image Binary, Label, Grayscale or Multispectral nullptr
input
axis
The guiding axis to perform the blending.
X_AXIS The blending is performed along the horizontal axis.
  • The first column of the output image is filled with 100% of the first input image intensities.
  • The last column of the output image is filled with 100% of the second input image intensities.
  • The middle column of the output image is filled with 50% of the first input and 50% of the second input image intensities.
  • Other columns are filled by a linear combination of both input image intensities.
  • Y_AXIS The blending is performed along the vertical axis.
  • The first row of the output image is filled with 100% of the first input image intensities.
  • The last row of the output image is filled with 100% of the second input image intensities.
  • The middle row of the output image is filled with 50% of the first input and 50% of the second input image intensities.
  • Other rows are filled by a linear combination of both input image intensities.
  • Enumeration X_AXIS
    output
    outputImage
    The output image. Its dimensions and type are forced to the same values as the inputs. Image nullptr
    Parameter Name Description Type Supported Values Default Value
    input
    input_image1
    The first input image. image Binary, Label, Grayscale or Multispectral None
    input
    input_image2
    The second input image (must have same dimensions and type as the first input). image Binary, Label, Grayscale or Multispectral None
    input
    axis
    The guiding axis to perform the blending.
    X_AXIS The blending is performed along the horizontal axis.
  • The first column of the output image is filled with 100% of the first input image intensities.
  • The last column of the output image is filled with 100% of the second input image intensities.
  • The middle column of the output image is filled with 50% of the first input and 50% of the second input image intensities.
  • Other columns are filled by a linear combination of both input image intensities.
  • Y_AXIS The blending is performed along the vertical axis.
  • The first row of the output image is filled with 100% of the first input image intensities.
  • The last row of the output image is filled with 100% of the second input image intensities.
  • The middle row of the output image is filled with 50% of the first input and 50% of the second input image intensities.
  • Other rows are filled by a linear combination of both input image intensities.
  • enumeration X_AXIS
    output
    output_image
    The output image. Its dimensions and type are forced to the same values as the inputs. image None
    Parameter Name Description Type Supported Values Default Value
    input
    inputImage1
    The first input image. Image Binary, Label, Grayscale or Multispectral null
    input
    inputImage2
    The second input image (must have same dimensions and type as the first input). Image Binary, Label, Grayscale or Multispectral null
    input
    axis
    The guiding axis to perform the blending.
    X_AXIS The blending is performed along the horizontal axis.
  • The first column of the output image is filled with 100% of the first input image intensities.
  • The last column of the output image is filled with 100% of the second input image intensities.
  • The middle column of the output image is filled with 50% of the first input and 50% of the second input image intensities.
  • Other columns are filled by a linear combination of both input image intensities.
  • Y_AXIS The blending is performed along the vertical axis.
  • The first row of the output image is filled with 100% of the first input image intensities.
  • The last row of the output image is filled with 100% of the second input image intensities.
  • The middle row of the output image is filled with 50% of the first input and 50% of the second input image intensities.
  • Other rows are filled by a linear combination of both input image intensities.
  • Enumeration X_AXIS
    output
    outputImage
    The output image. Its dimensions and type are forced to the same values as the inputs. Image null

    Object Examples

    std::shared_ptr< iolink::ImageView > polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" );
    
    DirectionalBlending2d directionalBlending2dAlgo;
    directionalBlending2dAlgo.setInputImage1( polystyrene );
    directionalBlending2dAlgo.setInputImage2( polystyrene );
    directionalBlending2dAlgo.setAxis( DirectionalBlending2d::Axis::X_AXIS );
    directionalBlending2dAlgo.execute();
    
    std::cout << "outputImage:" << directionalBlending2dAlgo.outputImage()->toString();
    
    polystyrene = ioformat.read_image(imagedev_data.get_image_path("polystyrene.tif"))
    
    directional_blending_2d_algo = imagedev.DirectionalBlending2d()
    directional_blending_2d_algo.input_image1 = polystyrene
    directional_blending_2d_algo.input_image2 = polystyrene
    directional_blending_2d_algo.axis = imagedev.DirectionalBlending2d.X_AXIS
    directional_blending_2d_algo.execute()
    
    print( "output_image:", str( directional_blending_2d_algo.output_image ) )
    
    ImageView polystyrene = ViewIO.ReadImage( @"Data/images/polystyrene.tif" );
    
    DirectionalBlending2d directionalBlending2dAlgo = new DirectionalBlending2d
    {
        inputImage1 = polystyrene,
        inputImage2 = polystyrene,
        axis = DirectionalBlending2d.Axis.X_AXIS
    };
    directionalBlending2dAlgo.Execute();
    
    Console.WriteLine( "outputImage:" + directionalBlending2dAlgo.outputImage.ToString() );
    

    Function Examples

    std::shared_ptr< iolink::ImageView > polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" );
    
    auto result = directionalBlending2d( polystyrene, polystyrene, DirectionalBlending2d::Axis::X_AXIS );
    
    std::cout << "outputImage:" << result->toString();
    
    polystyrene = ioformat.read_image(imagedev_data.get_image_path("polystyrene.tif"))
    
    result = imagedev.directional_blending_2d( polystyrene, polystyrene, imagedev.DirectionalBlending2d.X_AXIS )
    
    print( "output_image:", str( result ) )
    
    ImageView polystyrene = ViewIO.ReadImage( @"Data/images/polystyrene.tif" );
    
    IOLink.ImageView result = Processing.DirectionalBlending2d( polystyrene, polystyrene, DirectionalBlending2d.Axis.X_AXIS );
    
    Console.WriteLine( "outputImage:" + result.ToString() );