z

Class CutoutAverage

Maintains a rolling average of detected cutout points to smooth document boundaries between frames.

public class CutoutAverage : IDisposable

Constructor

CutoutAverage(int, int)

Initializes the average calculator for the desired algorithm.

public CutoutAverage(int type, int slidingLength)

Field

SLIDING

Convenience constant for SLIDING.

public const int SLIDING = 0

WEIGHTED

Convenience constant for WEIGHTED.

public const int WEIGHTED = 1

Method

Append(PxlPointF[])

Appends a new polygon to the average. Passing null or an empty array initialises the handle without updating the average.

public void Append(PxlPointF[] points)

Dispose()

Releases the native average handle.

public void Dispose()

Duplicate()

Clones the current state inside the native handle, effectively doubling the sliding window.

public void Duplicate()

Fullness(int)

Calculates the detection fullness metric using the specified normalisation scale.

public int Fullness(int scale)

Remove()

Removes the oldest values from the average by signalling the native handle with an empty append.

public void Remove()

Reset(bool)

Resets the average, optionally seeding it with the current state.

public void Reset(bool duplicate)

Property

Average

Gets the current averaged polygon from the native handle, or null if no points have been accumulated.

public PxlPointF[] Average { get; }
Top