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)

Camera access in Android OS

Most, if not all, mobile phone devices running Android are equipped with a video-capable camera, and the Android OS provides APIs to access the raw data stream from it. Up until Android version 5 (API level 21), Google recommended using the older Camera API; however, in recent versions, the API was deprecated in favor of the new Camera2 API, which we will use. A good example guide for using the Camera2 API is provided for Android developers by Google: https://github.com/googlesamples/android-Camera2Basic. In this section, we will only recount a few important elements, and the complete code can be viewed in the accompanying repository.

First, using the camera requires user permissions. In the AndroidManifest.xml file, we flag the following:

    <uses-permission android:name="android.permission.CAMERA" />
<uses-permission android...