iOS Application Development with OpenCV 3
eBook - ePub

iOS Application Development with OpenCV 3

  1. 228 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

iOS Application Development with OpenCV 3

About this book

Create four mobile apps and explore the world through photography and computer vision

About This Book

  • Efficiently harness iOS and OpenCV to capture and process high-quality images at high speed
  • Develop photographic apps and augmented reality apps quickly and easily
  • Detect, recognize, and morph faces and objects

Who This Book Is For

If you want to do computational photography and computer vision on Apple's mobile devices, then this book is for you. No previous experience with app development or OpenCV is required. However, basic knowledge of C++ or Objective-C is recommended.

What You Will Learn

  • Use Xcode and Interface Builder to develop iOS apps
  • Obtain OpenCV's standard modules and build extra modules from source
  • Control all the parameters of the iOS device's camera
  • Capture, save, and share photos and videos
  • Analyze colors, shapes, and textures in ordinary and specialized photographs
  • Blend and compare images to create special photographic effects and augmented reality tools
  • Detect faces and morph facial features
  • Classify coins and other objects

In Detail

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.

Style and approach

The book is practical, creative, and precise. It shows you the steps to create and customize five projects that solve important problems for beginners in mobile app development and computer vision. Complete source code and numerous visual aids are included in each chapter. Experimentation is an important part of the book. You will use computer vision to explore the real world, and then you will refine the projects based on your findings.

Tools to learn more effectively

Saving Books

Saving Books

Keyword Search

Keyword Search

Annotating Text

Annotating Text

Listen to it instead

Listen to it instead

iOS Application Development with OpenCV 3


Table of Contents

iOS Application Development with OpenCV 3
Credits
About the Author
Acknowledgments
About the Reviewer
www.PacktPub.com
eBooks, discount offers, and more
Why subscribe?
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Setting Up Software and Hardware
Setting up Apple's developer tools
Setting up the OpenCV framework
Getting the prebuilt framework with standard modules
Building the framework from source with extra modules
Making the extra modules optional in our code
Developing a minimal application
Creating the project
Adding files to the project
Configuring the project
Laying out an interface
Writing the code
Connecting an interface element to the code
Building and running the application
Distributing to testers and customers
Finding documentation and support
Understanding the camera and setting up photographic accessories
Lights
Tripods and other stabilization
Lens attachments
Summary
2. Capturing, Storing, and Sharing Photos
Planning a photo sharing application
Configuring the project
Adding frameworks
Specifying the camera requirement
Defining and laying out the view controller
Controlling the camera
Subclassing CvVideoCamera
Using the CvVideoCamera subclass in the view controller
Working with various color formats
RGB, BGR, RGBA, and BGRA
YUV and grayscale
Starting and stopping the busy mode
Saving an image to the Photos library
Displaying an alert
Sharing an image via social media
Running the application
Summary
3. Blending Images
Thinking about hybrid images
Planning the blending controls
Expanding the view controller's interface
Expanding the view controller's implementation
Using the application for practical purposes
Seeing changes in a scene
Previewing a new object in a scene
Previewing a copy of a document or drawing
Summary
4. Detecting and Merging Faces of Mammals
Understanding detection with cascade classifiers
Haar-like features
Local binary pattern features
Understanding transformations
Planning a face merging application
Configuring the project
Defining faces and a face detector
Defining and laying out the view controllers
Capturing and previewing real faces
Reviewing, saving, and sharing hybrid faces
Seguing between the view controllers
Detecting a hierarchy of face elements
Aligning and blending face elements
Using the application and acting like a cat
Learning more about face analysis
Summary
5. Classifying Coins and Commodities
Understanding blob detection
Segmentation
Canny edge detection
Contour analysis
Understanding histogram analysis
Understanding keypoint matching
SURF and FLANN
ORB and brute-force Hamming-distance matching
Planning an object classification application
Configuring the project
Defining blobs and a blob detector
Defining blob descriptors and a blob classifier
Laying out the splash screen
Defining and laying out the view controllers
Capturing and previewing blobs
Reviewing, saving, and sharing classified blobs
Seguing between the view controllers
Detecting blobs against a plain background
Classifying blobs by color and keypoints
Using the application and testing the tough cases
An unevenly-lit background
Motion blur
Out of focus
Reflection
Overlapping blobs
Taking your study of OpenCV to the next level
Summary
Index

iOS Application Development with OpenCV 3

Copyright © 2016 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: June 2016
Production reference: 1230616
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78528-949-1
www.packtpub.com

Credits

Author
Joseph Howse
Reviewer
Mohit Athwani
Commissioning Editor
Sarah Crofton
Acquisition Editor
Rahul Nair
Content Development Editor
Samantha Gonsalves
Technical Editor
Vivek Arora
Copy Editor
Tasneem Fatehi
Project Coordinator
Sanchita Mandal
Proofreader
Safis Editing
Indexer
Mariammal Chettiyar
Graphics
Disha Haria
Production Coordinator
Arvindkumar Gupta
Cover Work
Arvindkumar Gupta

About the Author

Joseph Howse lives in Canada. During the cold winters, he grows a beard and his four cats grow thick coats of fur. He combs the cats every day. Sometimes the cats pull his beard.
Joseph has been writing for Packt Publishing since 2012. His books include OpenCV for Secret Agents, OpenCV 3 Blueprints, Android Application Programming with OpenCV 3, iOS Application Development with OpenCV 3, Learning OpenCV 3 Computer Vision with Python, and Python Game Programming by Example.
When he is not writing books or grooming cats, Joseph provides consulting, training, and software development services through his company, Nummist Media (http://nummist.com/).

Acknowledgments

As always, Mom, Dad, and the cats have provided all kinds of support, including assistance with the photography in this book.
I am glad for this chance to recognize the iOS developers who trained me years ago. They include Alex Brodsky, Bill Wilson, Jesse Rusak, and Woody Lidstone.
During the writing of this book, I have benefitted from the opportunity to do other OpenCV projects with local colleagues such as Jeff Leadbetter, Matt Wright, Jad Tawil, and Kevin J. Gallant. I am proud that we are part of a growing computer vision community in Atlantic Canada.
Once again, the team at Packt Publishing has supported me with tremendous energy, skill, and loyalty. Thank you! Harsha Bharwani persuaded me to write another OpenCV book. After all, the set was incomplete without iOS. Samantha Gonsalves guided the project to completion, and she never let any complication discourage her or me. All the editors and the technical reviewer have added their marks of quality to the book, and...

Table of contents

  1. iOS Application Development with OpenCV 3

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn how to download books offline
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 990+ topics, we’ve got you covered! Learn about our mission
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more about Read Aloud
Yes! You can use the Perlego app on both iOS and Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app
Yes, you can access iOS Application Development with OpenCV 3 by Joseph Howse in PDF and/or ePUB format, as well as other popular books in Computer Science & Programming Mobile Devices. We have over one million books available in our catalogue for you to explore.