Back to FabImage Library website

You are here: Start » Function Reference » Image Spatial Transforms Maps » CreatePerspectiveMap_Points

CreatePerspectiveMap_Points


Header:FIL.h
Namespace:fil

Creates a perspective transform map from four points denoting a rectangle in the world coordinates.

Syntax

C++
C#
 
void fil::CreatePerspectiveMap_Points
(
	const fil::ImageFormat& inImageFormat,
	ftl::Optional<const fil::Region&> inRoi,
	const ftl::Array<fil::Point2D>& inImagePoints,
	ftl::Optional<const ftl::Array<fil::Point2D>&> inTargetPoints,
	ftl::Optional<const fil::Size&> inNewSize,
	const fil::InterpolationMethod::Type inInterpolationMethod,
	fil::SpatialMap& outSpatialMap,
	fil::Matrix& outTransformMatrix
)

Parameters

Name Type Default Description
inImageFormat const ImageFormat&
inRoi Optional<const Region&> NIL Range of pixels to be processed
inImagePoints const Array<Point2D>& Points define real object plane corners.
inTargetPoints Optional<const Array<Point2D>&> NIL Points define target plane corners. If NIL then image corners are used starting from (0,0) (Width, 0) (Width, Height), (0, Height)
inNewSize Optional<const Size&> NIL New image size after remapping
inInterpolationMethod const InterpolationMethod::Type Interpolation method used in extraction of image pixel values
outSpatialMap SpatialMap& Created SpatialMap with perspective transform
outTransformMatrix Matrix& Used transform matrix

Remarks

This filter is a good choice for local perspective distortion removal - such as "unwrapping" boxes, as is depicted by the example above. Applications concerned with observing real-world flat surfaces (such as observing conveyor belts) should use methods that are more accurate. Please refer to: Machine Vision Guide - Camera Calibration and World Coordinates

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.

Errors

List of possible exceptions:

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

See Also

  • RemapImage – Applies a precomputed image transform, defined by a spatial map object.