Skip to content

Instantly share code, notes, and snippets.

@Kikimora
Created November 7, 2016 01:14
Show Gist options
  • Save Kikimora/13c51b543e111928310e0d64a5c41f21 to your computer and use it in GitHub Desktop.
Save Kikimora/13c51b543e111928310e0d64a5c41f21 to your computer and use it in GitHub Desktop.
//Increase model sensitivity to lip points, otherwise model does not react to lips movements.
//See http://ibug.doc.ic.ac.uk/media/uploads/images/annotpics/figure_68_markup.jpg for magic constants
auto& p = _clnf_model->pdm.princ_comp;
//increase reg_factor to 50 only if princ_comp also change, otherwise detection quality suffer a lot
_det_parameters.reg_factor = 50;
auto n = _clnf_model->pdm.NumberOfPoints();
//left outer and inner lip edges
//X
p(48, 2) -= 14;
p(60, 2) -= 16;
//Y
p(48 + n, 2) -= 10;
p(60 + n, 2) -= 8;
//right outer and inner lip edges
//X
p(54, 2) += 24;
p(64, 2) += 26;
//Y
p(54 + n, 2) -= 10;
p(64 + n, 2) -= 8;
//upper inner lip X
for (int i = 61; i < 64; ++i) {
p(i + n, 0) -= 3;
}
//upper outer lip X
for (int i = 49; i < 54; ++i) {
p(i + n, 0) -= 3;
}
//bottom inner lip
//X
p(67, 0) -= 2;
p(65, 0) += 2;
//Y
for (int i = 65; i < 68; ++i) {
p(i + n, 0) += 5;
}
//bottom outer lip
//X
p(55, 0) += 2;
p(56, 0) += 2;
p(58, 0) -= 2;
p(59, 0) -= 2;
//Y
for (int i = 55; i < 60; ++i) {
p(i + n, 0) += 5;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment