O'Reilly logo

iOS Application Development with OpenCV 3 by Joseph Howse

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Aligning and blending face elements

The rest of our app's functionality is in the implementation of the Face class. Create a new file, Face.cpp. Remember that Face has a species, matrix of image data, and coordinates for the centers of the eyes and tip of the nose. Also remember that we designed Face as an immutable type, and for this reason the constructor copies a given matrix rather than storing a reference to external data. At the start of Face.cpp, let's implement the constructor that takes a species, matrix, and feature points as arguments:

#include <opencv2/imgproc.hpp> #include "Face.h" Face::Face(Species species, const cv::Mat &mat, const cv::Point2f &leftEyeCenter, const cv::Point2f &rightEyeCenter, const cv::Point2f &noseTip) : species(species) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required