X-Git-Url: https://adrianiainlam.tk/git/?p=facial-landmarks-for-cubism.git;a=blobdiff_plain;f=src%2Ffacial_landmark_detector.cpp;h=fb536b686974c2df2acde59de1ed4ab1531134e9;hp=20ec7c837b5b0137fd963575dc721a8d780b526d;hb=2b1f0c7c63dc30d20c9d55fda5e99b208a9f82b3;hpb=c175b891523c9151a9663d1f20acf3009d2757df diff --git a/src/facial_landmark_detector.cpp b/src/facial_landmark_detector.cpp index 20ec7c8..fb536b6 100644 --- a/src/facial_landmark_detector.cpp +++ b/src/facial_landmark_detector.cpp @@ -111,6 +111,10 @@ FacialLandmarkDetector::Params FacialLandmarkDetector::getParams(void) const params.rightEyeSmile = 0; } + params.autoBlink = m_cfg.autoBlink; + params.autoBreath = m_cfg.autoBreath; + params.randomMotion = m_cfg.randomMotion; + return params; } @@ -668,6 +672,30 @@ void FacialLandmarkDetector::parseConfig(std::string cfgPath) line, lineNum); } } + else if (paramName == "autoBlink") + { + if (!(ss >> m_cfg.autoBlink)) + { + throwConfigError(paramName, "bool", + line, lineNum); + } + } + else if (paramName == "autoBreath") + { + if (!(ss >> m_cfg.autoBreath)) + { + throwConfigError(paramName, "bool", + line, lineNum); + } + } + else if (paramName == "randomMotion") + { + if (!(ss >> m_cfg.randomMotion)) + { + throwConfigError(paramName, "bool", + line, lineNum); + } + } else { std::ostringstream oss; @@ -714,6 +742,9 @@ void FacialLandmarkDetector::populateDefaultConfig(void) m_cfg.faceYAngleZeroValue = 1.8; m_cfg.faceYAngleDownThreshold = 2.3; m_cfg.faceYAngleUpThreshold = 1.3; + m_cfg.autoBlink = false; + m_cfg.autoBreath = false; + m_cfg.randomMotion = false; } void FacialLandmarkDetector::throwConfigError(std::string paramName,