MLKitTextRecognitionCommon Framework 參考資料

MLKTextBlock


@interface MLKTextBlock : NSObject

在由文字行陣列組成的圖片中識別的文字區塊。

  • 所辨識文字區塊的字串表示法。

    聲明

    Objective-C

    @property (nonatomic, readonly) NSString *_Nonnull text;
  • 組成區塊的文字行陣列。

    聲明

    Objective-C

    @property (nonatomic, readonly) NSArray<MLKTextLine *> *_Nonnull lines;
  • 矩形,其中包含在預設座標空間中與圖片相關的文字區塊。

    聲明

    Objective-C

    @property (nonatomic, readonly) CGRect frame;
  • 文字區塊中可辨識的語言陣列。如果系統無法辨識語言,陣列會留空。

    聲明

    Objective-C

    @property (nonatomic, readonly) NSArray<MLKTextRecognizedLanguage *> *_Nonnull recognizedLanguages;
  • 文字區塊的四個角落點,依順時針順序從左上角開始 (相對於預設座標空間中的圖片)。NSValue 物件為 CGPoint

    聲明

    Objective-C

    @property (nonatomic, readonly) NSArray<NSValue *> *_Nonnull cornerPoints;
  • 無法使用,

    聲明

    Objective-C

    - (nonnull instancetype)init;