OpenCV 3 Blueprints
eBook - ePub

OpenCV 3 Blueprints

Joseph Howse, Steven Puttemans, Quan Hua

Share book
  1. 382 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

OpenCV 3 Blueprints

Joseph Howse, Steven Puttemans, Quan Hua

Book details
Book preview
Table of contents
Citations

About This Book

Expand your knowledge of computer vision by building amazing projects with OpenCV 3

About This Book

  • Build computer vision projects to capture high-quality image data, detect and track objects, process the actions of humans or animals, and much more
  • Discover practical and interesting innovations in computer vision while building atop a mature open-source library, OpenCV 3
  • Familiarize yourself with multiple approaches and theories wherever critical decisions need to be made

Who This Book Is For

This book is ideal for you if you aspire to build computer vision systems that are smarter, faster, more complex, and more practical than the competition. This is an advanced book intended for those who already have some experience in setting up an OpenCV development environment and building applications with OpenCV. You should be comfortable with computer vision concepts, object-oriented programming, graphics programming, IDEs, and the command line.

What You Will Learn

  • Select and configure camera systems to see invisible light, fast motion, and distant objects
  • Build a "camera trap", as used by nature photographers, and process photos to create beautiful effects
  • Develop a facial expression recognition system with various feature extraction techniques and machine learning methods
  • Build a panorama Android application using the OpenCV stitching module in C++ with NDK support
  • Optimize your object detection model, make it rotation invariant, and apply scene-specific constraints to make it faster and more robust
  • Create a person identification and registration system based on biometric properties of that person, such as their fingerprint, iris, and face
  • Fuse data from videos and gyroscopes to stabilize videos shot from your mobile phone and create hyperlapse style videos

In Detail

Computer vision is becoming accessible to a large audience of software developers who can leverage mature libraries such as OpenCV. However, as they move beyond their first experiments in computer vision, developers may struggle to ensure that their solutions are sufficiently well optimized, well trained, robust, and adaptive in real-world conditions. With sufficient knowledge of OpenCV, these developers will have enough confidence to go about creating projects in the field of computer vision.

This book will help you tackle increasingly challenging computer vision problems that you may face in your careers. It makes use of OpenCV 3 to work around some interesting projects. Inside these pages, you will find practical and innovative approaches that are battle-tested in the authors' industry experience and research. Each chapter covers the theory and practice of multiple complementary approaches so that you will be able to choose wisely in your future projects. You will also gain insights into the architecture and algorithms that underpin OpenCV's functionality.

We begin by taking a critical look at inputs in order to decide which kinds of light, cameras, lenses, and image formats are best suited to a given purpose. We proceed to consider the finer aspects of computational photography as we build an automated camera to assist nature photographers. You will gain a deep understanding of some of the most widely applicable and reliable techniques in object detection, feature selection, tracking, and even biometric recognition. We will also build Android projects in which we explore the complexities of camera motion: first in panoramic image stitching and then in video stabilization.

By the end of the book, you will have a much richer understanding of imaging, motion, machine learning, and the architecture of computer vision libraries and applications!

Style and approach

This book covers a combination of theory and practice. We examine blueprints for specific projects and discuss the principles behind these blueprints, in detail.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is OpenCV 3 Blueprints an online PDF/ePUB?
Yes, you can access OpenCV 3 Blueprints by Joseph Howse, Steven Puttemans, Quan Hua in PDF and/or ePUB format, as well as other popular books in Informatik & Open-Source-Programmierung. We have over one million books available in our catalogue for you to explore.

Information

Year
2015
ISBN
9781784399757

OpenCV 3 Blueprints


Table of Contents

