CropImageToQuadrangle


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#
Python
 
def CropImageToQuadrangle(
	inImage: Image,
	inQuadrangle: Path,
	inMargin: int,
	outImage: Image,
	/,
	*,
	inQuadrangleAlignment: CoordinateSystem2D | None = None,
	inOutputSize: Size | None = None,
	inInterpolationMethod: InterpolationMethod = InterpolationMethod.Bilinear,
	inBorderColor: Pixel = Pixel(0, 0, 0, 0),
	outAlignedQuadrangle: Path | None = None
)
-> None

Parameters

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