SBSDKPageAnalyzerResult
@interface SBSDKPageAnalyzerResult : NSObject <NSCopying>
Describes the result of a page layout analyzing operation. It contains page orientation, writing direction and text line order as well as a deskew angle. This result can be used to process the input image before running an OCR operation on it, e.g.
- Rotate the image to let the page orientation flip to SBSDKPageOrientationUp,
- Apply a rotation with the deskewAngle to remove distortion and get perfectly aligned text lines.
- Limit recognition languages to languages that use the analyzer results writingDirection and textlineOrder to achieve much better OCR performance. For convenience this immutable class conforms to NSCopying protocol.
-
The general orientation of the text in the image. See SBSDKPageOrientation.
Declaration
Objective-C
@property (nonatomic, readonly) SBSDKPageOrientation orientation;
Swift
var orientation: SBSDKPageOrientation { get }
-
The writing direction of the text lines in the image. See SBSDKWritingDirection.
Declaration
Objective-C
@property (nonatomic, readonly) SBSDKWritingDirection writingDirection;
Swift
var writingDirection: SBSDKWritingDirection { get }
-
The order of text lines. See SBSDKTextlineOrder.
Declaration
Objective-C
@property (nonatomic, readonly) SBSDKTextlineOrder textlineOrder;
Swift
var textlineOrder: SBSDKTextlineOrder { get }
-
The angle in radians the image needs to be rotated to achieve perfectly aligned text lines.
Declaration
Objective-C
@property (nonatomic, readonly) CGFloat deskewAngle;
Swift
var deskewAngle: CGFloat { get }
-
Designated initializer.
Declaration
Objective-C
- (nonnull instancetype)initWithOrientation:(SBSDKPageOrientation)orientation writingDirection: (SBSDKWritingDirection)writingDirection textlineOrder:(SBSDKTextlineOrder)textlineOrder deskewAngle:(double)radians;
Swift
init(orientation: SBSDKPageOrientation, writingDirection: SBSDKWritingDirection, textlineOrder: SBSDKTextlineOrder, deskewAngle radians: Double)
Parameters
orientation
The receivers orientation.
writingDirection
The receivers text line writing direction.
textlineOrder
The receivers textline order.
radians
The receivers deskew angle in radians.
Return Value
Fully initialized object.