X-Git-Url: https://adrianiainlam.tk/git/?p=facial-landmarks-for-cubism.git;a=blobdiff_plain;f=include%2Ffacial_landmark_detector.h;fp=include%2Ffacial_landmark_detector.h;h=3956c2f28b9d45aa4332ce798f5e8a77540e0d9a;hp=85f35127d9ceeb7e25f2caea4d729941de6d6c8e;hb=cb483d3b7886b05435837a83ec6d2ab9987aa7ea;hpb=af96b559e637dd8f5eaa4ee702ea8d2aec63d371 diff --git a/include/facial_landmark_detector.h b/include/facial_landmark_detector.h index 85f3512..3956c2f 100644 --- a/include/facial_landmark_detector.h +++ b/include/facial_landmark_detector.h @@ -1,10 +1,10 @@ // -*- mode: c++ -*- -#ifndef __FACIAL_LANDMARK_DETECTOR_H__ -#define __FACIAL_LANDMARK_DETECTOR_H__ +#ifndef FACIAL_LANDMARK_DETECTOR_H +#define FACIAL_LANDMARK_DETECTOR_H /**** -Copyright (c) 2020 Adrian I. Lam +Copyright (c) 2020-2021 Adrian I. Lam Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -58,11 +58,12 @@ public: bool autoBreath; bool randomMotion; // TODO eyebrows currently not supported... - // I'd like to include them, but the dlib detection is very + // I'd like to include them, but the dlib / OSF detection is very // noisy and inaccurate (at least for my face). }; FacialLandmarkDetector(std::string cfgPath); + ~FacialLandmarkDetector(); Params getParams(void) const; @@ -71,6 +72,9 @@ public: void mainLoop(void); private: + FacialLandmarkDetector(const FacialLandmarkDetector&) = delete; + FacialLandmarkDetector& operator=(const FacialLandmarkDetector &) = delete; + enum LeftRight : bool { LEFT, @@ -79,6 +83,9 @@ private: bool m_stop; + int m_sock; + static const int m_faceId = 0; // Only support one face for now + double calcEyeAspectRatio(Point& p1, Point& p2, Point& p3, Point& p4, Point& p5, Point& p6) const; @@ -115,11 +122,12 @@ private: struct Config { + std::string osfIpAddress; + int osfPort; double faceYAngleCorrection; double eyeSmileEyeOpenThreshold; double eyeSmileMouthFormThreshold; double eyeSmileMouthOpenThreshold; - bool lateralInversion; std::size_t faceXAngleNumTaps; std::size_t faceYAngleNumTaps; std::size_t faceZAngleNumTaps; @@ -139,6 +147,7 @@ private: double faceYAngleZeroValue; double faceYAngleUpThreshold; double faceYAngleDownThreshold; + bool winkEnable; bool autoBlink; bool autoBreath; bool randomMotion;