FIRVisionFace.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. #import <CoreGraphics/CoreGraphics.h>
  2. #import <Foundation/Foundation.h>
  3. #import "FIRVisionFaceContour.h"
  4. #import "FIRVisionFaceLandmark.h"
  5. NS_ASSUME_NONNULL_BEGIN
  6. /**
  7. * A human face detected in an image.
  8. */
  9. NS_SWIFT_NAME(VisionFace)
  10. @interface FIRVisionFace : NSObject
  11. /**
  12. * The rectangle that holds the discovered relative to the detected image in the view
  13. * coordinate system.
  14. */
  15. @property(nonatomic, readonly) CGRect frame;
  16. /**
  17. * Indicates whether the face has a tracking ID.
  18. */
  19. @property(nonatomic, readonly) BOOL hasTrackingID;
  20. /**
  21. * The tracking identifier of the face.
  22. */
  23. @property(nonatomic, readonly) NSInteger trackingID;
  24. /**
  25. * Indicates whether the detector found the head y euler angle.
  26. */
  27. @property(nonatomic, readonly) BOOL hasHeadEulerAngleY;
  28. /**
  29. * Indicates the rotation of the face about the vertical axis of the image. Positive y euler angle
  30. * is when the face is turned towards the right side of the image that is being processed.
  31. */
  32. @property(nonatomic, readonly) CGFloat headEulerAngleY;
  33. /**
  34. * Indicates whether the detector found the head z euler angle.
  35. */
  36. @property(nonatomic, readonly) BOOL hasHeadEulerAngleZ;
  37. /**
  38. * Indicates the rotation of the face about the axis pointing out of the image. Positive z euler
  39. * angle is a counter-clockwise rotation within the image plane.
  40. */
  41. @property(nonatomic, readonly) CGFloat headEulerAngleZ;
  42. /**
  43. * Indicates whether a smiling probability is available.
  44. */
  45. @property(nonatomic, readonly) BOOL hasSmilingProbability;
  46. /**
  47. * Probability that the face is smiling.
  48. */
  49. @property(nonatomic, readonly) CGFloat smilingProbability;
  50. /**
  51. * Indicates whether a left eye open probability is available.
  52. */
  53. @property(nonatomic, readonly) BOOL hasLeftEyeOpenProbability;
  54. /**
  55. * Probability that the face's left eye is open.
  56. */
  57. @property(nonatomic, readonly) CGFloat leftEyeOpenProbability;
  58. /**
  59. * Indicates whether a right eye open probability is available.
  60. */
  61. @property(nonatomic, readonly) BOOL hasRightEyeOpenProbability;
  62. /**
  63. * Probability that the face's right eye is open.
  64. */
  65. @property(nonatomic, readonly) CGFloat rightEyeOpenProbability;
  66. /**
  67. * Unavailable.
  68. */
  69. - (instancetype)init NS_UNAVAILABLE;
  70. /**
  71. * Returns the landmark, if any, of the given type in this detected face.
  72. *
  73. * @param type The type of the facial landmark.
  74. * @return The landmark of the given type in this face. nil if there isn't one.
  75. */
  76. - (nullable FIRVisionFaceLandmark *)landmarkOfType:(FIRFaceLandmarkType)type;
  77. /**
  78. * Returns the contour, if any, of the given type in this detected face.
  79. *
  80. * @param type The type of the facial contour.
  81. * @return The contour of the given type in this face. nil if there isn't one.
  82. */
  83. - (nullable FIRVisionFaceContour *)contourOfType:(FIRFaceContourType)type;
  84. @end
  85. NS_ASSUME_NONNULL_END