SBSDKDocumentDetectionMetrics

@interface SBSDKDocumentDetectionMetrics : NSObject <NSCopying>

The metrics and additional properties returned by ‘SBSDKDocumentDetector’. Can be used to make decisions on polygon acceptance, automatic capturing and user guidance.

  • The total score of the detected polygon (0 - 100).

    Declaration

    Objective-C

    @property (readonly, atomic) double totalScore;

    Swift

    var totalScore: Double { get }
  • The size score of the detected polygon (0 - 100). Part of the total score.

    Declaration

    Objective-C

    @property (readonly, atomic) double sizeScore;

    Swift

    var sizeScore: Double { get }
  • The width score of the detected polygon (0 - 100). Part of the size score.

    Declaration

    Objective-C

    @property (readonly, atomic) double widthScore;

    Swift

    var widthScore: Double { get }
  • The height score of the detected polygon (0 - 100). Part of the size score.

    Declaration

    Objective-C

    @property (readonly, atomic) double heightScore;

    Swift

    var heightScore: Double { get }
  • The angles score of the detected polygon (0 - 100). Part of the total score.

    Declaration

    Objective-C

    @property (readonly, atomic) double angleScore;

    Swift

    var angleScore: Double { get }
  • The distance-from-center score of the detected polygon (0 - 100). Part of the total score.

    Declaration

    Objective-C

    @property (readonly, atomic) double distanceScore;

    Swift

    var distanceScore: Double { get }
  • The unwarped aspect ratio of the detected polygon or -1, if no polygon was detected.

    Declaration

    Objective-C

    @property (readonly, nonatomic) double unwarpedAspectRatio;

    Swift

    var unwarpedAspectRatio: Double { get }
  • Returns YES, if the given aspect ratio matches the receivers unwarpedAspectRatio in a fuzzy way. *

    Declaration

    Objective-C

    - (BOOL)matchesAspectRatio:(nonnull SBSDKPageAspectRatio *)aspectRatio;

    Swift

    func matchesAspectRatio(_ aspectRatio: SBSDKPageAspectRatio) -> Bool
  • Returns the index of a matching aspect ratio in the given list of aspect ratios, or NSNotFound if no matching aspect ratio was found.

    Declaration

    Objective-C

    - (NSInteger)indexOfMatchingAspectRatio:
        (NSArray<SBSDKPageAspectRatio *> *_Nullable)aspectRatios;

    Swift

    func indexOf(matchingAspectRatio aspectRatios: [SBSDKPageAspectRatio]?) -> Int