SBSDKDocumentQualityAnalyzer

@interface SBSDKDocumentQualityAnalyzer : NSObject

Analyzes the quality of a document on a still image.

  • The size the input image is scaled down to in pixels in each dimension before analyzing it. Bigger values may improve the accuracy, smaller values increase the performance. Setting it to 0 disables image scaling.

    Defaults to 2500 pixels.

    Declaration

    Objective-C

    @property (nonatomic) CGFloat imageSizeLimit;

    Swift

    var imageSizeLimit: CGFloat { get set }
  • Synchronously analyzes an image and returns the quality of the document in the image.

    Declaration

    Objective-C

    - (SBSDKDocumentQuality)analyzeOnImage:(nonnull UIImage *)image;

    Swift

    func analyze(on image: UIImage) -> SBSDKDocumentQuality

    Parameters

    image

    The image to be analyzed.

    Return Value

    The quality of the document in the image.

  • Asynchronously analyzes the document quality on the image and passes the result to the completion handler.

    Declaration

    Objective-C

    - (void)analyzeOnImage:(nonnull UIImage *)image
                completion:(nonnull void (^)(SBSDKDocumentQuality))completion;

    Swift

    func analyze(on image: UIImage) async -> SBSDKDocumentQuality

    Parameters

    image

    The image to be analyzed.

    completion

    The completion handler. Is called on the main-thread.