OpenCV 3 Blueprints
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Basic installation guides
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Getting the Most out of Your Camera System
Coloring the light
Capturing the subject in the moment
Rounding up the unusual suspects
Supercharging the PlayStation Eye
Supercharging the ASUS Xtion PRO Live and other OpenNI-compliant depth cameras
Supercharging the GS3-U3-23S6M-C and other Point Grey Research cameras
Shopping for glass
Summary
2. Photographing Nature and Wildlife with an Automated Camera
Planning the camera trap
Controlling a photo camera with gPhoto2
Writing a shell script to unmount camera drives
Setting up and testing gPhoto2
Writing a shell script for exposure bracketing
Writing a Python script to wrap gPhoto2
Finding libgphoto2 and wrappers
Detecting the presence of a photogenic subject
Detecting a moving subject
Detecting a colorful subject
Detecting the face of a mammal
Processing images to show subtle colors and motion
Creating HDR images
Creating time-lapse videos
Further study
Summary
3. Recognizing Facial Expressions with Machine Learning
Introducing facial expression recognition
Facial expression dataset
Finding the face region in the image
Extracting the face region using a face detection algorithm
Extracting facial landmarks from the face region
Introducing the flandmark library
Downloading and compiling the flandmark library
Detecting facial landmarks with flandmark
Visualizing the landmarks in an image
Extracting the face region
Software usage guide
Feature extraction
Extracting image features from facial component regions
Contributed features
Advanced features
Visualizing key points for each feature type
Computing the distribution of feature representation over k clusters
Clustering image features space into k clusters
Computing a final feature for each image
Dimensionality reduction
Software usage guide
Classification
Classification process
Splitting the dataset into a training set and testing set
Support vector machines
Training stage
Testing stage
Multi-layer perceptron
Training stage
Define the network
Train the network
Testing stage
K-Nearest Neighbors (KNN)
Training stage
The testing stage
Normal Bayes classifier
Training stage
Testing stage
Software usage guide
Evaluation
Evaluation with different learning algorithms
Evaluation with different features
Evaluation with a different number of clusters
System overview
Further reading
Compiling the opencv_contrib module
Kaggle facial expression dataset
Facial landmarks
What are facial landmarks?
How do you detect facial landmarks?
How do you use facial landmarks?
Improving feature extraction
K-fold cross validation
Summary
4. Panoramic Image Stitching Application Using Android Studio and NDK
Introducing the concept of panorama
The Android section – an application user interface
The setup activity layout
Capturing the camera frame
Using the Camera API to get the camera frame
Implementing the Capture button
Implementing the Save button
Integrating OpenCV into the Android Studio
Compiling OpenCV Android SDK to the Android Studio project
Setting up the Android Studio to work with OpenCV
Importing the OpenCV Android SDK
Creating a Java and C++ interaction with Java Native Interface (JNI)
Compiling OpenCV C++ with NDK/JNI
Implementing the OpenCV Java code
Implementing the OpenCV C++ code
Application showcase
Further improvement
Summary
5. Generic Object Detection for Industrial Applications
Difference between recognition, detection, and categorization
Smartly selecting and preparing application specific training data
The amount of training data
Creating object annotation files for the positive samples
Parsing your positive dataset into the OpenCV data vector
Parameter selection when training an object model
Training parameters involved in training an object model
The cascade classification process in detail
Step 1 – grabbing positive and negative samples
Step 2 – precalculation of integral image and all possible features from the training data
Step 3 – firing up the boosting process
Step 4 – saving the temporary result to a stage file
The resulting object model explained in detail
HAAR-like wavelet feature models
Local binary pattern models
Visualization tool for object models
Using cross-validation to achieve the best model possible
Using scene specific knowledge and constraints to optimize the detection result
Using the parameters of the detection command to influence your detection result
Increasing object instance detection and reducing false positive detections
Obtaining rotation invariance object detection
2D scale space relation
Performance evaluation and GPU optimizations
Object detection performance testing
Optimizations using GPU code
Practical applications
Summary
6. Efficient Person Identification Using Biometric Properties
Biometrics, a general approach
Step 1 – getting a good training dataset and applying application-specific normalization
Step 2 – creating a descriptor of the recorded biometric
Step 3 – using machine learning to match the retrieved feature vector
Step 4 – think about your authentication process
Face detection and recognition
Face detection using the Viola and Jones boosted cascade classifier algorithm
Data normalization on the detected face regions
Various face recognition approaches and their corresponding feature space
Eigenface decomposition through PCA
Linear discriminant analysis using the Fisher criterion
Local binary pattern histograms
The problems with facial recognition in its current OpenCV 3 based implementation
Fingerprint identification, how is it done?
Implementing the approach in OpenCV 3
Iris identification, how is it done?
Implementing the approach in OpenCV 3
Combining the techniques to create an efficient people-registration system
Summary
7. Gyroscopic Video Stabilization
Stabilization with images
Stabilization with hardware
A hybrid of hardware and software
The math
The camera model
The Camera motion
Rolling shutter compensation
Image warping
Project overview
Capturing data
Recording video
Recording gyro signals
Android specifics
Threaded overlay
Reading media files
Calibration
Data structures
Reading the gyroscope trace
The training video
Handling rot...

Table of contents