C# Class AForge.Imaging.Filters.BackwardQuadrilateralTransformation

Performs backward quadrilateral transformation into an area in destination image.

The class implements backward quadrilateral transformation algorithm, which allows to transform any rectangular image into any quadrilateral area in a given destination image. The idea of the algorithm is based on homogeneous transformation and its math is described by Paul Heckbert in his "Projective Mappings for Image Warping" paper.

The image processing routines implements similar math to QuadrilateralTransformation, but performs it in backward direction.

The image processing filter accepts 8 grayscale images and 24/32 bpp color images for processing.

Sample usage:

// define quadrilateral's corners List<IntPoint> corners = new List<IntPoint>( ); corners.Add( new IntPoint( 99, 99 ) ); corners.Add( new IntPoint( 156, 79 ) ); corners.Add( new IntPoint( 184, 126 ) ); corners.Add( new IntPoint( 122, 150 ) ); // create filter BackwardQuadrilateralTransformation filter = new BackwardQuadrilateralTransformation( sourceImage, corners ); // apply the filter Bitmap newImage = filter.Apply( image );

Source image:

Destination image:

Result image:

Inheritance: BaseInPlaceFilter
Mostrar archivo Open project: holisticware-admin/MonoVersal.AForgeNET Class Usage Examples

Public Methods

Method Description
BackwardQuadrilateralTransformation ( ) : System

Initializes a new instance of the BackwardQuadrilateralTransformation class.

BackwardQuadrilateralTransformation ( Bitmap sourceImage ) : System

Initializes a new instance of the BackwardQuadrilateralTransformation class.

BackwardQuadrilateralTransformation ( Bitmap sourceImage, List destinationQuadrilateral ) : System

Initializes a new instance of the BackwardQuadrilateralTransformation class.

BackwardQuadrilateralTransformation ( UnmanagedImage sourceUnmanagedImage ) : System

Initializes a new instance of the BackwardQuadrilateralTransformation class.

BackwardQuadrilateralTransformation ( UnmanagedImage sourceUnmanagedImage, List destinationQuadrilateral ) : System

Initializes a new instance of the BackwardQuadrilateralTransformation class.

Protected Methods

Method Description
ProcessFilter ( UnmanagedImage image ) : void

Process the filter on the specified image.

Private Methods

Method Description
ProcessFilter ( UnmanagedImage dstImage, UnmanagedImage srcImage ) : void

Method Details

BackwardQuadrilateralTransformation() public method

Initializes a new instance of the BackwardQuadrilateralTransformation class.
public BackwardQuadrilateralTransformation ( ) : System
return System

BackwardQuadrilateralTransformation() public method

Initializes a new instance of the BackwardQuadrilateralTransformation class.
public BackwardQuadrilateralTransformation ( Bitmap sourceImage ) : System
sourceImage System.Drawing.Bitmap Source image to be transformed into specified quadrilateral /// (see ).
return System

BackwardQuadrilateralTransformation() public method

Initializes a new instance of the BackwardQuadrilateralTransformation class.
public BackwardQuadrilateralTransformation ( Bitmap sourceImage, List destinationQuadrilateral ) : System
sourceImage System.Drawing.Bitmap Source image to be transformed into specified quadrilateral /// (see ).
destinationQuadrilateral List Quadrilateral in destination image to transform into.
return System

BackwardQuadrilateralTransformation() public method

Initializes a new instance of the BackwardQuadrilateralTransformation class.
public BackwardQuadrilateralTransformation ( UnmanagedImage sourceUnmanagedImage ) : System
sourceUnmanagedImage UnmanagedImage Source unmanaged image to be transformed into specified quadrilateral /// (see ).
return System

BackwardQuadrilateralTransformation() public method

Initializes a new instance of the BackwardQuadrilateralTransformation class.
public BackwardQuadrilateralTransformation ( UnmanagedImage sourceUnmanagedImage, List destinationQuadrilateral ) : System
sourceUnmanagedImage UnmanagedImage Source unmanaged image to be transformed into specified quadrilateral /// (see ).
destinationQuadrilateral List Quadrilateral in destination image to transform into.
return System

ProcessFilter() protected method

Process the filter on the specified image.
Destination quadrilateral was not set.
protected ProcessFilter ( UnmanagedImage image ) : void
image UnmanagedImage Image data to process by the filter.
return void