Class CutoutAverage
Maintains a rolling average of detected cutout points to smooth document boundaries between frames.
Namespace: ImageSdkWrapper Assembly: ImageSdkWrapper.MAUI
Inheritance: object
public class CutoutAverage : IDisposable
Constructor
CutoutAverage(int, int)
Initializes the average calculator for the desired algorithm.
public CutoutAverage(int type, int slidingLength)
Parameters
type(int): One of the Type values.slidingLength(int): Window size used by the native algorithm.
Field
SLIDING
Convenience constant for SLIDING.
public const int SLIDING = 0
Returns
- int
WEIGHTED
Convenience constant for WEIGHTED.
public const int WEIGHTED = 1
Returns
- int
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)
Parameters
points(PxlPointF[]): Polygon points to incorporate.
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)
Parameters
scale(int): Scaling factor expected by the native API.
Returns
- int: Fullness score returned by the SDK.
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)
Parameters
duplicate(bool): Whentrue, the native handle preserves a duplicate of the last cutout.
Property
Average
Gets the current averaged polygon from the native handle, or null if no points have been accumulated.
public PxlPointF[] Average { get; }
Returns
- PxlPointF[]