SBSDKGenericTextLineRecognizerConfiguration

@interface SBSDKGenericTextLineRecognizerConfiguration : NSObject

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

  • 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: This property is ignored, if either validationBlock or stringSanitizerBlock is non-nil.

    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: The validationPattern is ignored if this property is non-nil.

    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. Note: The validationPattern is ignored if this property is non-nil.

    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