You are here: Start » AVL.NET » AVL.CreatePerspectiveMap_Path(AvlNet.ImageFormat, AvlNet.Region, AvlNet.Path, AvlNet.Path, AvlNet.Size?, AvlNet.InterpolationMethod, AvlNet.SpatialMap, AvlNet.Matrix)

AVL.CreatePerspectiveMap_Path(AvlNet.ImageFormat, AvlNet.Region, AvlNet.Path, AvlNet.Path, AvlNet.Size?, AvlNet.InterpolationMethod, AvlNet.SpatialMap, AvlNet.Matrix)

Namespace:AvlNet
Assembly:AVL.NET.dll

Syntax


public static void CreatePerspectiveMap_Path(
	AvlNet.ImageFormat inImageFormat,
	AvlNet.Region inRoi,
	AvlNet.Path inImagePath,
	AvlNet.Path inTargetPath,
	AvlNet.Size? inNewSize,
	AvlNet.InterpolationMethod inInterpolationMethod,
	out AvlNet.SpatialMap outSpatialMap,
	out AvlNet.Matrix outTransformMatrix
)

Parameters

inImageFormat
Type: AvlNet.ImageFormat
inRoi
Type: AvlNet.Region
inImagePath
Type: AvlNet.Path
inTargetPath
Type: AvlNet.Path
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 path (inImagePath) into the target path (inTargetPath). If the inTargetPath input is set to Auto this path will be made from the corner points of the input image. Both paths must be closed and must be made of 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 inImagePath path and inTargetPath must be made of four points. This filter creates point to point transform so the changing points order in paths may yield an unexpected result.

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

The image before remapping on the left (with inImagePath) and the image after on the right (with inTargetPath).

Errors

Error type Description
DomainError inImagePath input must contain a closed path created from 4 points in CreatePerspectiveMap_Path.
DomainError inTargetPath input must contain a closed path created from 4 points in CreatePerspectiveMap_Path.

See also