From 98a8bc75835e4256244990c0003703fb1ab47c2d Mon Sep 17 00:00:00 2001 From: Scott Klum Date: Fri, 30 Oct 2015 15:53:50 +0000 Subject: [PATCH] Naming face points in dlib --- openbr/plugins/classification/dlib.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+), 0 deletions(-) diff --git a/openbr/plugins/classification/dlib.cpp b/openbr/plugins/classification/dlib.cpp index 219a811..0881429 100644 --- a/openbr/plugins/classification/dlib.cpp +++ b/openbr/plugins/classification/dlib.cpp @@ -42,6 +42,23 @@ private: shapeResource.setResourceMaker(new DLibShapeResourceMaker()); } + QPointF averagePoints(const QList &points, int rangeBegin, int rangeEnd) const + { + QPointF point; + for (int i=rangeBegin; i points = dst.file.points(); + dst.file.set("LeftEye",averagePoints(points,36,42)); + dst.file.set("RightEye",averagePoints(points,42,48)); + dst.file.set("Chin",points[8]); + } + void project(const Template &src, Template &dst) const { dst = src; @@ -61,6 +78,7 @@ private: full_object_detection shape = (*sp)(image, r); for (size_t i = 0; i < shape.num_parts(); i++) dst.file.appendPoint(QPointF(shape.part(i)(0),shape.part(i)(1))); + setFacePoints(dst); } else { // Crop the image on the rects for (int j=0; j