Facemark.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. //
  2. // This file is auto-generated. Please don't modify it!
  3. //
  4. #pragma once
  5. #ifdef __cplusplus
  6. //#import "opencv.hpp"
  7. #import "opencv2/face.hpp"
  8. #import "opencv2/face/facemark.hpp"
  9. #else
  10. #define CV_EXPORTS
  11. #endif
  12. #import <Foundation/Foundation.h>
  13. #import "Algorithm.h"
  14. @class Mat;
  15. NS_ASSUME_NONNULL_BEGIN
  16. // C++: class Facemark
  17. /**
  18. * Abstract base class for all facemark models
  19. *
  20. * To utilize this API in your program, please take a look at the REF: tutorial_table_of_content_facemark
  21. * ### Description
  22. *
  23. * Facemark is a base class which provides universal access to any specific facemark algorithm.
  24. * Therefore, the users should declare a desired algorithm before they can use it in their application.
  25. *
  26. * Here is an example on how to declare a facemark algorithm:
  27. *
  28. * // Using Facemark in your code:
  29. * Ptr<Facemark> facemark = createFacemarkLBF();
  30. *
  31. *
  32. * The typical pipeline for facemark detection is as follows:
  33. * - Load the trained model using Facemark::loadModel.
  34. * - Perform the fitting on an image via Facemark::fit.
  35. *
  36. * Member of `Face`
  37. */
  38. CV_EXPORTS @interface Facemark : Algorithm
  39. #ifdef __cplusplus
  40. @property(readonly)cv::Ptr<cv::face::Facemark> nativePtrFacemark;
  41. #endif
  42. #ifdef __cplusplus
  43. - (instancetype)initWithNativePtr:(cv::Ptr<cv::face::Facemark>)nativePtr;
  44. + (instancetype)fromNative:(cv::Ptr<cv::face::Facemark>)nativePtr;
  45. #endif
  46. #pragma mark - Methods
  47. //
  48. // void cv::face::Facemark::loadModel(String model)
  49. //
  50. /**
  51. * A function to load the trained model before the fitting process.
  52. * @param model A string represent the filename of a trained model.
  53. *
  54. * <B>Example of usage</B>
  55. *
  56. * facemark->loadModel("../data/lbf.model");
  57. *
  58. */
  59. - (void)loadModel:(NSString*)model NS_SWIFT_NAME(loadModel(model:));
  60. //
  61. // bool cv::face::Facemark::fit(Mat image, Mat faces, vector_Mat& landmarks)
  62. //
  63. /**
  64. * Detect facial landmarks from an image.
  65. * @param image Input image.
  66. * @param faces Output of the function which represent region of interest of the detected faces.
  67. * Each face is stored in cv::Rect container.
  68. * @param landmarks The detected landmark points for each faces.
  69. *
  70. * <B>Example of usage</B>
  71. *
  72. * Mat image = imread("image.jpg");
  73. * std::vector<Rect> faces;
  74. * std::vector<std::vector<Point2f> > landmarks;
  75. * facemark->fit(image, faces, landmarks);
  76. *
  77. */
  78. - (BOOL)fit:(Mat*)image faces:(Mat*)faces landmarks:(NSMutableArray<Mat*>*)landmarks NS_SWIFT_NAME(fit(image:faces:landmarks:));
  79. @end
  80. NS_ASSUME_NONNULL_END