SBSDKGenericTextLineRecognizerConfiguration

@interface SBSDKGenericTextLineRecognizerConfiguration : NSObject

A descriptor-like class to configure an instance of SBSDKGenericTextLineRecognizer.

  • The text filter strategy for the generic text line recognizer. Defaults to SBSDKTextFilterStrategyDocument.

    Declaration

    Objective-C

    @property (nonatomic) SBSDKTextFilterStrategy textFilterStrategy;

    Swift

    var textFilterStrategy: SBSDKTextFilterStrategy { get set }
  • A string of two-letter ISO 639-1 language codes, separated by ‘+’, the OCR engine should use for recognition. E.g. “de+en” (german and english) “ar+he+ja” (arabic, hebrew and japanese). If the string is invalid or nil the user preferred languages are used. Ignores white spaces, invalid languages and invalid characters.

    Declaration

    Objective-C

    @property (nonatomic, copy) NSString *_Nonnull textRecognitionLanguages;

    Swift

    var textRecognitionLanguages: String { get set }
  • A string (list) of accepted characters during text recognition. If empty or nil, all characters are accepted.

    Declaration

    Objective-C

    @property (nonatomic, copy, nullable) NSString *textRecognitionAllowedCharacters;

    Swift

    var textRecognitionAllowedCharacters: String? { get set }
  • The maximum number of accumulated video frames before the current recognition result is returned.

    Declaration

    Objective-C

    @property (nonatomic) NSUInteger maximumNumberOfAccumulatedFrames;

    Swift

    var maximumNumberOfAccumulatedFrames: UInt { get set }
  • Maximum image side length (height or width) for OCR processing. If the initial image has longer side - it will be downscaled to the limit. Setting to 0 means no limit. Default is 0. Using this parameter might be useful for slower devices or to reduce processing load.

    Declaration

    Objective-C

    @property (nonatomic) NSUInteger ocrResolutionLimit;

    Swift

    var ocrResolutionLimit: UInt { get set }
  • The minimum equal results in accumulated video frames to count as valid.

    Declaration

    Objective-C

    @property (nonatomic) NSUInteger minimumNumberOfRequiredFramesWithEqualRecognitionResult;

    Swift

    var minimumNumberOfRequiredFramesWithEqualRecognitionResult: UInt { get set }
  • A very basic and simple string pattern used to validate the recognized text. ? - any character

    - any digit

    All other characters represent themselves. Note: If validationPattern and validationBlock are both non-nil, both validation methods are AND-connected to form the final validation result.

    Declaration

    Objective-C

    @property (nonatomic, copy, nullable) NSString *validationPattern;

    Swift

    var validationPattern: String? { get set }
  • If set to NO, the whole recognized text must match the pattern in order to validate, otherwise the validation will be successful if the recognized text contains a substring that matches the validation pattern. Defaults to NO.

    Declaration

    Objective-C

    @property (nonatomic) BOOL validationPatternSubstringMatchingEnabled;

    Swift

    var validationPatternSubstringMatchingEnabled: Bool { get set }
  • A callback block used to validate the recognized text. The recognized string is passed to the block as parameter and the block must return YES, if the result is valid and NO otherwise. Note: If validationPattern and validationBlock are both non-nil, both validation methods are AND-connected to form the final validation result.

    Declaration

    Objective-C

    @property (nonatomic, copy, nullable) SBSDKTextLineRecognizerValidationBlock validationBlock;

    Swift

    var validationBlock: SBSDKTextLineRecognizerValidationBlock? { get set }
  • A callback block used to sanitize the raw recognized text. This block is called before validation and should be used to filter the raw text from unwanted characters and noise. The returned sanitized string is then fed back into the recognizer to improve the quality and speed of the recognition in the following video frames.

    Declaration

    Objective-C

    @property (nonatomic, copy, nullable) SBSDKTextLineRecognizerTextSanitizerBlock stringSanitizerBlock;

    Swift

    var stringSanitizerBlock: SBSDKTextLineRecognizerTextSanitizerBlock? { get set }
  • The default configuration initializer

    Declaration

    Objective-C

    + (nonnull instancetype)defaultConfiguration;

    Swift

    class func `default`() -> Self