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) 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) 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) 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) 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) 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) 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 (nonatomic, readonly) 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 SBSDKAspectRatio *)aspectRatio;

    Swift

    func matchesAspectRatio(_ aspectRatio: SBSDKAspectRatio) -> 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<SBSDKAspectRatio *> *_Nullable)aspectRatios;

    Swift

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