Book Image

OpenCV with Python Blueprints

By : Michael Beyeler, Michael Beyeler (USD)
Book Image

OpenCV with Python Blueprints

By: Michael Beyeler, Michael Beyeler (USD)

Overview of this book

Table of Contents (14 chapters)
OpenCV with Python Blueprints
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Planning the app


The final app will consist of a main script that integrates the process flow end-to-end, from face detection to facial expression recognition, as well as some utility functions to help along the way.

Thus, the end product will require several components:

  • chapter7: The main script and entry-point for the chapter.

  • chapter7.FaceLayout: A custom layout based on gui.BaseLayout that operates in two different modes:

    • Training mode: In the training mode, the app will collect image frames, detect a face therein, assign a label depending on the facial expression, and upon exiting, save all the collected data samples in a file, so that it can be parsed by datasets.homebrew.

    • Testing mode: In the testing mode, the app will detect a face in each video frame and predict the corresponding class label by using a pre-trained MLP.

  • chapter3.main: The main function routine to start the GUI application.

  • detectors.FaceDetector: A class for face detection.

    • detect: A method to detect faces in a grayscale...