You are here: Start » AVL.NET » AVL.CreatePerspectiveMap_Points(AvlNet.ImageFormat, AvlNet.Region, AvlNet.Point2D[], AvlNet.Point2D[], AvlNet.Size?, AvlNet.InterpolationMethod, AvlNet.SpatialMap, AvlNet.Matrix)

AVL.CreatePerspectiveMap_Points(AvlNet.ImageFormat, AvlNet.Region, AvlNet.Point2D[], AvlNet.Point2D[], AvlNet.Size?, AvlNet.InterpolationMethod, AvlNet.SpatialMap, AvlNet.Matrix)

Namespace:AvlNet
Assembly:AVL.NET.dll

Syntax


public static void CreatePerspectiveMap_Points(
	AvlNet.ImageFormat inImageFormat,
	AvlNet.Region inRoi,
	AvlNet.Point2D[] inImagePoints,
	AvlNet.Point2D[] inTargetPoints,
	AvlNet.Size? inNewSize,
	AvlNet.InterpolationMethod inInterpolationMethod,
	out AvlNet.SpatialMap outSpatialMap,
	out AvlNet.Matrix outTransformMatrix
)

Parameters

inImageFormat
Type: AvlNet.ImageFormat
inRoi
Type: AvlNet.Region
inImagePoints
Type: AvlNet.Point2D
inTargetPoints
Type: AvlNet.Point2D
inNewSize
Type: System.Nullable<AvlNet.Size>
inInterpolationMethod
Type: AvlNet.InterpolationMethod
outSpatialMap
Type: AvlNet.SpatialMap
outTransformMatrix
Type: AvlNet.Matrix

Description

This operation computes a SpatialMap which can be later used for removing a perspective distortion from an image.

The operation maps the input image points (inImagePoints) onto locations described by the target points (inTargetPoints). If the inTargetPoints input is set to Auto this array will be made from the corner points of the input image. Both array must contains four points.

The input inNewSize allows rescaling of the output image.

The inImageFormat format is necessary for preparation of a spatial map.

The outTransformMatrix output allows verifying the found transformation.

For more information about distortion removal please refer to: Machine Vision Guide - Camera Calibration

Examples

Image before and after the perspective transform created by CreatePerspectiveMap_Path.

Remarks

Notice that both inImagePoints array and inTargetPoints must be made of four points. This filter creates point to point transform so changing the points' order in the array may yield an unexpected result.

The best way to understand the relation between inImagePoints and inTargetPoints is to present the first of them on the input image and the second on the background of the remapped image.

The image before remapping on the left (with inImagePoints) and the image after on the right (with inTargetPoints) created by CreatePerspectiveMap_Path.

Errors

Error type Description
DomainError Each of input array must contain four points in CreatePerspectiveMap_Points

See also