Back to Adaptive Vision Library website

You are here: Start » Function Reference » Region » Region Spatial Transforms » CropRegionToQuadrangle

CropRegionToQuadrangle


Header: AVL.h
Namespace: avl
Module: FoundationPro

Creates a region from a quadrangular fragment of another one. The quadrangle must be convex.

Syntax

C++
C#
 
void avl::CropRegionToQuadrangle
(
	const avl::Region& inRegion,
	const avl::Path& inQuadrangle,
	atl::Optional<const avl::Size&> inOutputSize,
	atl::Optional<const avl::CoordinateSystem2D&> inQuadrangleAlignment,
	avl::Region& outRegion,
	atl::Optional<avl::Path&> outAlignedShape = atl::NIL
)

Parameters

Name Type Default Description
inRegion const Region& Input region
inQuadrangle const Path& A convex quadrangle defining a region to be cropped (points must be clockwise)
inOutputSize Optional<const Size&> NIL Width and height of the output region
inQuadrangleAlignment Optional<const CoordinateSystem2D&> NIL Adjusts the quadrangle to the position of the inspected object
outRegion Region& Output region
outAlignedShape Optional<Path&> NIL The input quadrangle after transformation (in the region coordinates)

In-place Processing

This function supports in-place data processing - you can pass the same reference to inRegion and outRegion

Read more about In-place Computation.

Optional Outputs

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

Read more about Optional Outputs.

Errors

List of possible exceptions:

Error type Description
DomainError Path given as an argument to CropRegionToQuadrangle is not closed.
DomainError Path given as an argument to CropRegionToQuadrangle should have exactly 4 points.