FIRVisionTextElement.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #import <CoreGraphics/CoreGraphics.h>
  2. #import <Foundation/Foundation.h>
  3. @class FIRVisionTextRecognizedLanguage;
  4. NS_ASSUME_NONNULL_BEGIN
  5. /**
  6. * A text element recognized in an image. A text element is roughly equivalent to a space-separated
  7. * word in most Latin-script languages.
  8. */
  9. NS_SWIFT_NAME(VisionTextElement)
  10. @interface FIRVisionTextElement : NSObject
  11. /**
  12. * String representation of the text element that was recognized.
  13. */
  14. @property(nonatomic, readonly) NSString *text;
  15. /**
  16. * The rectangle that contains the text element relative to the image in the default coordinate
  17. * space.
  18. */
  19. @property(nonatomic, readonly) CGRect frame;
  20. /**
  21. * An array of recognized languages in the text element. (Cloud API only.)
  22. */
  23. @property(nonatomic, readonly) NSArray<FIRVisionTextRecognizedLanguage *> *recognizedLanguages;
  24. /**
  25. * The four corner points of the text element in clockwise order starting with the top left point
  26. * relative to the image in the default coordinate space. The `NSValue` objects are `CGPoint`s. For
  27. * cloud text recognizers, the array is `nil`.
  28. */
  29. @property(nonatomic, readonly, nullable) NSArray<NSValue *> *cornerPoints;
  30. /**
  31. * The confidence of the recognized text element. The value is `nil` for all text recognizers except
  32. * for cloud text recognizers with model type `VisionCloudTextModelType.dense`.
  33. */
  34. @property(nonatomic, readonly, nullable) NSNumber *confidence;
  35. /**
  36. * Unavailable.
  37. */
  38. - (instancetype)init NS_UNAVAILABLE;
  39. @end
  40. NS_ASSUME_NONNULL_END