Book Image

Android Application Programming with OpenCV

By : Joseph Howse
Book Image

Android Application Programming with OpenCV

By: Joseph Howse

Overview of this book

Take a smartphone from your pocket, and within a few seconds, you can snap a photo, manipulate it, and share it with the world. You have just achieved mass production of image data. With a computer vision library such as OpenCV, you can analyze and transform copious amounts of image data in real time on a mobile device. The upshot to this is that you, as developers, can provide mobile users with many new kinds of images, constantly highlighting certain visual features that are of artistic or practical interest. Android is a convenient platform for such experiments because it uses a high-level language (Java), it provides standardized interfaces for sharing image data between applications, and it is mostly open source, so everyone can study its implementation. Android Application Programming with OpenCV is a practical, hands-on guide that covers the fundamental tasks of computer vision—capturing, filtering, and analyzing images-with step-by-step instructions for writing both an application and reusable library classes. Android Application Programming with OpenCV looks at OpenCV's Java bindings for Android and dispels mysteries such as which version of these bindings to use, how to integrate with standard Android functionality for layout, event handling, and data sharing, and how to integrate with OpenGL for rendering. By following the clear, concise, and modular examples provided in this book, you will develop an application that previews, captures, and shares photos with special effects based on color manipulation, edge detection, image tracking, and 3D rendering.Beneath the application layer, you will develop a small but extensible library that you can reuse in your future projects. This library will include filters for selectively modifying an image based on edge detection, 2D and 3D image trackers, and adapters to convert the Android system's camera specifications into OpenCV and OpenGL projection matrices. If you want a quick start in computer vision for Android, then this is the book for you. By the end of Android Application Programming with OpenCV, you will have developed a computer vision application that integrates OpenCV, Android SDK, and OpenGL.
Table of Contents (12 chapters)
Android Application Programming with OpenCV
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 1. Setting Up OpenCV

This chapter is a quick guide for 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) 6: It includes tools for Java programming.

  • Cygwin 1.7 or greater (Windows only): It is a compatibility layer that provides Unix-like programming tools on Windows.

  • Android Software Development Kit (Android SDK) r21.0.1 or greater: It includes tools for programming Android apps in Java.

  • Android Native Development Kit (Android NDK) r8d or greater: It includes tools for programming Android apps in C++. Although this book deals with Java programming, OpenCV also includes Android-compatible C++ samples that you may want to compile and run.

  • Eclipse 4.2.1 (Juno) or greater: It is an integrated development environment (IDE).

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

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

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

  • OpenCV4Android 2.4.3.2 or greater: It includes OpenCV's Android version, including Java and C++ libraries.

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