Book Image

Android Application Programming with OpenCV 3

By : Joseph Howse
Book Image

Android Application Programming with OpenCV 3

By: Joseph Howse

Overview of this book

<p>Android Application Programming with OpenCV 3 is a practical, hands-on guide to computer vision and mobile app development. It shows how to capture, manipulate, and analyze images while building an application that combines photography and augmented reality. To help the reader become a well-rounded developer, the book covers OpenCV (a computer vision library), Android SDK (a mobile app framework), OpenGL ES (a 3D graphics framework), and even JNI (a Java/C++ interoperability layer).</p> <p>Now in its second edition, the book offers thoroughly reviewed code, instructions, and explanations. It is fully updated to support OpenCV 3 and Android 5, as well as earlier versions. Although it focuses on OpenCV's Java bindings, this edition adds an extensive chapter on JNI and C++, so that the reader is well primed to use OpenCV in other environments.</p>
Table of Contents (13 chapters)
Android Application Programming with OpenCV 3
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 1. Setting Up OpenCV

This chapter is a quick guide to setting up a development environment for Android and OpenCV. We will also look at the OpenCV sample applications, documentation, and community.

By the end of this chapter, our development environment will include the following components:

  • Java Development Kit (JDK) 7: This includes tools for Java programming. JDK 7 is the exact version that we require. The more recent version, JDK 8, is not yet supported for Android development.

  • Cygwin 1.7 or greater (Windows only): This is a compatibility layer that provides Unix-like programming tools on Windows. We need it in order to develop in C++ on Android.

  • Android Software Development Kit (Android SDK) r24.0.2 or greater: This includes tools for programming Android apps in Java.

  • Android Native Development Kit (Android NDK) r10d or greater: This includes tools for programming Android apps in C++.

  • Eclipse 4.4.2 (Luna) or greater: This is an integrated development environment (IDE). Although Google has started to recommend Android Studio as an IDE for Android development, Eclipse is still supported too. The OpenCV library and official samples are preconfigured as Eclipse projects, so for our purposes, Eclipse is a bit more convenient than Android Studio.

  • Java Development Tools (JDT): This is an Eclipse plugin for Java programming (already included in most Eclipse distributions).

  • C/C++ Development Tooling (CDT) 8.2.0 or greater: This is an Eclipse plugin for C/C++ programming.

  • Android Development Tools (ADT) 24.0.2 or greater: This is an Eclipse plugin for Android programming.

  • OpenCV4Android 3.0 or greater: This is OpenCV's Android version, including Java and C++ libraries.

    Note

    At the time of writing, OpenCV4Android's latest version is 3.0. This book targets version 3.0, but it also includes comprehensive notes on the differences between OpenCV 3.x and OpenCV 2.x. The author's website, http://nummist.com/opencv, offers two sets of code bundles: one for OpenCV 3.x (tested with 3.0) and another for OpenCV 2.x (tested with 2.4.9).

There are many possible ways to install and configure these components. We will cover several common setup scenarios, but if you are interested in further options, see OpenCV's official documentation at http://docs.opencv.org/doc/tutorials/introduction/android_binary_package/O4A_SDK.html.