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 | |
|---|---|---|---|---|---|
![]() |
inImage | Image | Input image | ||
![]() |
inQuadrangle | Path | Rectangle defining a rotated subimage | ||
![]() |
inQuadrangleAlignment | CoordinateSystem2D | None | None | Adjusts the rectangle to the position of the inspected object | |
![]() |
inOutputSize | Size | None | None | Dimensions of the output image | |
![]() |
inInterpolationMethod | InterpolationMethod | InterpolationMethod.Bilinear | ||
![]() |
inMargin | int | 0 - 65535 | Width of an additional margin for the output image | |
![]() |
inBorderColor | Pixel | Pixel(0, 0, 0, 0) | Color used for locations outside the quadrangle | |
![]() |
outImage | Image | Output image | ||
![]() |
outAlignedQuadrangle | Path | None | None | Input quadrangle after transformation (in the image coordinates) |


