Book Image

Mastering OpenCV 4 - Third Edition

By : Roy Shilkrot, David Millán Escrivá
Book Image

Mastering OpenCV 4 - Third Edition

By: Roy Shilkrot, David Millán Escrivá

Overview of this book

Mastering OpenCV, now in its third edition, targets computer vision engineers taking their first steps toward mastering OpenCV. Keeping the mathematical formulations to a solid but bare minimum, the book delivers complete projects from ideation to running code, targeting current hot topics in computer vision such as face recognition, landmark detection and pose estimation, and number recognition with deep convolutional networks. You’ll learn from experienced OpenCV experts how to implement computer vision products and projects both in academia and industry in a comfortable package. You’ll get acquainted with API functionality and gain insights into design choices in a complete computer vision project. You’ll also go beyond the basics of computer vision to implement solutions for complex image processing projects. By the end of the book, you will have created various working prototypes with the help of projects in the book and be well versed with the new features of OpenCV4.
Table of Contents (12 chapters)

iOS UI for panorama capture

Before we delve into the OpenCV code for turning an image collection into a panorama, we will first build a UI to support the easy capture of a sequence of overlapping images. First, we must make sure we have access to the camera as well as saved images. Open the Info.plist file and add the following three rows:

To start building the UI, we create a view with a View object for the camera preview on the right, and an overlapping ImageView on the left. ImageView should cover some area of the camera preview View, to help guide the user in capturing an image with enough overlap from the last. We can also add a few ImageView instances on top to show the previously captured images, and on the bottom a Capture button and a Stitch button to control the application flow:

To connect the camera preview to the preview View, we must do the following:

  1. Start a...