AI-generated Key Takeaways
-
MLKTextBlockrepresents a recognized text block from an image, containing an array of text lines. -
It provides access to the text content, individual lines, bounding box, recognized languages, and corner points of the block.
-
The
frameproperty defines the block's location and size within the image's coordinate space. -
recognizedLanguagesoffers information about the detected languages within the text block. -
Corner points of the text block are accessible via the
cornerPointsproperty, useful for spatial understanding.
MLKTextBlock
@interface MLKTextBlock : NSObjectA text block recognized in an image that consists of an array of text lines.
-
String representation of the text block that was recognized.
Declaration
Objective-C
@property (nonatomic, readonly) NSString *_Nonnull text; -
An array of text lines that make up the block.
Declaration
Objective-C
@property (nonatomic, readonly) NSArray<MLKTextLine *> *_Nonnull lines; -
The rectangle that contains the text block relative to the image in the default coordinate space.
Declaration
Objective-C
@property (nonatomic, readonly) CGRect frame; -
An array of recognized languages in the text block. If no languages were recognized, the array is empty.
Declaration
Objective-C
@property (nonatomic, readonly) NSArray<MLKTextRecognizedLanguage *> *_Nonnull recognizedLanguages; -
The four corner points of the text block in clockwise order starting with the top left point relative to the image in the default coordinate space. The
NSValueobjects areCGPoints.Declaration
Objective-C
@property (nonatomic, readonly) NSArray<NSValue *> *_Nonnull cornerPoints; -
Unavailable.
Declaration
Objective-C
- (nonnull instancetype)init;