Book Image

OpenCV 3 Blueprints

Book Image

OpenCV 3 Blueprints

Overview of this book

Table of Contents (14 chapters)
OpenCV 3 Blueprints
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

The Android section – an application user interface


In this section, we will show you a basic user interface to capture and save the panorama to the internal storage. Basically, the user will see a fullscreen of the camera preview image. When the user presses the Capture button, the application will capture the current scene and put the captured image on an overlay layer above the current view. Therefore, the user knows what they have just captured and can change the phone position to capture the next image.

The following is a screenshot of the application when the user opens it and after the user captures an image:

An example of the user interface before and after a user captures an image

The setup activity layout

First, we will create a new Android project with a blank activity in Android Studio. Then, we will edit the layout xml for MainActivity in app/src/main/res/layout/activity_main.xml as follows:

<RelativeLayout   xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns...