Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
iOS Application Development with OpenCV 3

You're reading from  iOS Application Development with OpenCV 3

Product type Book
Published in Jun 2016
Publisher Packt
ISBN-13 9781785289491
Pages 228 pages
Edition 1st Edition
Languages
Author (1):
Joseph Howse Joseph Howse
Profile icon Joseph Howse

Table of Contents (13) Chapters

iOS Application Development with OpenCV 3
Credits
About the Author
Acknowledgments
About the Reviewer
www.PacktPub.com
Preface
1. Setting Up Software and Hardware 2. Capturing, Storing, and Sharing Photos 3. Blending Images 4. Detecting and Merging Faces of Mammals 5. Classifying Coins and Commodities Index

Defining faces and a face detector


Let's define faces and a face detector in pure C++ code without using any dependencies except OpenCV. This ensures that the computer vision functionality of ManyMasks is portable. We could reuse the core of our code on a different platform with a different set of UI libraries.

A face has a species. For our purposes, this could be Human, Cat, or Hybrid. Let's create a header file, Species.h, and define the following enum in it:

#ifndef SPECIES_H
#define SPECIES_H

enum Species {
  Human,
  Cat,
  Hybrid
};

#endif // !SPECIES_H

A face also has a matrix of image data and three feature points representing the centers of the eyes and tip of the nose. We may construct a face in any of the following ways:

  • Specify a species, matrix, and feature points.

  • Create an empty face with default values, including an empty matrix.

  • Copy an existing face.

  • Merge two existing faces.

Let's create another header file, Face.h, and declare the following public interface of a Face class...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}