MLKitTextRecognition Common Framework-Referenz
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
TextBlock
class TextBlock : NSObject
Ein in einem Bild erkannter Textblock, der aus mehreren Textzeilen besteht.
-
Stringdarstellung des erkannten Textblocks.
Erklärung
Swift
var text: String { get }
-
Mehrere Textzeilen, aus denen der Block besteht
Erklärung
Swift
var lines: [MLKTextLine] { get }
-
Das Rechteck, das den Textblock relativ zum Bild im Standardkoordinatenraum enthält.
Erklärung
Swift
var frame: CGRect { get }
-
Ein Array erkannter Sprachen im Textblock. Wenn keine Sprachen erkannt wurden, lautet das Array:
leer.
Erklärung
Swift
var recognizedLanguages: [MLKTextRecognizedLanguage] { get }
-
Die vier Eckpunkte des Textblocks im Uhrzeigersinn, beginnend mit dem oberen linken Punkt
relativ zum Bild im Standardkoordinatenraum. Die NSValue
-Objekte sind CGPoint
s.
Erklärung
Swift
var cornerPoints: [NSValue] { get }
-
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers. Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2025-07-25 (UTC).
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Benötigte Informationen nicht gefunden","missingTheInformationINeed","thumb-down"],["Zu umständlich/zu viele Schritte","tooComplicatedTooManySteps","thumb-down"],["Nicht mehr aktuell","outOfDate","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Problem mit Beispielen/Code","samplesCodeIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-07-25 (UTC)."],[[["\u003cp\u003e\u003ccode\u003eMLKTextBlock\u003c/code\u003e represents a recognized text block in an image, containing an array of text lines.\u003c/p\u003e\n"],["\u003cp\u003eIt provides access to the recognized text, individual text lines, and the block's bounding box within the image.\u003c/p\u003e\n"],["\u003cp\u003eInformation about recognized languages and corner points of the text block are also available.\u003c/p\u003e\n"],["\u003cp\u003eIt's worth noting that the \u003ccode\u003eMLKTextBlock\u003c/code\u003e instance itself is not directly instantiable, likely created internally during text recognition.\u003c/p\u003e\n"]]],["A `TextBlock` object represents recognized text in an image. It provides the `text` (string representation), `lines` (array of `TextLine` objects), and `frame` (rectangle coordinates). It also details the `recognizedLanguages` and `cornerPoints` (four corners as `CGPoint`s). The `TextBlock` object cannot be initialized directly and is derived from image processing. The object contains the full recognized text of the block.\n"],null,["# MLKitTextRecognitionCommon Framework Reference\n\nTextBlock\n=========\n\n class TextBlock : NSObject\n\nA text block recognized in an image that consists of an array of text lines.\n- `\n ``\n ``\n `\n\n ### [text](#/c:objc(cs)MLKTextBlock(py)text)\n\n `\n ` \n String representation of the text block that was recognized. \n\n #### Declaration\n\n Swift \n\n var text: String { get }\n\n- `\n ``\n ``\n `\n\n ### [lines](#/c:objc(cs)MLKTextBlock(py)lines)\n\n `\n ` \n An array of text lines that make up the block. \n\n #### Declaration\n\n Swift \n\n var lines: [MLKTextLine] { get }\n\n- `\n ``\n ``\n `\n\n ### [frame](#/c:objc(cs)MLKTextBlock(py)frame)\n\n `\n ` \n The rectangle that contains the text block relative to the image in the default coordinate space. \n\n #### Declaration\n\n Swift \n\n var frame: CGRect { get }\n\n- `\n ``\n ``\n `\n\n ### [recognizedLanguages](#/c:objc(cs)MLKTextBlock(py)recognizedLanguages)\n\n `\n ` \n An array of recognized languages in the text block. If no languages were recognized, the array is\n empty. \n\n #### Declaration\n\n Swift \n\n var recognizedLanguages: [MLKTextRecognizedLanguage] { get }\n\n- `\n ``\n ``\n `\n\n ### [cornerPoints](#/c:objc(cs)MLKTextBlock(py)cornerPoints)\n\n `\n ` \n The four corner points of the text block in clockwise order starting with the top left point\n relative to the image in the default coordinate space. The `NSValue` objects are `CGPoint`s. \n\n #### Declaration\n\n Swift \n\n var cornerPoints: [NSValue] { get }\n\n- `\n ``\n ``\n `\n\n ### [-init](#/c:objc(cs)MLKTextBlock(im)init)\n\n `\n ` \n Unavailable."]]