ALOCRConfig Class Reference

Inherits from NSObject
Declared in ALOCRConfig.h

Overview

A class used to configure the Anyline OCR module.

– initWithJsonDictionary:

- (instancetype _Nullable)initWithJsonDictionary:(NSDictionary *_Nonnull)configDict

– initWithJsonDictionary:error:

- (instancetype _Nullable)initWithJsonDictionary:(NSDictionary *_Nonnull)configDict error:(NSError *_Nullable *_Nullable)error

  scanMode

The scan mode.

@property (nonatomic, assign) ALOCRScanMode scanMode

See Also

Declared In

ALOCRConfig.h

  customCmdFilePath

Property to set a custom command file (path not string) to improve scanning for your use-case. Get in touch with Anyline to receive your custum command file.

@property (nullable, nonatomic, strong) NSString *customCmdFilePath

Declared In

ALOCRConfig.h

  customCmdFileString

Property to set a custom command file (string not path) to improve scanning for your use-case. Get in touch with Anyline to receive your custum command file.

@property (nullable, nonatomic, strong) NSString *customCmdFileString

Declared In

ALOCRConfig.h

  charHeight

Property to set the character height.

@property (nonatomic, assign) ALRange charHeight

Declared In

ALOCRConfig.h

  )

Property to set the tesseract tessdata files as Array of Strings. ex. @[@“eng”,@“deu”]

@property (nullable, nonatomic, strong) NSArray<NSString*> *__deprecated_msg ( "Deprecated since 3.20. Use languages instead! This method still requires a copy of the traineddata." )

Declared In

ALOCRConfig.h

  languages

Property to set the any files as Array of String paths to the files.

@property (nullable, nonatomic, copy, readonly) NSArray<NSString*> *languages

Discussion

Note this method requires the full path with fileending and not only the file name like the old deprecated method.

Declared In

ALOCRConfig.h

– setLanguages:

- (void)setLanguages:(NSArray<NSString*> *_Nonnull)languages

– setLanguages:error:

- (BOOL)setLanguages:(NSArray<NSString*> *_Nonnull)languages error:(NSError *_Nullable *_Nullable)error

  charWhiteList

Property for the character whitelist you would like to use.

@property (nullable, nonatomic, strong) NSString *charWhiteList

Declared In

ALOCRConfig.h

  validationRegex

Property for the validation regex.

@property (nullable, nonatomic, strong) NSString *validationRegex

Declared In

ALOCRConfig.h

  minConfidence

The min confidence to accept the result. Between 0-100, but should normally be at least 50. The spped / accurracy of Anyline can be controlled with this property.

@property (nonatomic, assign) NSUInteger minConfidence

Declared In

ALOCRConfig.h

  removeSmallContours

Removes small contours as noise.

@property (nonatomic, assign) BOOL removeSmallContours

Discussion

This property is for Line mode only.

@warming Do not use activate this property when scanning for example i dots or :. This would remove those contours.

Declared In

ALOCRConfig.h

  removeWhitespaces

Set this to true if whitespaces should be removed within a line. Also causes faster processing, because optimizations can be made if whitespaces are not relevant. (only used in {@link ScanMode#LINE} mode)

@property (nonatomic, assign) BOOL removeWhitespaces

Parameters

removeWhitespaces

true if whitespaces should be removed

Declared In

ALOCRConfig.h

  minSharpness

Experimental parameter to set the minimum sharpness (value between 0-100; 0 to turn sharpness detection off; only used in {@link ScanMode#LINE}).

@property (nonatomic, assign) NSUInteger minSharpness

Availability

3.4.1

Discussion

The goal of the minimum sharpness is to avoid a time consuming ocr step, if the image is blurry and good results are therefor not likely. Detecting sharpness is however difficult, good values for the minimum are use case dependent.

The detected sharpness will be reported in anylineOCRModuleView:reportsVariable:value: with identifier “$sharpness” and also in error message in anylineOCRModuleView:reportsRunFailure:, if the minimum sharpness is not reached (with the error code ALOCRErrorSharpnessNotReached).

NOTE: Experimental means that this may be removed or changed in the future.

Declared In

ALOCRConfig.h

  charCountX

The X character count

@property (nonatomic, assign) NSUInteger charCountX

Discussion

This property is for Grid mode only.

Declared In

ALOCRConfig.h

  charCountY

The Y character count

@property (nonatomic, assign) NSUInteger charCountY

Discussion

This property is for Grid mode only.

Declared In

ALOCRConfig.h

  charPaddingXFactor

The average distance between characters in X direction, measured in percentage of character width.

@property (nonatomic, assign) double charPaddingXFactor

Discussion

This property is for Grid mode only.

Declared In

ALOCRConfig.h

  charPaddingYFactor

The average distance between characters in Y direction, measured in percentage of character height.

@property (nonatomic, assign) double charPaddingYFactor

Discussion

This property is for Grid mode only.

Declared In

ALOCRConfig.h

  isBrightTextOnDark

YES to set to bright text on dark background, NO to set to dark text on bright background.

@property (nonatomic, assign) BOOL isBrightTextOnDark

Discussion

This property is for Grid mode only.

Declared In

ALOCRConfig.h

– startVariablesOrError:

- (NSDictionary *_Nullable)startVariablesOrError:(NSError *_Nullable *_Nullable)error

– toJsonString

- (NSString *_Nullable)toJsonString

– allLanguagesAnyFiles

- (BOOL)allLanguagesAnyFiles