FormXStabilizer

public class FormXStabilizer

FormXStabilizer stabilizes the FormXDocumentRegion returned from FormXDocumentDetector to prevent shaking. It also filters out the invalid FormXDocumentRegion.

When the detected region is stable, it will change its state to ReadyToCapture to inform the caller that it is ready to capture the image.

  • The smoothed region

    Declaration

    Swift

    public var smoothedRegion: FormXRegion?
  • The sliding window size

    Declaration

    Swift

    public var slidingWindowSize: Int
  • The threshold to determine if the region is stable

    Declaration

    Swift

    public var steadyThreadhold: Double
  • The threshold to determine if the region is empty

    Declaration

    Swift

    public var resetThreshold: Int
  • The minimum time required to change stabilizer state (seconds)

    Declaration

    Swift

    public var stateChangeTimeout: Double
  • The state of the stabilizer

    Declaration

    Swift

    public var state: FormXStabilizerState
  • Initialize a FormXStabilizer

    Declaration

    Swift

    public init()
  • Reset the stabilizer

    Declaration

    Swift

    public func reset()
  • Update the stabilizer with the FormXDocumentRegion. It will change the state of the stabilizer and calculcate the smoothed region.

    Declaration

    Swift

    public func update(region: FormXDocumentRegion?)

    Parameters

    region

    The FormXDocumentRegion to be updated