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 | |
---|---|---|---|---|---|
inImage | const Image& | Input image | |||
inQuadrangle | const Path& | Rectangle defining a rotated subimage | |||
inQuadrangleAlignment | Optional<const CoordinateSystem2D&> | NIL | Adjusts the rectangle to the position of the inspected object | ||
inOutputSize | Optional<const Size&> | NIL | Dimensions of the output image | ||
inInterpolationMethod | InterpolationMethod::Type | Bilinear | |||
inMargin | int | 0 - 65535 | Width of an additional margin for the output image | ||
inBorderColor | const Pixel& | Color used for locations outside the quadrangle | |||
outImage | Image& | Output image | |||
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. |