AI-generated Key Takeaways
-
MLKTextElementrepresents a recognized text element, like a word, within an image. -
Each element includes its text content, bounding box (
frame), and corner points' location within the image. -
It may contain information about recognized languages associated with the element.
-
Direct instantiation of
MLKTextElementis unavailable; it's obtained through other ML Kit APIs.
MLKTextElement
@interface MLKTextElement : NSObjectA text element recognized in an image. A text element is a space-separated segment in a text line (for example, a word in most Latin-script languages).
-
String representation of the text element that was recognized.
Declaration
Objective-C
@property (nonatomic, readonly) NSString *_Nonnull text; -
The rectangle that contains the text element 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 element. 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 element 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;