GMVFeature.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874
  1. #import <Foundation/Foundation.h>
  2. #import <UIKit/UIKit.h>
  3. #import "GMVDetectorConstants.h"
  4. /**
  5. * Generic feature returned by a GMVDetector.
  6. */
  7. @interface GMVFeature : NSObject
  8. /**
  9. * The rectangle that holds the discovered feature relative to the detected image in the view
  10. * coordinate system.
  11. */
  12. @property(atomic, assign, readonly) CGRect bounds;
  13. /**
  14. * The type of feature that was discovered.
  15. */
  16. @property(atomic, copy, readonly) NSString *type;
  17. /**
  18. * Indicates whether the object has a tracking ID.
  19. */
  20. @property(atomic, assign, readonly) BOOL hasTrackingID;
  21. /**
  22. * The tracking identifier of the feature. This ID is not associated with a specific feature
  23. * but identifies the same feature among consecutive video frames.
  24. */
  25. @property(atomic, assign, readonly) NSUInteger trackingID;
  26. @end
  27. /**
  28. * An email message from a 'MAILTO:' or similar QR Code type.
  29. */
  30. @interface GMVBarcodeFeatureEmail : NSObject
  31. /**
  32. * Email message address.
  33. */
  34. @property(atomic, copy, readonly) NSString *address;
  35. /**
  36. * Email message body.
  37. */
  38. @property(atomic, copy, readonly) NSString *body;
  39. /**
  40. * Email message subject.
  41. */
  42. @property(atomic, copy, readonly) NSString *subject;
  43. /**
  44. * Email message type.
  45. */
  46. @property(atomic, assign, readonly) GMVBarcodeFeatureEmailType type;
  47. @end
  48. /**
  49. * A phone number from a 'TEL:' or similar QR Code type.
  50. */
  51. @interface GMVBarcodeFeaturePhone : NSObject
  52. /**
  53. * Phone number.
  54. */
  55. @property(atomic, copy, readonly) NSString *number;
  56. /**
  57. * Phone number type.
  58. */
  59. @property(atomic, assign, readonly) GMVBarcodeFeaturePhoneType type;
  60. @end
  61. /**
  62. * An SMS message from an 'SMS:' or similar QR Code type.
  63. */
  64. @interface GMVBarcodeFeatureSMS : NSObject
  65. /**
  66. * An SMS message body.
  67. */
  68. @property(atomic, copy, readonly) NSString *message;
  69. /**
  70. * An SMS message phone number.
  71. */
  72. @property(atomic, copy, readonly) NSString *phoneNumber;
  73. @end
  74. /**
  75. * A URL and title from a 'MEBKM:' or similar QR Code type.
  76. */
  77. @interface GMVBarcodeFeatureURLBookmark : NSObject
  78. /**
  79. * A URL bookmark title.
  80. */
  81. @property(atomic, copy, readonly) NSString *title;
  82. /**
  83. * A URL bookmark url.
  84. */
  85. @property(atomic, copy, readonly) NSString *url;
  86. @end
  87. /**
  88. * Wi-Fi network parameters from a 'WIFI:' or similar QR Code type.
  89. */
  90. @interface GMVBarcodeFeatureWiFi : NSObject
  91. /**
  92. * A Wi-Fi access point SSID.
  93. */
  94. @property(atomic, copy, readonly) NSString *ssid;
  95. /**
  96. * A Wi-Fi access point password.
  97. */
  98. @property(atomic, copy, readonly) NSString *password;
  99. /**
  100. * A Wi-Fi access point encryption type.
  101. */
  102. @property(atomic, assign, readonly) GMVBarcodeFeatureWiFiEncryptionType type;
  103. @end
  104. /**
  105. * GPS coordinates from a 'GEO:' or similar QR Code type data.
  106. */
  107. @interface GMVBarcodeFeatureGeoPoint : NSObject
  108. /**
  109. * A location latitude.
  110. */
  111. @property(atomic, assign, readonly) double latitude;
  112. /**
  113. * A location longitude.
  114. */
  115. @property(atomic, assign, readonly) double longitude;
  116. @end
  117. /**
  118. * An address.
  119. */
  120. @interface GMVBarcodeFeatureAddress : NSObject
  121. /**
  122. * Formatted address, containing multiple lines when appropriate.
  123. */
  124. @property(atomic, copy, readonly) NSArray<NSString *> *addressLines;
  125. /**
  126. * Address type.
  127. */
  128. @property(atomic, assign, readonly) GMVBarcodeFeatureAddressType type;
  129. @end
  130. /**
  131. * A person's name, both formatted and as individual name components.
  132. */
  133. @interface GMVBarcodeFeaturePersonName : NSObject
  134. /**
  135. * Properly formatted name.
  136. */
  137. @property(atomic, copy, readonly) NSString *formattedName;
  138. /**
  139. * First name.
  140. */
  141. @property(atomic, copy, readonly) NSString *first;
  142. /**
  143. * Last name.
  144. */
  145. @property(atomic, copy, readonly) NSString *last;
  146. /**
  147. * Middle name.
  148. */
  149. @property(atomic, copy, readonly) NSString *middle;
  150. /**
  151. * Name prefix.
  152. */
  153. @property(atomic, copy, readonly) NSString *prefix;
  154. /**
  155. * Designates a text string to be set as the kana name in the phonebook.
  156. * Used for Japanese contacts.
  157. */
  158. @property(atomic, copy, readonly) NSString *pronounciation;
  159. /**
  160. * Name suffix.
  161. */
  162. @property(atomic, copy, readonly) NSString *suffix;
  163. @end
  164. /**
  165. * A person's or organization's business card. For example, a vCard.
  166. */
  167. @interface GMVBarcodeFeatureContactInfo : NSObject
  168. /**
  169. * Person's or organization's addresses.
  170. */
  171. @property(atomic, copy, readonly) NSArray<GMVBarcodeFeatureAddress *> *addresses;
  172. /**
  173. * Contact emails.
  174. */
  175. @property(atomic, copy, readonly) NSArray<GMVBarcodeFeatureEmail *> *emails;
  176. /**
  177. * A person's name.
  178. */
  179. @property(atomic, strong, readonly) GMVBarcodeFeaturePersonName *name;
  180. /**
  181. * Contact phone numbers.
  182. */
  183. @property(atomic, copy, readonly) NSArray<GMVBarcodeFeaturePhone *> *phones;
  184. /**
  185. * Contact URLs.
  186. */
  187. @property(atomic, copy, readonly) NSArray<NSString *> *urls;
  188. /**
  189. * Job title.
  190. */
  191. @property(atomic, copy, readonly) NSString *jobTitle;
  192. /**
  193. * Business organization.
  194. */
  195. @property(atomic, copy, readonly) NSString *organization;
  196. @end
  197. /**
  198. * A calendar event extracted from a QR code.
  199. */
  200. @interface GMVBarcodeFeatureCalendarEvent : NSObject
  201. /**
  202. * Calendar event description.
  203. */
  204. @property(atomic, copy, readonly) NSString *eventDescription;
  205. /**
  206. * Calendar event location.
  207. */
  208. @property(atomic, copy, readonly) NSString *location;
  209. /**
  210. * Clendar event organizer.
  211. */
  212. @property(atomic, copy, readonly) NSString *organizer;
  213. /**
  214. * Calendar event status.
  215. */
  216. @property(atomic, copy, readonly) NSString *status;
  217. /**
  218. * Calendar event summary.
  219. */
  220. @property(atomic, copy, readonly) NSString *summary;
  221. /**
  222. * Calendar event start date.
  223. */
  224. @property(atomic, strong, readonly) NSDate *start;
  225. /**
  226. * Calendar event end date.
  227. */
  228. @property(atomic, strong, readonly) NSDate *end;
  229. @end
  230. /**
  231. * A driver license or ID card data representation.
  232. */
  233. @interface GMVBarcodeFeatureDriverLicense : NSObject
  234. /**
  235. * Holder's first name.
  236. */
  237. @property(atomic, copy, readonly) NSString *firstName;
  238. /**
  239. * Holder's middle name.
  240. */
  241. @property(atomic, copy, readonly) NSString *middleName;
  242. /**
  243. * Holder's last name.
  244. */
  245. @property(atomic, copy, readonly) NSString *lastName;
  246. /**
  247. * Holder's gender. 1 is male and 2 is female.
  248. */
  249. @property(atomic, copy, readonly) NSString *gender;
  250. /**
  251. * Holder's city address.
  252. */
  253. @property(atomic, copy, readonly) NSString *addressCity;
  254. /**
  255. * Holder's state address.
  256. */
  257. @property(atomic, copy, readonly) NSString *addressState;
  258. /**
  259. * Holder's street address.
  260. */
  261. @property(atomic, copy, readonly) NSString *addressStreet;
  262. /**
  263. * Holder's address' zipcode.
  264. */
  265. @property(atomic, copy, readonly) NSString *addressZip;
  266. /**
  267. * Holder's birthday. The date format depends on the issuing country.
  268. */
  269. @property(atomic, copy, readonly) NSString *birthDate;
  270. /**
  271. * "DL" for driver licenses, "ID" for ID cards.
  272. */
  273. @property(atomic, copy, readonly) NSString *documentType;
  274. /**
  275. * Driver license ID number.
  276. */
  277. @property(atomic, copy, readonly) NSString *licenseNumber;
  278. /**
  279. * Driver license expiration date. The date format depends on the issuing country.
  280. */
  281. @property(atomic, copy, readonly) NSString *expiryDate;
  282. /**
  283. * The date format depends on the issuing country.
  284. */
  285. @property(atomic, copy, readonly) NSString *issuingDate;
  286. /**
  287. * Country in which DL/ID was issued.
  288. */
  289. @property(atomic, copy, readonly) NSString *issuingCountry;
  290. @end
  291. /**
  292. * Describes a barcode detected in a still image frame. Its properties provide barcode value
  293. * information.
  294. */
  295. @interface GMVBarcodeFeature : GMVFeature
  296. /**
  297. * Barcode value as it was encoded in the barcode. Structured values are not parsed, for example:
  298. * 'MEBKM:TITLE:Google;URL:https://www.google.com;;'. Does not include the supplemental value.
  299. */
  300. @property(atomic, copy, readonly) NSString *rawValue;
  301. /**
  302. * Barcode value in a user-friendly format. May omit some of the information encoded in the
  303. * barcode. For example, in the case above the display_value might be 'https://www.google.com'.
  304. * If valueFormat==TEXT, this field will be equal to rawValue. This value may be multiline,
  305. * for example, when line breaks are encoded into the original TEXT barcode value. May include
  306. * the supplement value.
  307. */
  308. @property(atomic, copy, readonly) NSString *displayValue;
  309. /**
  310. * Barcode format; for example, EAN_13. Note that this field may contain values not present in the
  311. * current set of format constants. When mapping this value to something else, it is advisable
  312. * to have a default/fallback case.
  313. */
  314. @property(atomic, assign, readonly) GMVDetectorBarcodeFormat format;
  315. /**
  316. * The four corner points of the barcode, in clockwise order starting with the top left relative
  317. * to the detected image in the view coordinate system. These are CGPoints boxed in NSValues.
  318. * Due to the possible perspective distortions, this is not necessarily a rectangle.
  319. */
  320. @property(atomic, copy, readonly) NSArray<NSValue *> *cornerPoints;
  321. /**
  322. * Format of the barcode value. For example, TEXT, PRODUCT, URL, etc. Note that this field may
  323. * contain values not present in the current set of value format constants. When mapping this
  324. * value to something else, it is advisable to have a default/fallback case.
  325. */
  326. @property(atomic, assign, readonly) GMVDetectorBarcodeValueFormat valueFormat;
  327. /**
  328. * An email message from a 'MAILTO:' or similar QR Code type. This properly is only set if
  329. * valueFormat is GMVDetectorBarcodeValueFormatEmail.
  330. */
  331. @property(atomic, strong, readonly) GMVBarcodeFeatureEmail *email;
  332. /**
  333. * A phone number from a 'TEL:' or similar QR Code type. This property is only set if valueFormat
  334. * is GMVDetectorBarcodeValueFormatPhone.
  335. */
  336. @property(atomic, strong, readonly) GMVBarcodeFeaturePhone *phone;
  337. /**
  338. * An SMS message from an 'SMS:' or similar QR Code type. This property is only set if valueFormat
  339. * is GMVDetectorBarcodeValueFormatSMS.
  340. */
  341. @property(atomic, strong, readonly) GMVBarcodeFeatureSMS *sms;
  342. /**
  343. * A URL and title from a 'MEBKM:' or similar QR Code type. This property is only set iff
  344. * valueFormat is GMVDetectorBarcodeValueFormatURL.
  345. */
  346. @property(atomic, strong, readonly) GMVBarcodeFeatureURLBookmark *url;
  347. /**
  348. * Wi-Fi network parameters from a 'WIFI:' or similar QR Code type. This property is only set
  349. * iff valueFormat is GMVDetectorBarcodeValueFormatWifi.
  350. */
  351. @property(atomic, strong, readonly) GMVBarcodeFeatureWiFi *wifi;
  352. /**
  353. * GPS coordinates from a 'GEO:' or similar QR Code type. This property is only set iff valueFormat
  354. * is GMVDetectorBarcodeValueFormatGeo
  355. */
  356. @property(atomic, strong, readonly) GMVBarcodeFeatureGeoPoint *geoPoint;
  357. /**
  358. * A person's or organization's business card. For example a VCARD. This property is only set
  359. * iff valueFormat is GMVDetectorBarcodeValueFormatContactInfo.
  360. */
  361. @property(atomic, strong, readonly) GMVBarcodeFeatureContactInfo *contactInfo;
  362. /**
  363. * A calendar event extracted from a QR Code. This property is only set iff valueFormat is
  364. * GMVDetectorBarcodeValueFormatCalendarEvent.
  365. */
  366. @property(atomic, strong, readonly) GMVBarcodeFeatureCalendarEvent *calendarEvent;
  367. /**
  368. * A driver license or ID card. This property is only set iff valueFormat is
  369. * GMVDetectorBarcodeValueFormatDriverLicense.
  370. */
  371. @property(atomic, strong, readonly) GMVBarcodeFeatureDriverLicense *driverLicense;
  372. @end
  373. /**
  374. * Describes a single element in a line of detected text. An "element" is roughly equivalent to a
  375. * space-separated "word" in most Latin-script languages.
  376. */
  377. @interface GMVTextElementFeature : GMVFeature
  378. /**
  379. * Text contained in this element, in string form.
  380. */
  381. @property(atomic, copy, readonly) NSString *value;
  382. /**
  383. * The four corner points of the text line, in clockwise order starting with the top left relative
  384. * to the detected image in the view coordinate system. These are CGPoints boxed in NSValues.
  385. */
  386. @property(atomic, copy, readonly) NSArray<NSValue *> *cornerPoints;
  387. @end
  388. /**
  389. * Describes a single line of detected text.
  390. */
  391. @interface GMVTextLineFeature : GMVFeature
  392. /**
  393. * Text contained in this text line, in string form.
  394. */
  395. @property(atomic, copy, readonly) NSString *value;
  396. /**
  397. * The prevailing language in the text line. The format is the ISO 639-1 two-letter language code if
  398. * that is defined (e.g. "en"), or else the ISO 639-2 three-letter code if that is defined.
  399. */
  400. @property(atomic, copy, readonly) NSString *language;
  401. /**
  402. * The four corner points of the text line, in clockwise order starting with the top left relative
  403. * to the detected image in the view coordinate system. These are CGPoints boxed in NSValues.
  404. */
  405. @property(atomic, copy, readonly) NSArray<NSValue *> *cornerPoints;
  406. /**
  407. * Text elements in this line.
  408. */
  409. @property(atomic, copy, readonly) NSArray<GMVTextElementFeature *> *elements;
  410. @end
  411. /**
  412. * Describes a text block detected in a still image frame. Its properties provide details
  413. * about detected text.
  414. */
  415. @interface GMVTextBlockFeature : GMVFeature
  416. /**
  417. * Text contained in the text block, in string form.
  418. */
  419. @property(atomic, copy, readonly) NSString *value;
  420. /**
  421. * The prevailing language in the text block. The format is the ISO 639-1 two-letter language code
  422. * if that is defined (e.g. "en"), or else the ISO 639-2 three-letter code if that is defined.
  423. */
  424. @property(atomic, copy, readonly) NSString *language;
  425. /**
  426. * The four corner points of the text block, in clockwise order starting with the top left relative
  427. * to the detected image in the view coordinate system. These are CGPoints boxed in NSValues.
  428. */
  429. @property(atomic, copy, readonly) NSArray<NSValue *> *cornerPoints;
  430. /**
  431. * The contents of the text block, broken down into individual lines.
  432. */
  433. @property(atomic, copy, readonly) NSArray<GMVTextLineFeature *> *lines;
  434. @end
  435. /**
  436. * Describes facial contours in a still image frame. A facial contour is a set of points that
  437. * outlines a facial landmark or region.
  438. */
  439. @interface GMVFaceContour : NSObject
  440. /**
  441. * All contour points.
  442. */
  443. @property(atomic, copy, readonly) NSArray<NSValue *> *allPoints;
  444. /**
  445. * A set of points outlines the face oval, relative to the detected image in the view coordinate
  446. * system.
  447. */
  448. @property(atomic, copy, readonly) NSArray<NSValue *> *faceContour;
  449. /**
  450. * A set of points outlines the top of the left eyebrow, relative to the detected image in the view
  451. * coordinate system.
  452. */
  453. @property(atomic, copy, readonly) NSArray<NSValue *> *topLeftEyebrowContour;
  454. /**
  455. * A set of points outlines the bottom of the left eyebrow, relative to the detected image in the
  456. * view coordinate system.
  457. */
  458. @property(atomic, copy, readonly) NSArray<NSValue *> *bottomLeftEyebrowContour;
  459. /**
  460. * A set of points outlines the top of the right eyebrow, relative to the detected image in the
  461. * view coordinate system.
  462. */
  463. @property(atomic, copy, readonly) NSArray<NSValue *> *topRightEyebrowContour;
  464. /**
  465. * A set of points outlines the bottom of the right eyebrow, relative to the detected image in the
  466. * view coordinate system.
  467. */
  468. @property(atomic, copy, readonly) NSArray<NSValue *> *bottomRightEyebrowContour;
  469. /**
  470. * A set of points outlines the left eye, relative to the detected image in the view coordinate
  471. * system.
  472. */
  473. @property(atomic, copy, readonly) NSArray<NSValue *> *leftEyeContour;
  474. /**
  475. * A set of points outlines the right eye, relative to the detected image in the view coordinate
  476. * system.
  477. */
  478. @property(atomic, copy, readonly) NSArray<NSValue *> *rightEyeContour;
  479. /**
  480. * A set of points outlines the top of the upper lip, relative to the detected image in the
  481. * view coordinate system.
  482. */
  483. @property(atomic, copy, readonly) NSArray<NSValue *> *topUpperLipContour;
  484. /**
  485. * A set of points outlines the bottom of the upper lip, relative to the detected image in the
  486. * view coordinate system.
  487. */
  488. @property(atomic, copy, readonly) NSArray<NSValue *> *bottomUpperLipContour;
  489. /**
  490. * A set of points outlines the top of the lower lip, relative to the detected image in the
  491. * view coordinate system.
  492. */
  493. @property(atomic, copy, readonly) NSArray<NSValue *> *topLowerLipContour;
  494. /**
  495. * A set of points outlines the bottom of the lower lip, relative to the detected image in the
  496. * view coordinate system.
  497. */
  498. @property(atomic, copy, readonly) NSArray<NSValue *> *bottomLowerLipContour;
  499. /**
  500. * A set of points outlines the nose bridge, relative to the detected image in the view coordinate
  501. * system.
  502. */
  503. @property(atomic, copy, readonly) NSArray<NSValue *> *noseBridgeContour;
  504. /**
  505. * A set of points outlines the bottom of the nose, relative to the detected image in the view
  506. * coordinate system.
  507. */
  508. @property(atomic, copy, readonly) NSArray<NSValue *> *bottomNoseContour;
  509. @end
  510. /**
  511. * Describes a face detected in a still image frame. Its properties provide face
  512. * landmark information.
  513. */
  514. @interface GMVFaceFeature : GMVFeature
  515. #pragma mark - Head properties
  516. /**
  517. * Indicates whether the detector found the head y euler angle.
  518. */
  519. @property(atomic, assign, readonly) BOOL hasHeadEulerAngleY;
  520. /**
  521. * Indicates the rotation of the face about the vertical axis of the image.
  522. * Positive euler y is when the face is turned towards the right side of the image that is being
  523. * processed.
  524. */
  525. @property(atomic, assign, readonly) CGFloat headEulerAngleY;
  526. /**
  527. * Indicates whether the detector found the head z euler angle.
  528. */
  529. @property(atomic, assign, readonly) BOOL hasHeadEulerAngleZ;
  530. /**
  531. * Indicates the rotation of the face about the axis pointing out of the image.
  532. * Positive euler z is a counter-clockwise rotation within the image plane.
  533. */
  534. @property(atomic, assign, readonly) CGFloat headEulerAngleZ;
  535. /**
  536. * Indicates the rotation of the face about the horizontal axis.
  537. * Positive euler x is the rotation when the face looks up.
  538. */
  539. @property(atomic, assign, readonly) CGFloat headEulerAngleX;
  540. /**
  541. * Indicates whether the detector found the head x euler angle.
  542. */
  543. @property(atomic, assign, readonly) BOOL hasHeadEulerAngleX;
  544. #pragma mark - Mouth properties
  545. /**
  546. * Indicates whether the detector found the face’s mouth corner where the
  547. * lips meet.
  548. */
  549. @property(atomic, assign, readonly) BOOL hasMouthPosition;
  550. /**
  551. * The coordinates of the mouth corner where the lips meet, relative to the detected image in
  552. * the view coordinate system.
  553. */
  554. @property(atomic, assign, readonly) CGPoint mouthPosition;
  555. /**
  556. * Indicates whether the detector found the face's bottom lip center.
  557. */
  558. @property(atomic, assign, readonly) BOOL hasBottomMouthPosition;
  559. /**
  560. * The coordinates of the bottom lip center, relative to the detected image in the view
  561. * coordinate system.
  562. */
  563. @property(atomic, assign, readonly) CGPoint bottomMouthPosition;
  564. /**
  565. * Indicates whether the detector found the face's right mouth corner.
  566. */
  567. @property(atomic, assign, readonly) BOOL hasRightMouthPosition;
  568. /**
  569. * The coordinates of the right mouth corner, relative to the detected image in the view
  570. * coordinate system.
  571. */
  572. @property(atomic, assign, readonly) CGPoint rightMouthPosition;
  573. /**
  574. * Indicates whether the detector found the face's left mouth corner.
  575. */
  576. @property(atomic, assign, readonly) BOOL hasLeftMouthPosition;
  577. /**
  578. * The coordinates of the left mouth corner, relative to the detected image in the view
  579. * coordinate system.
  580. */
  581. @property(atomic, assign, readonly) CGPoint leftMouthPosition;
  582. #pragma mark - Ear properties
  583. /**
  584. * Indicates whether the detector found the midpoint of the face's left
  585. * ear tip and left ear lobe.
  586. */
  587. @property(atomic, assign, readonly) BOOL hasLeftEarPosition;
  588. /**
  589. * The coordinates of the midpoint between the face's midpoint of the left ear tip and left ear
  590. * lobe, relative to the detected image in the view coordinate system.
  591. */
  592. @property(atomic, assign, readonly) CGPoint leftEarPosition;
  593. /**
  594. * Indicates whether the detector found the face's left ear tip. Treating the
  595. * top of the face's left ear as a circle, this is the point at 45 degrees around the circle in
  596. * Cartesian coordinates.
  597. */
  598. @property(atomic, assign, readonly) BOOL hasRightEarPosition;
  599. /**
  600. * The coordinates of the midpoint between the face's midpoint of the right ear tip and right ear
  601. * lobe, relative to the detected image in the view coordinate system.
  602. */
  603. @property(atomic, assign, readonly) CGPoint rightEarPosition;
  604. #pragma mark - Eye properties
  605. /**
  606. * Indicates whether the detector found the face’s left eye.
  607. */
  608. @property(atomic, assign, readonly) BOOL hasLeftEyePosition;
  609. /**
  610. * The coordinates of the left eye, relative to the detected image in the view coordinate system.
  611. */
  612. @property(atomic, assign, readonly) CGPoint leftEyePosition;
  613. /**
  614. * Indicates whether the detector found the face’s right eye.
  615. */
  616. @property(atomic, assign, readonly) BOOL hasRightEyePosition;
  617. /**
  618. * The coordinates of the right eye, relative to the detected image in the view coordinate system.
  619. */
  620. @property(atomic, assign, readonly) CGPoint rightEyePosition;
  621. #pragma mark - Cheek properties
  622. /**
  623. * Indicates whether the detector found the face's left cheek.
  624. */
  625. @property(atomic, assign, readonly) BOOL hasLeftCheekPosition;
  626. /**
  627. * The coordinates of the left cheek, relative to the detected image in the view
  628. * coordinate system.
  629. */
  630. @property(atomic, assign, readonly) CGPoint leftCheekPosition;
  631. /**
  632. * Indicates whether the detector found the face's right cheek.
  633. */
  634. @property(atomic, assign, readonly) BOOL hasRightCheekPosition;
  635. /**
  636. * The coordinates of the right cheek, relative to the detected image in the view
  637. * coordinate system.
  638. */
  639. @property(atomic, assign, readonly) CGPoint rightCheekPosition;
  640. #pragma mark - Nose properties
  641. /**
  642. * Indicates whether the detector found the midpoint between the face's
  643. * nostrils where the nose meets the face.
  644. */
  645. @property(atomic, assign, readonly) BOOL hasNoseBasePosition;
  646. /**
  647. * The coordinates of the midpoint between the nostrils, relative to the detected image in
  648. * the view coordinate system.
  649. */
  650. @property(atomic, assign, readonly) CGPoint noseBasePosition;
  651. #pragma mark - Classifier properties
  652. /**
  653. * Indicates whether a smiling probability is available.
  654. */
  655. @property(atomic, assign, readonly) BOOL hasSmilingProbability;
  656. /**
  657. * A value between 0.0 and 1.0 giving a probability that the face is smiling.
  658. **/
  659. @property(atomic, assign, readonly) CGFloat smilingProbability;
  660. /**
  661. * Indicates whether a left eye open probability is available.
  662. */
  663. @property(atomic, assign, readonly) BOOL hasLeftEyeOpenProbability;
  664. /**
  665. * A value between 0.0 and 1.0 giving a probability that the face's left eye is open.
  666. */
  667. @property(atomic, assign, readonly) CGFloat leftEyeOpenProbability;
  668. /**
  669. * Indicates whether a right eye open probability is available.
  670. */
  671. @property(atomic, assign, readonly) BOOL hasRightEyeOpenProbability;
  672. /**
  673. * A value between 0.0 and 1.0 giving a probability that the face's right eye is open.
  674. */
  675. @property(atomic, assign, readonly) CGFloat rightEyeOpenProbability;
  676. /**
  677. * Describes a set of points that outlines a facial landmark.
  678. */
  679. @property(atomic, copy, readonly) GMVFaceContour *contour;
  680. @end
  681. /**
  682. * Describes a label detected in a still image frame. Its properties provide details about the
  683. * label.
  684. */
  685. @interface GMVLabelFeature : GMVFeature
  686. /**
  687. * Machine-generated identifier (thus MID) corresponding to the entity's Google Knowledge Graph
  688. * entry. For example: "/m/01j51".
  689. *
  690. * Note the globally unique MID values remain unchanged across different languages, so you
  691. * can use this value to tie entities together from different languages. To inspect the MID
  692. * value, refer to the Google Knowledge Graph API documentation.
  693. * https://developers.google.com/knowledge-graph/reference/rest/v1/
  694. */
  695. @property(atomic, copy, readonly) NSString *MID;
  696. /**
  697. * Description of the label, i.e. human readable string in American English. For example: "Balloon".
  698. *
  699. * Note: this is not fit for display purposes, as it is not localized. Use the MID and query the
  700. * Knowledge Graph to get a localized description of the label.
  701. */
  702. @property(atomic, copy, readonly) NSString *labelDescription;
  703. /**
  704. * Confidence score for the label (between 0 and 1).
  705. *
  706. * Features coming from a label detector all have scores higher or equal to the detector's
  707. * configured threshold.
  708. */
  709. @property(atomic, assign, readonly) float score;
  710. @end