OpenCV By Example
eBook - ePub

OpenCV By Example

  1. 296 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub
Book details
Book preview
Table of contents
Citations

About This Book

Enhance your understanding of Computer Vision and image processing by developing real-world projects in OpenCV 3

About This Book

  • Get to grips with the basics of Computer Vision and image processing
  • This is a step-by-step guide to developing several real-world Computer Vision projects using OpenCV 3
  • This book takes a special focus on working with Tesseract OCR, a free, open-source library to recognize text in images

Who This Book Is For

If you are a software developer with a basic understanding of Computer Vision and image processing and want to develop interesting Computer Vision applications with Open CV, this is the book for you. Knowledge of C++ is required.

What You Will Learn

  • Install OpenCV 3 on your operating system
  • Create the required CMake scripts to compile the C++ application and manage its dependencies
  • Get to grips with the Computer Vision workflows and understand the basic image matrix format and filters
  • Understand the segmentation and feature extraction techniques
  • Remove backgrounds from a static scene to identify moving objects for video surveillance
  • Track different objects in a live video using various techniques
  • Use the new OpenCV functions for text detection and recognition with Tesseract

In Detail

Open CV is a cross-platform, free-for-use library that is primarily used for real-time Computer Vision and image processing. It is considered to be one of the best open source libraries that helps developers focus on constructing complete projects on image processing, motion detection, and image segmentation.

Whether you are completely new to the concept of Computer Vision or have a basic understanding of it, this book will be your guide to understanding the basic OpenCV concepts and algorithms through amazing real-world examples and projects.

Starting from the installation of OpenCV on your system and understanding the basics of image processing, we swiftly move on to creating optical flow video analysis or text recognition in complex scenes, and will take you through the commonly used Computer Vision techniques to build your own Open CV projects from scratch.

By the end of this book, you will be familiar with the basics of Open CV such as matrix operations, filters, and histograms, as well as more advanced concepts such as segmentation, machine learning, complex video analysis, and text recognition.

Style and approach

This book is a practical guide with lots of tips, and is closely focused on developing Computer vision applications with OpenCV. Beginning with the fundamentals, the complexity increases with each chapter. Sample applications are developed throughout the book that you can execute and use in your own projects.

Frequently asked questions

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.
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.
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.
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.
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.
Yes, you can access OpenCV By Example by Prateek Joshi, David Millan Escriva, Vinicius Godoy in PDF and/or ePUB format, as well as other popular books in Informatica & Media digitali. We have over one million books available in our catalogue for you to explore.

Information

Year
2016
ISBN
9781785280948
Edition
1

OpenCV By Example


Table of Contents

OpenCV By Example
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
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 Started with OpenCV
Understanding the human visual system
How do humans understand image content?
Why is it difficult for machines to understand image content?
What can you do with OpenCV?
In-built data structures and input/output
Image processing operations
Building GUI
Video analysis
3D reconstruction
Feature extraction
Object detection
Machine learning
Computational photography
Shape analysis
Optical flow algorithms
Face and object recognition
Surface matching
Text detection and recognition
Installing OpenCV
Windows
Mac OS X
Linux
Summary
2. An Introduction to the Basics of OpenCV
Basic CMake configuration files
Creating a library
Managing dependencies
Making the script more complex
Images and matrices
Reading/writing images
Reading videos and cameras
Other basic object types
The vec object type
The Scalar object type
The Point object type
The Size object type
The Rect object type
RotatedRect object type
Basic matrix operations
Basic data persistence and storage
Writing to a file storage
Summary
3. Learning the Graphical User Interface and Basic Filtering
Introducing the OpenCV user interface
A basic graphical user interface with OpenCV
The graphical user interface with QT
Adding slider and mouse events to our interfaces
Adding buttons to a user interface
OpenGL support
Summary
4. Delving into Histograms and Filters
Generating a CMake script file
Creating the Graphical User Interface
Drawing a histogram
Image color equalization
Lomography effect
The cartoonize effect
Summary
5. Automated Optical Inspection, Object Segmentation, and Detection
Isolating objects in a scene
Creating an application for AOI
Preprocessing the input image
Noise removal
Removing the background using the light pattern for segmentation
The thresholding operation
Segmenting our input image
The connected component algorithm
The findContours algorithm
Summary
6. Learning Object Classification
Introducing machine learning concepts
Computer Vision and the machine learning workflow
Automatic object inspection classification example
Feature extraction
Training an SVM model
Input image prediction
Summary
7. Detecting Face Parts and Overlaying Masks
Understanding Haar cascades
What are integral images?
Overlaying a facemask in a live video
What happened in the code?
Get your sunglasses on
Looking inside the code
Tracking your nose, mouth, and ears
Summary
8. Video Surveillance, Background Modeling, and Morphological Operations
Understanding background subtraction
Naive background subtraction
Does it work well?
Frame differencing
How well does it work?
The Mixture of Gaussians approach
What happened in the code?
Morphological image processing
What's the underlying principle?
Slimming the shapes
Thickening the shapes
Other morphological operators
Morphological opening
Morphological closing
Drawing the boundary
White Top-Hat transform
Black Top-Hat transform
Summary
9. Learning Object Tracking
Tracking objects of a specific color
Building an interactive object tracker
Detecting points using the Harris corner detector
Shi-Tomasi Corner Detector
Feature-based tracking
The Lucas-Kanade method
The Farneback algorithm
Summary
10. Developing Segmentation Algorithms for Text Recognition
Introducing optical character recognition
The preprocessing step
Thresholding the image
Text segmentation
Creating connected areas
Identifying paragraph blocks
Text extraction and skew adjustment
Installing Tesseract OCR on your operating system
Installing Tesseract on Windows
Setting up Tesseract in Visual Studio
Setting the import and library paths
Configuring the linker
Adding the libraries to the windows path
Installing Tesseract on Mac
Using Tesseract OCR library
Creating a OCR function
Sending the output to a file
Summary
11. Text Recognition with Tesseract
How the text API works
The scene detection problem
Extremal regions
Extremal region filtering
Using the text API
Text detection
Text extraction
Text recognition
Summary
Index

OpenCV By Example

Copyright © 2016 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: January 2016
Production reference: 1150116
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78528-094-8
www.packtpub.com

Credits

Authors
Prateek Joshi
David MillĂĄn EscrivĂĄ
VinĂ­cius Godoy
Reviewers
Emmanuel d'Angelo
Dr. Bryan Wai-ching CHUNG
Nikolaus Gradwohl
Luis DĂ­az MĂĄs
Commissioning Editor
Ashwin Nair
Acquisition Editor
Tushar Gupta
Content Development Editor
Amey Varangaonkar
Technical Editor
Naveenkumar Jain
Copy Editor
Rashmi Sawant
Project Coordinator
Suzanne Coutinho
Proofreader
Safis Editing
Indexer
Hemangini Bari
Graphics
Kirk D'Penha
Production Coordinator
Shantanu N. Zagade
Cover Work
Shantanu N. Zagade

About the Authors

Prateek Joshi is a Computer Vision researcher and published author. He has over eight years of experience in this field with a primary focus on content-based analysis and deep learning. His work in this field has resulted in multiple patents, tech demos, and research papers at major IEEE conferences. He is the author of OpenCV with Python By Example, Packt Publishing.
He has won many hackathons using a wide variety of technologies related to image recognition. His blog has been visited by users in more than 200 countries, and...

Table of contents

  1. OpenCV By Example