C# Class Accord.Imaging.Filters.Blend

Linear Gradient Blending filter.

The blending filter is able to blend two images using a homography matrix. A linear alpha gradient is used to smooth out differences between the two images, effectively blending them in two images. The gradient is computed considering the distance between the centers of the two images.

The first image should be passed at the moment of creation of the Blending filter as the overlay image. A second image may be projected on top of the overlay image by calling the Apply method and passing the second image as argument.

Currently the filter always produces 32bpp images, disregarding the format of source images. The alpha layer is used as an intermediate mask in the blending process.

Inheritance: BaseTransformationFilter
Show file Open project: accord-net/framework Class Usage Examples

Public Methods

Method Description
Blend ( Bitmap overlayImage ) : System

Constructs a new Blend filter.

Blend ( MatrixH homography, Bitmap overlayImage ) : System

Constructs a new Blend filter.

Blend ( double homography, Bitmap overlayImage ) : System

Constructs a new Blend filter.

Protected Methods

Method Description
CalculateNewImageSize ( UnmanagedImage sourceData ) : Size

Computes the new image size.

ProcessFilter ( UnmanagedImage sourceData, UnmanagedImage destinationData ) : void

Process the image filter.

Private Methods

Method Description
distance ( float x1, float y1, float x2, float y2 ) : float

Computes a distance metric used to compute the blending mask

Method Details

Blend() public method

Constructs a new Blend filter.
public Blend ( Bitmap overlayImage ) : System
overlayImage System.Drawing.Bitmap The overlay image (also called the anchor).
return System

Blend() public method

Constructs a new Blend filter.
public Blend ( MatrixH homography, Bitmap overlayImage ) : System
homography Accord.Imaging.MatrixH The homography matrix mapping a second image to the overlay image.
overlayImage System.Drawing.Bitmap The overlay image (also called the anchor).
return System

Blend() public method

Constructs a new Blend filter.
public Blend ( double homography, Bitmap overlayImage ) : System
homography double The homography matrix mapping a second image to the overlay image.
overlayImage System.Drawing.Bitmap The overlay image (also called the anchor).
return System

CalculateNewImageSize() protected method

Computes the new image size.
protected CalculateNewImageSize ( UnmanagedImage sourceData ) : Size
sourceData Accord.Imaging.UnmanagedImage
return System.Drawing.Size

ProcessFilter() protected method

Process the image filter.
protected ProcessFilter ( UnmanagedImage sourceData, UnmanagedImage destinationData ) : void
sourceData Accord.Imaging.UnmanagedImage
destinationData Accord.Imaging.UnmanagedImage
return void