Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
OpenCV for Secret Agents

You're reading from  OpenCV for Secret Agents

Product type Book
Published in Jan 2015
Publisher Packt
ISBN-13 9781783287376
Pages 302 pages
Edition 1st Edition
Languages
Author (1):
Joseph Howse Joseph Howse
Profile icon Joseph Howse

Table of Contents (15) Chapters

OpenCV for Secret Agents
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
1. Preparing for the Mission 2. Searching for Luxury Accommodations Worldwide 3. Training a Smart Alarm to Recognize the Villain and His Cat 4. Controlling a Phone App with Your Suave Gestures 5. Equipping Your Car with a Rearview Camera and Hazard Detection 6. Seeing a Heartbeat with a Motion Amplifying Camera 7. Creating a Physics Simulation Based on a Pen and Paper Sketch Index

Training the classifier with reference images


 

Can you identify this coastline? Given time, yes.

 
 -- Photo caption, Dante Stella (http://www.dantestella.com/technical/hex352.html)

A small selection of reference images is included in this chapter's code bundle, which can be downloaded from my website, http://nummist.com/opencv/7376_02.zip. They are in a folder called images. Feel free to experiment with the classifier by adding more reference images, since a larger set might yield more reliable results. Bear in mind that our classifier relies on average similarity, so the more times you include a given color scheme in the reference images, the more heavily you are weighting the classifier in favor of that color scheme.

At the end of HistogramClassifier.py, let's add a main method to train and serialize a classifier using our reference images. We will also run the classifier on a couple of the images as a test. A partial implementation of the method is as follows:

def main():
  classifier...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}