Relative distortion limit allowed for quadrilaterals, [0.0, 0.25].

Namespace:  AForge.Math.Geometry
Assembly:  AForge.Math (in AForge.Math.dll) Version: 2.2.5.0 (2.2.5.0)

# Syntax

C#
`public static float QuadrilateralRelativeDistortionLimit { get; set; }`

# Remarks

The value of this property is used to calculate distortion limit used by FindQuadrilateralCorners(IEnumerable<(Of <(IntPoint>)>)), when processing potential corners and making decision if the provided points form a quadrilateral or a triangle. The distortion limit is calculated as:

Copy
`distrtionLimit = RelativeDistortionLimit * ( W * H ) / 2,`
where W and H are width and height of the "points cloud" passed to the FindQuadrilateralCorners(IEnumerable<(Of <(IntPoint>)>)).

To explain the idea behind distortion limit, let’s suppose that quadrilateral finder routine found the next candidates for corners:

As we can see on the above picture, the shape there potentially can be a triangle, but not quadrilateral (suppose that points list comes from a hand drawn picture or acquired from camera, so some inaccuracy may exist). It may happen that the D point is just a distortion (noise, etc). So the FindQuadrilateralCorners(IEnumerable<(Of <(IntPoint>)>)) check what is the distance between a potential corner (D in this case) and a line connecting two adjacent points (AB in this case). If the distance is smaller then the distortion limit, then the point may be rejected, so the shape turns into triangle.

An exception is the case when both C and D points are very close to the AB line, so both their distances are less than distortion limit. In this case both points will be accepted as corners - the shape is just a flat quadrilateral.

Default value is set to 0.1.