Reader small image

You're reading from  OpenCV Computer Vision Application Programming Cookbook Second Edition

Product typeBook
Published inAug 2014
Reading LevelBeginner
PublisherPackt
ISBN-139781782161486
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Robert Laganiere
Robert Laganiere
author image
Robert Laganiere

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 start-up that was later acquired by iwatchlife.com in 2009. He is also a consultant in computer vision and has assumed the role of Chief Scientist in a number of start-up 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). You can visit the author's website at laganiere.name.
Read more about Robert Laganiere

Right arrow

Using a Controller design pattern to communicate with processing modules


As you build more complex applications, you will need to create multiple algorithms that can be combined together in order to accomplish some advanced tasks. Consequently, to properly set up the application and have all the classes communicate together will become more and more complex. It then becomes advantageous to centralize the control of the application in a single class. This is the idea behind the Controller design pattern. A Controller is a particular object that plays a central role in an application, and we will explore this in this recipe.

Getting ready

Using your favorite IDE, create a simple dialog-based application with two buttons; one button to select an image, and another button to start the processing, shown as follows:

Here, we use the ColorDetector class of the previous recipe.

How to do it…

The role of the Controller class is to first create the classes required to execute the application. Here, there...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
OpenCV Computer Vision Application Programming Cookbook Second Edition
Published in: Aug 2014Publisher: PacktISBN-13: 9781782161486

Author (1)

author image
Robert Laganiere

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 start-up that was later acquired by iwatchlife.com in 2009. He is also a consultant in computer vision and has assumed the role of Chief Scientist in a number of start-up 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). You can visit the author's website at laganiere.name.
Read more about Robert Laganiere