Book Image

iOS Application Development with OpenCV 3

By : Joseph Howse
4 (1)
Book Image

iOS Application Development with OpenCV 3

4 (1)
By: Joseph Howse

Overview of this book

iOS Application Development with OpenCV 3 enables you to turn your smartphone camera into an advanced tool for photography and computer vision. Using the highly optimized OpenCV library, you will process high-resolution images in real time. You will locate and classify objects, and create models of their geometry. As you develop photo and augmented reality apps, you will gain a general understanding of iOS frameworks and developer tools, plus a deeper understanding of the camera and image APIs. After completing the book's four projects, you will be a well-rounded iOS developer with valuable experience in OpenCV.
Table of Contents (13 chapters)
iOS Application Development with OpenCV 3
Credits
About the Author
Acknowledgments
About the Reviewer
www.PacktPub.com
Preface
Index

Understanding histogram analysis


A histogram is a count of how many times each color occurs in an image. Typically, we do not count all possible colors separately; rather, we group similar colors together into bins. With a smaller number of bins, the histogram occupies less memory and offers a coarser basis of comparison. Typically, we want to choose some middle ground between very many bins (as the histograms tend to be highly dissimilar) and very few bins (as the histograms tend to be highly similar). For BeanCounter, let's start with 32 bins per channel (or 32^3=32678 bins in total), but you may change this value in the code to experiment with its effect.

A comparison of histograms can tell us whether two images contain similar colors. This kind of similarity alone does not necessarily mean that the images contain matching objects. For example, a silver fork and silver coin could have similar histograms. OpenCV supports several popular comparison algorithms. We will use the Alternative...