Back to Aurora Vision Library website

You are here: Start » Function Reference » Image » Image Spatial Transforms » CropImageToQuadrangle

CropImageToQuadrangle


Header: AVL.h
Namespace: avl
Module: FoundationPro

Creates an image from a quadrangle on another image.

Applications: Can be used for cropping an image from a slightly distorted rectangle. Do not use it for perspective distortion though.

Syntax

C++
C#
 
void avl::CropImageToQuadrangle
(
	const avl::Image& inImage,
	const avl::Path& inQuadrangle,
	atl::Optional<const avl::CoordinateSystem2D&> inQuadrangleAlignment,
	atl::Optional<const avl::Size&> inOutputSize,
	avl::InterpolationMethod::Type inInterpolationMethod,
	int inMargin,
	const avl::Pixel& inBorderColor,
	avl::Image& outImage,
	atl::Optional<avl::Path&> outAlignedQuadrangle = atl::NIL
)

Parameters

Name Type Range Default Description
Input value inImage const Image& Input image
Input value inQuadrangle const Path& Rectangle defining a rotated subimage
Input value inQuadrangleAlignment Optional<const CoordinateSystem2D&> NIL Adjusts the rectangle to the position of the inspected object
Input value inOutputSize Optional<const Size&> NIL Dimensions of the output image
Input value inInterpolationMethod InterpolationMethod::Type Bilinear
Input value inMargin int 0 - 65535 Width of an additional margin for the output image
Input value inBorderColor const Pixel& Color used for locations outside the quadrangle
Output value outImage Image& Output image
Output value outAlignedQuadrangle Optional<Path&> NIL Input quadrangle after transformation (in the image coordinates)

Optional Outputs

The computation of following outputs can be switched off by passing value atl::NIL to these parameters: outAlignedQuadrangle.

Read more about Optional Outputs.

Errors

List of possible exceptions:

Error type Description
DomainError Quadrangle should be specified by a closed path with exactly 4 points in CropImageToQuadrangle.