projects
/
facial-landmarks-for-cubism.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove references to dlib and OpenCV. Added TODOs to use with OSF.
[facial-landmarks-for-cubism.git]
/
include
/
facial_landmark_detector.h
diff --git
a/include/facial_landmark_detector.h
b/include/facial_landmark_detector.h
index
7c6f639
..
85f3512
100644
(file)
--- a/
include/facial_landmark_detector.h
+++ b/
include/facial_landmark_detector.h
@@
-27,10
+27,18
@@
SOFTWARE.
#include <deque>
#include <string>
#include <deque>
#include <string>
-#include <opencv2/opencv.hpp>
-#include <dlib/image_processing/frontal_face_detector.h>
-#include <dlib/image_processing.h>
-#include <dlib/gui_widgets.h>
+
+struct Point
+{
+ double x;
+ double y;
+
+ Point(double _x = 0, double _y = 0)
+ {
+ x = _x;
+ y = _y;
+ }
+};
class FacialLandmarkDetector
{
class FacialLandmarkDetector
{
@@
-46,6
+54,9
@@
public:
double faceXAngle;
double faceYAngle;
double faceZAngle;
double faceXAngle;
double faceYAngle;
double faceZAngle;
+ bool autoBlink;
+ bool autoBreath;
+ bool randomMotion;
// TODO eyebrows currently not supported...
// I'd like to include them, but the dlib detection is very
// noisy and inaccurate (at least for my face).
// TODO eyebrows currently not supported...
// I'd like to include them, but the dlib detection is very
// noisy and inaccurate (at least for my face).
@@
-66,29
+77,25
@@
private:
RIGHT
};
RIGHT
};
- cv::VideoCapture webcam;
- dlib::image_window win;
- dlib::frontal_face_detector detector;
- dlib::shape_predictor predictor;
bool m_stop;
bool m_stop;
- double calcEyeAspectRatio(
dlib::point& p1, dlib::p
oint& p2,
-
dlib::point& p3, dlib::p
oint& p4,
-
dlib::point& p5, dlib::p
oint& p6) const;
+ double calcEyeAspectRatio(
Point& p1, P
oint& p2,
+
Point& p3, P
oint& p4,
+
Point& p5, P
oint& p6) const;
- double calcRightEyeAspectRatio(
dlib::full_object_detection& shape
) const;
- double calcLeftEyeAspectRatio(
dlib::full_object_detection& shape
) const;
+ double calcRightEyeAspectRatio(
Point landmarks[]
) const;
+ double calcLeftEyeAspectRatio(
Point landmarks[]
) const;
double calcEyeOpenness(LeftRight eye,
double calcEyeOpenness(LeftRight eye,
-
dlib::full_object_detection& shape
,
+
Point landmarks[]
,
double faceYAngle) const;
double faceYAngle) const;
- double calcMouthForm(
dlib::full_object_detection& shape
) const;
- double calcMouthOpenness(
dlib::full_object_detection& shape
, double mouthForm) const;
+ double calcMouthForm(
Point landmarks[]
) const;
+ double calcMouthOpenness(
Point landmarks[]
, double mouthForm) const;
- double calcFaceXAngle(
dlib::full_object_detection& shape
) const;
- double calcFaceYAngle(
dlib::full_object_detection& shape
, double faceXAngle, double mouthForm) const;
- double calcFaceZAngle(
dlib::full_object_detection& shape
) const;
+ double calcFaceXAngle(
Point landmarks[]
) const;
+ double calcFaceYAngle(
Point landmarks[]
, double faceXAngle, double mouthForm) const;
+ double calcFaceZAngle(
Point landmarks[]
) const;
void populateDefaultConfig(void);
void parseConfig(std::string cfgPath);
void populateDefaultConfig(void);
void parseConfig(std::string cfgPath);
@@
-108,14
+115,10
@@
private:
struct Config
{
struct Config
{
- int cvVideoCaptureId;
- std::string predictorPath;
double faceYAngleCorrection;
double eyeSmileEyeOpenThreshold;
double eyeSmileMouthFormThreshold;
double eyeSmileMouthOpenThreshold;
double faceYAngleCorrection;
double eyeSmileEyeOpenThreshold;
double eyeSmileMouthFormThreshold;
double eyeSmileMouthOpenThreshold;
- bool showWebcamVideo;
- bool renderLandmarksOnVideo;
bool lateralInversion;
std::size_t faceXAngleNumTaps;
std::size_t faceYAngleNumTaps;
bool lateralInversion;
std::size_t faceXAngleNumTaps;
std::size_t faceYAngleNumTaps;
@@
-124,7
+127,6
@@
private:
std::size_t mouthOpenNumTaps;
std::size_t leftEyeOpenNumTaps;
std::size_t rightEyeOpenNumTaps;
std::size_t mouthOpenNumTaps;
std::size_t leftEyeOpenNumTaps;
std::size_t rightEyeOpenNumTaps;
- int cvWaitKeyMs;
double eyeClosedThreshold;
double eyeOpenThreshold;
double mouthNormalThreshold;
double eyeClosedThreshold;
double eyeOpenThreshold;
double mouthNormalThreshold;
@@
-137,6
+139,9
@@
private:
double faceYAngleZeroValue;
double faceYAngleUpThreshold;
double faceYAngleDownThreshold;
double faceYAngleZeroValue;
double faceYAngleUpThreshold;
double faceYAngleDownThreshold;
+ bool autoBlink;
+ bool autoBreath;
+ bool randomMotion;
} m_cfg;
};
} m_cfg;
};