

OpenCV 3 Computer Vision
Application Programming
Cookbook
Third Edition
Recipes to help you build computer vision applications that
make the most of the popular C++ library OpenCV 3
Robert Laganiere
BIRMINGHAM - MUMBAI

OpenCV 3 Computer Vision Application
Programming Cookbook
Third Edition
Copyright © 2017 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 author, 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: May 2011
Second edition: August 2014
Third edition: February 2017
Production reference: 1070217
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.
ISBN 978-1-78646-971-7
www.packtpub.com

Credits
Author
Robert Laganiere
Copy Editor
Safis Editing
Reviewer
Luca Del Tongo
Project Coordinator
Ulhas Kambali
Commissioning Editor
Edward Gordon
Proofreader
Safis Editing
Acquisition Editor
Nitin Dasan
Indexer
Tejal Daruwale Soni
Content Development Editor
Nikhil Borkar
Graphics
Kirk D'Penha
Jason Monteiro
Technical Editor
Subhalaxmi Nadar
Production Coordinator
Shantanu Zagade

About the Author
Robert Laganiere is a professor at the School of Electrical Engineering and Computer
Science of the University of Ottawa, Canada. He is also a faculty member of the VIVA
research lab and is the co-author of several scientific publications and patents in content-
based video analysis, visual surveillance, driver-assistance, object detection, and tracking.
Robert authored the OpenCV2 Computer Vision Application Programming Cookbook in
2011 and co-authored Object Oriented Software Development published by McGraw Hill in
2001. He co-founded Visual Cortek in 2006, an Ottawa-based video analytics startup that
was later acquired by h t t p ://i w a t c h l i f e . c o m / in 2009. He is also a consultant in
computer vision and has assumed the role of Chief Scientist in a number of startups
companies such as Cognivue Corp, iWatchlife, and Tempo Analytics. Robert has a Bachelor
of Electrical Engineering degree from Ecole Polytechnique in Montreal (1987) and MSc and
PhD degrees from INRS-Telecommunications, Montreal (1996). Visit the author’s website at
h t t p ://w w w . l a g a n i e r e . n a m e /.
I wish to thank all my students at the VIVA lab; I learn so much from them.