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

Defining blob descriptors and a blob classifier


Earlier in this chapter, in the Understanding keypoint matching section, we introduced the concept that a keypoint has a descriptor or set of descriptive statistics. Similarly, we can define a custom descriptor for a blob. As our classifier relies on histogram comparison and keypoint matching, let's say that a blob's descriptor consists of a normalized histogram and a matrix of keypoint descriptors. The descriptor object is also a convenient place to put the label. Create a new header file, BlobDescriptor.h, and put the following declaration of a BlobDescriptor class in it:

#ifndef BLOB_DESCRIPTOR_H
#define BLOB_DESCRIPTOR_H

#include <opencv2/core.hpp>

class BlobDescriptor
{
public:
  BlobDescriptor(const cv::Mat &normalizedHistogram,
    const cv::Mat &keypointDescriptors, uint32_t label);
  
  const cv::Mat &getNormalizedHistogram() const;
  const cv::Mat &getKeypointDescriptors() const;
  uint32_t getLabel() const...